This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Hurd] Blocked exceptions


Hello,

Currently, when a kernel exception is blocked, the exception is ignored
That poses problems when debugging a SIGSEGV handler which segfaults.
POSIX says that such situation has undefined behavior, but it is more
useful to get a core dump, so the patch below does this.

Samuel

2008-03-01  Samuel Thibault  <samuel.thibault@ens-lyon.org>

	* hurd/hurdsig.c (_hurd_internal_post_signal): Set action to
	dumping core if a kernel exception is blocked.

Index: hurd/hurdsig.c
===================================================================
RCS file: /cvs/glibc/libc/hurd/hurdsig.c,v
retrieving revision 1.159
diff -u -p -r1.159 hurdsig.c
--- hurd/hurdsig.c	21 Dec 2005 22:16:20 -0000	1.159
+++ hurd/hurdsig.c	8 Mar 2008 00:30:10 -0000
@@ -715,14 +715,19 @@ _hurd_internal_post_signal (struct hurd_
       act = term;
     }
 
-  /* Handle receipt of a blocked signal, or any signal while stopped.  */
-  if (act != ignore &&		/* Signals ignored now are forgotten now.  */
-      __sigismember (&ss->blocked, signo) ||
-      (signo != SIGKILL && _hurd_stopped))
-    {
-      mark_pending ();
-      act = ignore;
-    }
+  /* We should not let a kernel exception be ignored/blocked.  */
+  /* Not required by POSIX ("undefined behavior"), but useful.  */
+  if (detail->exc && __sigismember (&ss->blocked, signo))
+    act = core;
+  else
+    /* Handle receipt of a blocked signal, or any signal while stopped.  */
+    if (act != ignore &&	/* Signals ignored now are forgotten now.  */
+	__sigismember (&ss->blocked, signo) ||
+	(signo != SIGKILL && _hurd_stopped))
+      {
+	mark_pending ();
+	act = ignore;
+      }
 
   /* Perform the chosen action for the signal.  */
   switch (act)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]