Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28687 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66098 invoked by uid 1010); 5 Apr 2007 14:47:09 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 66083 invoked from network); 5 Apr 2007 14:47:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Apr 2007 14:47:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=rquadling@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rquadling@googlemail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 66.249.92.175 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@googlemail.com X-Host-Fingerprint: 66.249.92.175 ug-out-1314.google.com Linux 2.4/2.6 Received: from [66.249.92.175] ([66.249.92.175:44424] helo=ug-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FD/D9-19248-DEB05164 for ; Thu, 05 Apr 2007 10:47:09 -0400 Received: by ug-out-1314.google.com with SMTP id o4so1038535uge for ; Thu, 05 Apr 2007 07:47:06 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=googlemail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=GqrMm9Aixw/sEFikuxohGgPmTCAu3zvzEEGYa5mzNfZAbFzmiMYJ4HSzLdAFIFTbcixVI1+PcxATaolEDEkPSHdK6h4sL2m38EjYfhYGPNq/vom7beZGvkN1CzYg40adKUyeEyD06SBeAm5FUxhvfKaNsh5H/f0RDtNjIEi/2lQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=t39SowPkJVcy5BuOmT5w5eE1wDcZ89NtGqPhrcDvK0rYXbI/1d6lxSneco82TMy4audEWjJvOPQkoTcapDL1rA13hNMPQOHAj6wbdu4+Id1XHBxhBIZbUlS0E7df25+Y96aOg0edqP2GN1pdHee3aNlSh95C1e0taIKpUuw0fdA= Received: by 10.78.203.13 with SMTP id a13mr319851hug.1175784426068; Thu, 05 Apr 2007 07:47:06 -0700 (PDT) Received: by 10.78.48.5 with HTTP; Thu, 5 Apr 2007 07:47:06 -0700 (PDT) Message-ID: <10845a340704050747w5dcba873p25390cfabbb695bd@mail.gmail.com> Date: Thu, 5 Apr 2007 15:47:06 +0100 Reply-To: RQuadling@GoogleMail.com To: "Ilia Alshanetsky" Cc: "Rasmus Lerdorf" , "Matt Wilmas" , internals@lists.php.net In-Reply-To: <10845a340704050742n38ef04c0t7f6f2ad85e2711b5@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <007b01c77735$89410420$0201a8c0@pc1> <46148933.7030709@lerdorf.com> <646617A7-86A7-4E64-94CE-8E5D5766741A@prohost.org> <10845a340704050742n38ef04c0t7f6f2ad85e2711b5@mail.gmail.com> Subject: Re: [PHP-DEV] Build failure From: rquadling@googlemail.com ("Richard Quadling") Using ProcMon on WinXP, you can see that the different processes interleave the writes but in blocks of 4096 bytes. The remaining 929 bytes will sometimes be written after another processes 4096/929 bytes. Locking IS required here. On 05/04/07, Richard Quadling wrote: > Using PHP 5.2.2-dev (cli) (built: Mar 23 2007 07:02:57) I can > replicate the problem on Windows. > > Using this single line command at the CMD prompt: > > for %x in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do > start php -r "ini_set('error_log','/tmp/test.log');for($i=0;$i<100;$i++)error_log(str_repeat('%x',5000));" > > The log file has many broken lines. > > On 05/04/07, Ilia Alshanetsky wrote: > > 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 > > > > > > > -- > ----- > Richard Quadling > Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 > "Standing on the shoulders of some very clever giants!" > -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!"