rpms/gdb/FC-5 gdb-6.3-gstack-without-path-20060414.patch, NONE, 1.1 gdb-6.3-sigchld-exception-20060331.patch, NONE, 1.1 gdb.spec, 1.179, 1.180

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Apr 14 07:06:46 UTC 2006


Author: aoliva

Update of /cvs/dist/rpms/gdb/FC-5
In directory cvs.devel.redhat.com:/tmp/cvs-serv4325/gdb-FC-5

Modified Files:
	gdb.spec 
Added Files:
	gdb-6.3-gstack-without-path-20060414.patch 
	gdb-6.3-sigchld-exception-20060331.patch 
Log Message:
* Fri Apr 14 2006 Alexandre Oliva <aoliva at redhat.com> - 6.3.0.0-1.128
- Avoid race conditions caused by exceptions messing with signal masks.
(BZ 175270, BZ 175083, maybe BZ 172938).
- Hardcode /bin and /usr/bin paths into gstack (BZ 179829).
- Build in a subdir of the source tree instead of in a sibling directory.
- Switch to versioning scheme that uses the same base revision number
for all OSes, and uses a suffix to tell the builds apart and ensure
upgradability.


gdb-6.3-gstack-without-path-20060414.patch:
 gstack.sh |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

--- NEW FILE gdb-6.3-gstack-without-path-20060414.patch ---
Index: gdb-6.3/gdb/gstack.sh
--- gdb-6.3/gdb/gstack.sh	2006-01-16 16:41:13.000000000 +0000
+++ gdb-6.3/gdb/gstack.sh	2006-02-02 09:22:12.000000000 +0000
@@ -17,17 +17,17 @@
 backtrace="bt"
 if test -d /proc/$1/task ; then
     # Newer kernel; has a task/ directory.
-    if test `ls /proc/$1/task | wc -l` -gt 1 2>/dev/null ; then
+    if test `/bin/ls /proc/$1/task | /usr/bin/wc -l` -gt 1 2>/dev/null ; then
 	backtrace="thread apply all bt"
     fi
 elif test -f /proc/$1/maps ; then
     # Older kernel; go by it loading libpthread.
-    if grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then
+    if /bin/grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then
 	backtrace="thread apply all bt"
     fi
 fi
 
-GDB=${GDB:-gdb}
+GDB=${GDB:-/usr/bin/gdb}
 
 if $GDB -nx --quiet --batch --readnever > /dev/null 2>&1; then
     readnever=--readnever
@@ -39,7 +39,7 @@
 $GDB --quiet $readnever -nx /proc/$1/exe $1 <<EOF 2>&1 | 
 $backtrace
 EOF
-sed -n \
+/bin/sed -n \
     -e 's/^(gdb) //' \
     -e '/^#/p' \
     -e '/^Thread/p'

gdb-6.3-sigchld-exception-20060331.patch:
 linux-nat.c |   35 ++++++++++++++++++++++-------------
 1 files changed, 22 insertions(+), 13 deletions(-)

--- NEW FILE gdb-6.3-sigchld-exception-20060331.patch ---
for gdb/ChangeLog
from Alexandre Oliva  <aoliva at redhat.com>

	* linux-nat.c (make_sure_sigchild_is_blocked): New function.
	(lin_lwp_attach_lwp, linux_nat_wait): Use it.

