#43114 [NEW]: multiple servers outputting error_log onto shared NFS file include garbage byte
| From: | tom at razz dot com | Date: | Sat, 27 Oct 2007 07:20:50 +0000 |
| Subject: | #43114 [NEW]: multiple servers outputting error_log onto shared NFS file include garbage byte | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-118993@lists.php.net to get a copy of this message | ||
From: tom at razz dot com
Operating system: Fedora 7
PHP version: 5.2.4
PHP Bug Type: *General Issues
Bug description: multiple servers outputting error_log onto shared NFS file include garbage byte
Description:
------------
i'm attempting to log php errors from multiple web servers (3) to a
single nfs-mounted file:
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
display_errors = Off
log_errors = On
error_log = /mnt/logs/php/webprod-php-error.log
lines are written in production to this file perhaps 1-3 every minute
via error_log facility. there aren't logging collisions at the
moment.
nfs server is a netapp fas3020c.
fstab line is:
nyp-netapp-2:/vol/logs /mnt/logs nfs
rw,bg,soft,rsize=32768,wsize=32768,vers=3 0 0
Thanks for the help!
Reproduce code:
---------------
<?php
// run concurrently from multiple servers to see garbage appear
while(1) {
sleep(rand(1,5));
error_log("test error");
}
Expected result:
----------------
an error log without garbage ^@ entries in between lines.
interestingly, writing my own error_log which explicitly does:
$lfp=fopen("/mnt/logs/logfile.txt","a");
fwrite($lfp,$log_message);
fclose($lfp);
does not result in the garbage data being inserted.
Actual result:
--------------
log contents look similar to this:
[26-Oct-2007 23:57:20] /usr/local/www/web/common/php-
include/facebook/class.Movi
eLines.php : Using cached values
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@
^@^@^@^@^@^@^@^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@^@^@^@^@^@^@^@
^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@[26-Oct-2007
23:57:44] /usr/
local/www/web/common/php-include/facebook/class.Movies.php : Using
cached values
[26-Oct-2007 23:57:44] /usr/local/www/web/common/php-
include/facebook/class.Movi
eLines.php : Using cached values
--
Edit bug report at http://bugs.php.net/?id=43114&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43114&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43114&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43114&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43114&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43114&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=43114&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43114&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43114&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43114&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43114&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43114&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=43114&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=43114&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43114&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43114&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43114&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43114&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43114&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43114&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43114&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43114&r=mysqlcfg