php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43114 multiple servers outputting error_log onto shared NFS file include garbage byte
Submitted: 2007-10-27 07:20 UTC Modified: 2007-10-28 13:07 UTC
From: tom at razz dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.4 OS: Fedora 7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tom at razz dot com
New email:
PHP Version: OS:

 

 [2007-10-27 07:20 UTC] tom at razz dot com
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









Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-28 13:07 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

NFS locking is not reliable, so file corruption is not entirely un-
expected.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Dec 10 11:00:02 2025 UTC