Index: gdb-6.3/gdb/linux-nat.c
===================================================================
--- gdb-6.3.orig/gdb/linux-nat.c	2006-02-14 17:21:08.000000000 -0200
+++ gdb-6.3/gdb/linux-nat.c	2006-03-31 03:21:17.000000000 -0300
@@ -827,6 +827,24 @@ iterate_over_lwps (int (*callback) (stru
   return NULL;
 }
 
+/* Make sure the set of blocked signals in effect contains SIGCHLD.
+   We used to try to avoid the system call by testing whether
+   blocked_mask contained SIGCHLD, but that is not reliable: caught
+   exceptions will restore the signal mask, leaving blocked_mask
+   unchanged.  There are no mechanisms available to get it in sync at
+   such times, since the exception that would cause this may be thrown
+   long after our caller returns.  Our callers could avoid the problem
+   by disabling the signal block before returning, but this would
+   defeat the point of the optimization.  Fortunately, all they care
+   about is that the signal block is in effect while they run, so
+   that's just what we do.  */
+static void
+make_sure_sigchild_is_blocked ()
+{
+  sigaddset (&blocked_mask, SIGCHLD);
+  sigprocmask (SIG_BLOCK, &blocked_mask, NULL);
+}
+
 /* Attach to the LWP specified by PID.  If VERBOSE is non-zero, print
    a message telling the user that a new LWP has been added to the
    process.  */
@@ -838,13 +856,9 @@ lin_lwp_attach_lwp (ptid_t ptid, int ver
 
   gdb_assert (is_lwp (ptid));
 
-  /* Make sure SIGCHLD is blocked.  We don't want SIGCHLD events
-     to interrupt either the ptrace() or waitpid() calls below.  */
-  if (!sigismember (&blocked_mask, SIGCHLD))
-    {
-      sigaddset (&blocked_mask, SIGCHLD);
-      sigprocmask (SIG_BLOCK, &blocked_mask, NULL);
-    }
+  /* We don't want SIGCHLD events to interrupt either the ptrace() or
+     waitpid() calls below.  */
+  make_sure_sigchild_is_blocked ();
 
   if (verbose)
     printf_filtered ("[New %s]\n", target_pid_to_str (ptid));
@@ -1856,12 +1870,7 @@ linux_nat_wait (ptid_t ptid, struct targ
 
   sigemptyset (&flush_mask);
 
-  /* Make sure SIGCHLD is blocked.  */
-  if (!sigismember (&blocked_mask, SIGCHLD))
-    {
-      sigaddset (&blocked_mask, SIGCHLD);
-      sigprocmask (SIG_BLOCK, &blocked_mask, NULL);
-    }
+  make_sure_sigchild_is_blocked ();
 
 retry:
 


Index: gdb.spec
===================================================================
RCS file: /cvs/dist/rpms/gdb/FC-5/gdb.spec,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -r1.179 -r1.180
--- gdb.spec	14 Apr 2006 05:52:54 -0000	1.179
+++ gdb.spec	14 Apr 2006 07:06:28 -0000	1.180
@@ -11,7 +11,7 @@
 Version: 6.3.0.0
 
 # The release always contains a leading reserved number, start it at 0.
-Release: 1.126
+Release: 1.128.FC5
 
 License: GPL
 Group: Development/Debuggers
@@ -21,7 +21,7 @@
 
 # For our convenience
 %define gdb_src gdb-6.3
-%define gdb_build gdb-%{version}-build-%{_target_platform}
+%define gdb_build %{gdb_src}/build-%{_target_platform}
 
 # Make sure we get rid of the old package gdb64, now that we have unified
 # support for 32-64 bits in one single 64-bit gdb.
@@ -281,6 +281,13 @@
 # Use bigger numbers than int.
 Patch176: gdb-6.3-large-core-20051206.patch
 
+# Do not let exceptions in GDB break SIGCHLD blocking.
+Patch177: gdb-6.3-sigchld-exception-20060331.patch
+
+# Hard-code executable names in gstack, such that it can run with a
+# corrupted or missing PATH.
+Patch178: gdb-6.3-gstack-without-path-20060414.patch
+
 %ifarch ia64
 BuildRequires: ncurses-devel glibc-devel gcc make gzip texinfo dejagnu libunwind >= 0.96-3
 %else
@@ -389,6 +396,8 @@
 %patch174 -p1
 %patch175 -p1
 %patch176 -p1
+%patch177 -p1
+%patch178 -p1
 
 # Change the version that gets printed at GDB startup, so it is RedHat
 # specific.
@@ -435,7 +444,7 @@
 enable_build_warnings="--enable-gdb-build-warnings=,-Werror"
 %endif
 
-../%{gdb_src}/configure \
+../configure \
 	--prefix=%{_prefix} \
 	--sysconfdir=%{_sysconfdir} \
 	--mandir=%{_mandir} \
@@ -557,13 +566,25 @@
 # don't include the files in include, they are part of binutils
 
 %changelog
-* Thu Apr 13 2006 Stepan Kasal <skasal at redhat.com>    - 6.3.0.0-1.126
+* Fri Apr 14 2006 Alexandre Oliva <aoliva at redhat.com> - 6.3.0.0-1.128
+- Avoid race conditions caused by exceptions messing with signal masks.
+(BZ 175270, BZ 175083, maybe BZ 172938).
+- Hardcode /bin and /usr/bin paths into gstack (BZ 179829).
+- Build in a subdir of the source tree instead of in a sibling directory.
+- Switch to versioning scheme that uses the same base revision number
+for all OSes, and uses a suffix to tell the builds apart and ensure
+upgradability.
+
+* Thu Apr 13 2006 Stepan Kasal <skasal at redhat.com>    - 6.3.0.0-1.127
 - Bump up release number.
 
 * Thu Apr 13 2006 Stepan Kasal <skasal at redhat.com>    - 6.3.0.0-1.123
-- Use fopen64 where available.  Fixes BZ 179399.
+- Use fopen64 where available.  Fixes BZ 178796.
 - Use bigger numbers than int.  Fixes BZ 171783.
 
+* Wed Mar  8 2006 Alexandre Oliva <aoliva at redhat.com> - 6.3.0.0-1.122
+- Bump up release number.
+
 * Wed Mar  8 2006 Alexandre Oliva <aoliva at redhat.com> - 6.3.0.0-1.119
 - Fix regression in PIE debugging (BZ 133944) (re?)introduced by
 the prelink fix (BZ 175075).  Improve testcase for the prelink fix.




More information about the fedora-cvs-commits mailing list