From: ncross42 at cyworld dot com Operating system: Ubuntu-8.04.1-server PHP version: 5.2.8 PHP Bug Type: Apache2 related Bug description: unexpected termination
Description: ------------ This bug is a apache-thread related php excution bug. This bug is repeatable and clear. 1. System setting. a. apache-2.2.10 : mpm=worker and using shared modules. -=-=-= httpd.conf =-=-=- for simple test, values are low. <IfModule worker.c> StartServers 1 MinSpareThreads 2 MaxSpareThreads 4 ThreadsPerChild 2 # <- this is important. MaxRequestsPerChild 5 # <- this is important. </IfModule> b. PHP-5.2.8 : using apxs2 and enable-maintainer-zts for threadsafe (no external cache like APC or XCache) Reproduce code: --------------- -=-= code of 1.php =-=- <?php echo '1<br>'; echo date("H:i:s").'<br>'; sleep(10); echo date("H:i:s").'<br>'; ?> -=-= code of 2.php =-=- <?php echo '2<br>'; echo date("H:i:s").'<br>'; echo date("H:i:s").'<br>'; ?> Expected result: ---------------- <bug scenario> (a) browse 1.php and 2.php <concurrently ONCE>. result are not problem. -=-= result page of 1.php =-=- 1 11:04:29 11:04:39 -=-= result page of 2.php =-=- 2 11:04:30 11:04:30 (b) I expected ... - browse 1.php and 2.php - refresh 2.php over 10 times very fast within 10 sec. (yes, using F5) - I expected below normal resuluts. -=-= result page of 1.php =-=- 1 11:12:47 11:12:49 -=-= result page of 2.php =-=- 2 11:12:49 11:12:49 Actual result: -------------- <ANALYSIS> (a) initial apache process is here Shell> ps ax | grep httpd 5697 ? Ss 0:00 /skcomms/apache/bin/httpd -k restart 5964 ? Sl 0:00 /skcomms/apache/bin/httpd -k restart - becuase below apache setting <IfModule worker.c> StartServers 1 MinSpareThreads 2 ThreadsPerChild 2 ... </IfModule> (b) suppose - in (a) action, two connection is established with process 5964 - in (b) action, new 1.php is sleeping in 5964 and 2.php is excuted in other new process because below reason. <IfModule worker.c> ... ThreadsPerChild 2 MaxRequestsPerChild 5 </IfModule> (c) expected in 1.php excution time (within 10 sec) 5697 ? Ss 0:00 /skcomms/apache/bin/httpd -k restart 5964 ? Sl 0:00 /skcomms/apache/bin/httpd -k restart (1.php is sleeping here) 597x ? Sl 0:00 /skcomms/apache/bin/httpd -k restart (2.php is browsed here) (d) but actually 5964 is terminated early in 2 seconds. 5697 ? Ss 0:00 /skcomms/apache/bin/httpd -k restart 5991 ? Sl 0:00 /skcomms/apache/bin/httpd -k restart -- Edit bug report at http://bugs.php.net/?id=46830&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46830&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46830&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46830&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=46830&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46830&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=46830&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=46830&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=46830&r=needscript Try newer version: http://bugs.php.net/fix.php?id=46830&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=46830&r=support Expected behavior: http://bugs.php.net/fix.php?id=46830&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=46830&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=46830&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=46830&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46830&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=46830&r=dst IIS Stability: http://bugs.php.net/fix.php?id=46830&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=46830&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=46830&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=46830&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=46830&r=mysqlcfg