From: emchen at isc dot upenn dot edu Operating system: Linux 2.6.9 / RHEL4 PHP version: 5.1.2 PHP Bug Type: Unknown/Other Function Bug description: syslog will output garbage from apache child process memory
Description: ------------ the bug is a bit difficult to explain, it revolves around an apache child process handling multiple PHP requests that use openlog/syslog. the behavior of the bug is described in bug #28722 and bug #35777, namely garbage appearing as the process name / ident field in syslog. the bug occurs when an apache child process handles a script that makes an openlog called followed by a script that makes a syslog called without openlog (separate requests). Reproduce code: --------------- to recreate bug: 1.) set Apache (forking) MaxClients 1 2.) call php script with: <? syslog(LOG_WARNING,"testing"); ?> 3.) call php script with: <? openlog("MYLOG",LOG_PID,LOG_LOCAL0); syslog(LOG_WARNING,"this is a warning"); ?> 4.) call php script with: <? phpinfo(); ?> 4.) call php script with: <? syslog(LOG_WARNING,"testing"); ?> Expected result: ---------------- in the attached code; the calls to syslog in step 2,3 produce normal output, output from step 4 should be garbage. since the apache child process persists beyond the execution of the PHP scripts, step 4 picks up the results of the openlog call in step 2. when sylog gets called the 3rd time the reference to "ident" is garbage. Actual result: -------------- user.log: Mar 20 16:54:15 [host] httpd: testing local0.log: Mar 20 16:56:41 [host] MYLOG[18679]: this is a warning local0.log: Mar 20 16:58:57 [host] [garbage][18679]: testing -- Edit bug report at http://bugs.php.net/?id=36808&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36808&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36808&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36808&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36808&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36808&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36808&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=36808&r=needscript Try newer version: http://bugs.php.net/fix.php?id=36808&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36808&r=support Expected behavior: http://bugs.php.net/fix.php?id=36808&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36808&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36808&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36808&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36808&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36808&r=dst IIS Stability: http://bugs.php.net/fix.php?id=36808&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36808&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36808&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36808&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=36808&r=mysqlcfg