Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64399 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10468 invoked from network); 21 Dec 2012 07:23:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Dec 2012 07:23:49 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 173.203.6.155 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 173.203.6.155 smtp155.ord.emailsrvr.com Linux 2.6 Received: from [173.203.6.155] ([173.203.6.155:55163] helo=smtp155.ord.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BD/43-20281-38E04D05 for ; Fri, 21 Dec 2012 02:23:48 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp20.relay.ord1a.emailsrvr.com (SMTP Server) with ESMTP id 14E371C0093; Fri, 21 Dec 2012 02:23:45 -0500 (EST) X-Virus-Scanned: OK Received: by smtp20.relay.ord1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 7C48E1C007E; Fri, 21 Dec 2012 02:23:44 -0500 (EST) Message-ID: <50D40E7F.8030804@sugarcrm.com> Date: Thu, 20 Dec 2012 23:23:43 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Patrick Schaaf CC: "internals@lists.php.net" , Jani Ollikainen References: <50D1D9B9.4060505@mmd.net> <50D30656.8090207@mmd.net> <50D35BA0.5010301@sugarcrm.com> <5952719.MaJMSR3yMW@rofl> In-Reply-To: <5952719.MaJMSR3yMW@rofl> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Crashes in lex_scan at Zend/zend_language_scanner.c / BUG #52752 From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > Is include supposed to take a LOCK_EX somehow? I can neither see that in php- > src (5.4.9) nor APC-trunk, doing a cursory grepping. I'm not sure how any lock would help, since locks are optional, meaning you still can do the same thing without the locks. > The prudent approach, which should avoid the problem altogether and not need > any LOCK_EX, dictates to ALWAYS write a temporary file (new inode), then > rename it when the write completely succeeds. Otherwise any reader, like > "include", runs the chance of seeing a partially written file, and even > without include using mmap internally, syntax errors would happen from time to > time. This looks like a very good advice, regardless of bus errors. > So, my conclusion would be that it is the code snippet above, and not any part > of PHP or the kernel, that is at fault. We could probably add an option to skip mmaps, but since as you pointed out that doesn't really fix the issue completely, better idea indeed is to fix the code. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227