Rasmus,

Sorry for the delay in the reply. According to my tests on linux using the sample script provided by the original bug reporter having no lock causes a problem when the error message is >4k in length. In this case multiple buffers are used and corruption can happen (it did on a dual cpu machine with 10 error log writing threads running), which is why I feel the lock is needed.


On 5-Apr-07, at 1:29 AM, Rasmus Lerdorf wrote:

Matt Wilmas wrote:
Hi,

Maybe just a Windows problem if it wasn't noticed yet, but I was compiling
the latest 5.2 snapshot and got:

main.obj : error LNK2019: unresolved external symbol _php_flock referenced
in function _php_log_err
Release_TS\php5ts.dll : fatal error LNK1120: 1 unresolved externals

Caused by this recent commit, http://news.php.net/php.cvs/43683, and I commented the php_flock line as a workaround. The Windows 5.2 snapshots
haven't been updated because of this either, of course.

I see no reason for that lock at all as I commented when this was
committed, but Ilia never replied. This is a single write operation now since those fprintf's are now one, so that part of the fix is good, but
the lock call is not needed since single writes in append mode are
atomic, even on Windows.

So, your work around is fine and should actually be committed.

-Rasmus

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


Ilia Alshanetsky

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to