php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36808 syslog will output garbage from apache child process memory
Submitted: 2006-03-20 23:29 UTC Modified: 2006-03-21 00:07 UTC
From: emchen at isc dot upenn dot edu Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 5.1.2 OS: Linux 2.6.9 / RHEL4
Private report: No CVE-ID: None
 [2006-03-20 23:29 UTC] emchen at isc dot upenn dot edu
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-21 00:07 UTC] tony2001@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 14:01:29 2024 UTC