#40897 [Csd]: error_log file not locked
| From: | rquadling@php.net | Date: | Thu, 05 Apr 2007 14:27:30 +0000 |
| Subject: | #40897 [Csd]: error_log file not locked | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-111153@lists.php.net to get a copy of this message | ||
ID: 40897
Updated by: rquadling@php.net
Reported By: david at acz dot org
Status: Closed
Bug Type: Filesystem function related
Operating System: Any
PHP Version: 5.2.1
Assigned To: iliaa
New Comment:
A Win32 equivalent...
for %x in (1 2) do start php -r
"ini_set('error_log','/tmp/test.log');for($i=0;$i<10000;$i++)error_log(str_repeat(%x,5000));"
This should all be on 1 line.
Previous Comments:
------------------------------------------------------------------------
[2007-04-01 19:29:48] iliaa@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.
------------------------------------------------------------------------
[2007-03-26 14:17:38] david at acz dot org
O_APPEND is atomic for a single write. php_log_err uses stdio, so a
log entry longer than the stdio buffer size will cause non-atomic
writes.
Try this:
for x in A B; do php -r
'ini_set("error_log","/tmp/test.log");for($i=0;$i<10000;$i++)error_log(str_repeat("'$x'",5000));'
& done
------------------------------------------------------------------------
[2007-03-25 14:22:20] iliaa@php.net
Append is atomic and does not require locking.
------------------------------------------------------------------------
[2007-03-22 20:39:21] david at acz dot org
Description:
------------
The internal php_log_err function does not lock the output file. This
causes long messages to get mixed together.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40897&edit=1