-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I recently encountered problems with stuck Apache processes that upon analysis can be traced back to the signal handler saving/restoration code within mod_perl. This issue appears to have been originally reported by Charles Jardine in Oct 2002 (see included original e-mail from mod_perl user's list).
The problem stems from the use of Perl's rsignal_state() and rsignal() functions to save and restore, respectively, the SIGALRM signal handler that was installed by Apache. If the OS does not have sigaction() (requiring Perl to use signal() instead), this is fine, as the only arguments to signal() are the signal number and the handler. However, with sigaction(), there are other fields, with the flags being the most important for this particular issue, especially SA_RESTART. Using rsignal_state() and rsignal() does nothing to preserve these other fields; in fact, rsignal() will specifically set SA_RESTART if it is defined (in Perl 5.6.x at least).
A better way to handle this for systems with sigaction() is to use the rsignal_save() and rsignal_restore() functions in Perl, which will properly save and restore the sigaction structure, thereby preserving the flags et al. While Perl 5.8.x does not set SA_RESTART (and thereby avoids the specific problem I encountered), saving and restoring the entire sigaction structure seems to me to be "the right thing to do".
Thank you for the detailed report and the patch, Douglas. It's on the mp1 TODO list now.
Any idea whether mod_perl 2.0 may have any of these issues? In particular I'm after tests that we can reproduce the problem with.
Thanks.
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
-- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html