[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

tst-cond7



The tst-cond7 test has exposed a problem (at least on PPC) where the
"SIGCANCEL" signal (signal 32, SIGRTMIN) gets blocked in the initial
thread somehow, and then all the child threads also have that signal
blocked.  This stops asynchronous cancellation from working.

We don't seem to explicitly unblock the SIGCANCEL signal anywhere.
I'm not sure where it is getting blocked, and I should chase that
down, but wouldn't it be a good idea to explicitly unblock the signal
in the initialization code?  I am using the patch below which does
that, and with that patch, tst-cond7 passes on PPC.

Paul.

diff -urN nptl-0.28/nptl/init.c libc/nptl/init.c
--- nptl-0.28/nptl/init.c	2003-02-27 14:57:23.000000000 +1100
+++ libc/nptl/init.c	2003-03-11 17:26:10.000000000 +1100
@@ -207,6 +207,10 @@
 
   (void) __libc_sigaction (SIGCANCEL, &sa, NULL);
 
+  sigset_t unblock_mask;
+  sigemptyset (&unblock_mask);
+  sigaddset (&unblock_mask, SIGCANCEL);
+  (void) pthread_sigmask (SIG_UNBLOCK, &unblock_mask, NULL);
 
   /* Determine the default allowed stack size.  This is the size used
      in case the user does not specify one.  */
diff -urN nptl-0.28/nptl/sysdeps/pthread/pthread_sigmask.c libc/nptl/sysdeps/pthread/pthread_sigmask.c
--- nptl-0.28/nptl/sysdeps/pthread/pthread_sigmask.c	2003-02-17 19:47:34.000000000 +1100
+++ libc/nptl/sysdeps/pthread/pthread_sigmask.c	2003-03-11 17:26:12.000000000 +1100
@@ -33,7 +33,7 @@
 
   /* The only thing we have to make sure here is that SIGCANCEL is not
      blocked.  */
-  if (newmask != NULL
+  if (newmask != NULL && how != SIG_UNBLOCK
       && __builtin_expect (__sigismember (newmask, SIGCANCEL), 0))
     {
       local_newmask = *newmask;





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]