Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64405 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23803 invoked from network); 21 Dec 2012 09:24:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Dec 2012 09:24:19 -0000 Authentication-Results: pb1.pair.com header.from=php@bof.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=brianofish@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.175 as permitted sender) X-PHP-List-Original-Sender: brianofish@gmail.com X-Host-Fingerprint: 209.85.215.175 mail-ea0-f175.google.com Received: from [209.85.215.175] ([209.85.215.175:35754] helo=mail-ea0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C9/85-20281-3CA24D05 for ; Fri, 21 Dec 2012 04:24:19 -0500 Received: by mail-ea0-f175.google.com with SMTP id h11so1735413eaa.6 for ; Fri, 21 Dec 2012 01:24:16 -0800 (PST) X-Received: by 10.14.213.134 with SMTP id a6mr30358049eep.45.1356081855896; Fri, 21 Dec 2012 01:24:15 -0800 (PST) Received: from rofl.localnet ([213.135.15.139]) by mx.google.com with ESMTPS id r1sm20525853eeo.2.2012.12.21.01.24.14 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Dec 2012 01:24:15 -0800 (PST) To: internals@lists.php.net Cc: Jani Ollikainen Date: Fri, 21 Dec 2012 10:24:11 +0100 Message-ID: <2081737.rfJYvbmhGA@rofl> User-Agent: KMail/4.9.4 (Linux/3.6.11-k10-bof; KDE/4.9.4; x86_64; ; ) In-Reply-To: <50D420D7.7030203@mmd.net> References: <50D1D9B9.4060505@mmd.net> <5952719.MaJMSR3yMW@rofl> <50D420D7.7030203@mmd.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [PHP-DEV] Crashes in lex_scan at Zend/zend_language_scanner.c / BUG #52752 From: php@bof.de (Patrick Schaaf) On Friday 21 December 2012 10:41:59 Jani Ollikainen wrote: > > 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. > > Oh? Did I understand you correctly? If you can code PHP that crashes > PHP, it's that codes fault not PHP's fault? I've always thought PHP > to be high level programming language where PHP handles things for > you and you can't code anything that crashes it like that with > bus error? I understand your sentiment. To follow up the sentiment in code, there would be two options: 1) capture SIGBUS (and SIGSEGV probably, depending on platform), and in the signal handler, to lots of funny dances to guess from the stack what kind of error message would be helpful to the end user or end developer. 2) remove any attempt to use mmap to speed up reading, generally, or as an ini option. I would personally expect mmap-reading not to make a huge difference in performance anyway, as the short segment double buffering that it avoids, will probably be swamped by any kind of parsing of the content anyway. But probably when people went to the lengths of implementing mmap based reading in the PHP core, they had some good reasons to do so... > I think that it should at least gracefully exit, log error, what caused > what and where. Better option would be that it just works. It CANNOT just work. It wouldn't work reliably without any use of mmap, either. Concurrently modifying and reading one and the same file, will always run into consistency problems, and doing that is CERTAINLY the fault of the code that does it. best regards Patrick