You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2008/10/01 21:08:13 UTC
DO NOT REPLY [Bug 45930] New: httpd.worker MPM fails to reset signal
mask before exec()ing external CGI binaries
https://issues.apache.org/bugzilla/show_bug.cgi?id=45930
Summary: httpd.worker MPM fails to reset signal mask before
exec()ing external CGI binaries
Product: Apache httpd-2
Version: 2.2.9
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: worker
AssignedTo: bugs@httpd.apache.org
ReportedBy: jsapbz@kanargh.force9.co.uk
Created an attachment (id=22663)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=22663)
Test case
The attached test case works fine under the normal prefork MPM, but hangs under
the worker MPM.
What happens is the worker MPM uses apr_setup_signal_thread() to arrange for
all signals it can possibly block to be blocked using sigprocmask(). It then
uses sigwait() to dispatch individual signals in a more controlled fashion
under (I assume) a single nominated thread.
When invoking an external CGI binary via fork()/exec(), it fails to reset the
signal mask. Pretty much every standalone UNIX program that uses signals
assumes it is started with an empty mask and all it need do is call
signal()/sigaction().
In the test case, iostat uses signal()/alarm()/pause() to implement the 2
second data gathering delay. Entering it with SIGALRM blocked means the timeout
never expires and the process hangs forever. However this issue is more general
and applies to any external binary that expects to be able to use one of the
blocked signals for its own purposes.
The solution is to reset the signal mask after the fork() (so that the parent
Apache process is not affected) but before the exec() so that the CGI child
inherits a sane state.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 45930] httpd.worker MPM fails to reset signal mask
before exec()ing external CGI binaries
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45930
Ruediger Pluem <rp...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|worker |APR
Product|Apache httpd-2 |APR
Version|2.2.9 |HEAD
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 45930] httpd.worker MPM fails to reset signal mask
before exec()ing external CGI binaries
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45930
Ruediger Pluem <rp...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|bugs@httpd.apache.org |bugs@apr.apache.org
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 45930] httpd.worker MPM fails to reset signal mask
before exec()ing external CGI binaries
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45930
--- Comment #1 from John Sullivan <js...@kanargh.force9.co.uk> 2008-10-01 12:09:59 PST ---
Created an attachment (id=22664)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=22664)
Proposed fix against HEAD APR
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org