httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <>
Subject [1.3 PATCH] required change to sigmask used while pthread mutex held
Date Sat, 03 May 2003 12:08:55 GMT
Currently the signal mask blocks all synchronous signals.  That is 
bogus, and on (at least) AIX it can be seen to interfere with proper 
recovery if one of those signals, such as SIGSEGV, is generated during 
the time that it is blocked.  Here is text from the Solaris 8 manpage 
for pthread_sigmask:

      Signals which are  generated  synchronously  should  not  be
      masked.  If  such  a  signal  is  blocked and delivered, the
      receiving process is killed.

An idle child process being terminated can hold the pthread mutex and 
have these signals blocked while running a 3rd-party module's child exit 
hook or pool cleanups.  (I hope to address that with a future patch, but 
this patch is appropriate independently.)  If such code segfaults, 
having the corresponding synchronous signal blocked (SIGSEGV) is bad news.

The code is copied from APR, which must do the same thing when it sets 
of signal masks for applications.  Note that in APR currently there is 
some misplaced SIGUSR2 handling that doesn't belong in 
remove_sync_sigs().  That logic was not copied.

Looking for some +1s ;)

I suspect that this additional APR code, used in the context of 
sigwait() there, is also appropriate for the pthread mutex signal mask:

     /* On certain platforms, sigwait() returns EINVAL if any of various
      * unblockable signals are included in the mask.  This was first
      * observed on AIX and Tru64.
#ifdef SIGKILL
     sigdelset(&sig_mask, SIGKILL);
#ifdef SIGSTOP
     sigdelset(&sig_mask, SIGSTOP);
#ifdef SIGCONT
     sigdelset(&sig_mask, SIGCONT);
     sigdelset(&sig_mask, SIGWAITING);

I haven't had time to explore that aspect, and it isn't necessary to 
resolve some problems I've seen, so I'll save that for another day and 
instead hope to make some incremental progress.  I have hopes that the 
SIGSTOP/SIGCONT change may fix the frequent inability to attach to child 
processes waiting on a pthread mutex on AIX.

View raw message