Bug #61083 [NEW]: Apache/mod_php ignores SIGHUP
From:
Operating system: Linux
PHP version: 5.4SVN-2012-02-14 (SVN)
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Apache/mod_php ignores SIGHUP
Description:
------------
Test Case
---------
1) Just start Apache with mod_php
2) generate some load (e.g. ab -t 120 http://.../hello.php)
3) run 'apachectl restart' for few times
4) 'apachectl stop'
5) Check Apache error_log
You will see warning and error messages:
[warn] child process 15317 still did not exit, sending a SIGTERM
[error] child process 15317 still did not exit, sending a SIGKILL
The reason of these errors is the fact that Apache/mod_php worker processws
ignore SIGHIP and the main Apache process kills them using SIGTERM or
SIGKILL.
I tried to analyze and debug zend_signal.c and found very wired behavior.
On first request zend_signal_activate() sets its own signal handler for
SIGHUP and stores the original handler in SIGG(handlers)[SIGHUP-1].handler,
but on second request the same zend_signal_activate() overwrites the
original signal handler by handler from parent process.
zend_signal.c:284
memcpy(&SIGG(handlers), &global_orig_handlers,
sizeof(global_orig_handlers));
As result the original signal handler for SIGHUP is never called.
Even worse after restart and two request SIGG(handlers)[SIGHUP-1].handler
becomes SIG_IGN and SIGHUP is ignored at all.
--
Edit bug report at https://bugs.php.net/bug.php?id=61083&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61083&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61083&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61083&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=61083&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61083&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=61083&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=61083&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=61083&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=61083&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=61083&r=support
Expected behavior: https://bugs.php.net/fix.php?id=61083&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=61083&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=61083&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=61083&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61083&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=61083&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=61083&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=61083&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=61083&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=61083&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=61083&r=mysqlcfg
Thread (2 messages)
- dmitry@php.net