Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57565 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71330 invoked from network); 30 Jan 2012 09:18:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jan 2012 09:18:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=yoram.b@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yoram.b@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.199.177.89 as permitted sender) X-PHP-List-Original-Sender: yoram.b@zend.com X-Host-Fingerprint: 212.199.177.89 il-mr1.zend.com Received: from [212.199.177.89] ([212.199.177.89:47755] helo=il-mr1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FB/61-53934-F70662F4 for ; Mon, 30 Jan 2012 04:18:56 -0500 Received: from il-gw1.zend.com (unknown [10.1.1.22]) by il-mr1.zend.com (Postfix) with ESMTP id 220F3607DA; Mon, 30 Jan 2012 11:17:21 +0200 (IST) Received: from mandor.localnet (10.1.3.58) by il-ex2.zend.net (10.1.1.22) with Microsoft SMTP Server (TLS) id 14.1.255.0; Mon, 30 Jan 2012 11:18:14 +0200 To: Dmitry Stogov Date: Mon, 30 Jan 2012 11:18:46 +0200 User-Agent: KMail/1.13.7 (Linux/2.6.37; KDE/4.7.2; i686; ; ) CC: Stas Malyshev , PHP Internals , Zeev Suraski , Lior Kaplan References: <201201291807.52092.yoram.b@zend.com> <4F25DBC8.9000308@sugarcrm.com> <4F2645AE.80606@zend.com> In-Reply-To: <4F2645AE.80606@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-ID: <201201301118.46459.yoram.b@zend.com> X-Originating-IP: [10.1.3.58] Subject: Re: One more crash in PHP 5.4 From: yoram.b@zend.com (yoram bar haim) We have the crash in Zend JavaBridge, but yes it will probably occur in .com eather. ther scenario is quite simple, you just call a method in a loop. in the second interation, it will crash. here is a stenario with JavaBridge : xxx(); } catch (Exception $e) { } } ?> On Monday, January 30, 2012 09:24:30 AM Dmitry Stogov wrote: > Hi, > > On 01/30/2012 03:52 AM, Stas Malyshev wrote: > > Hi! > > > >> in zend_vm_execute.h:701 PHP free's the function struct in case of > >> ZEND_OVERLOADED_FUNCTION. the problem is that in PHP 5.4, the opline > >> calling > >> the function hast a pointer to the very same struct in it's > >> cache_slot. when > >> this opcode is called againg, the cache is used and it crashes. > > > > How this can be reproduced? > > I would like to see the test case too as well. Is it related to > ext/com_dotnet? It's the only extension that uses overloaded functions > in php distribution. > > >> my suggested fix is not to cache ZEND_OVERLOADED_FUNCTION, it does > >> solve the > >> problem and makes sense to me logically. it is also possible to not > >> free it > >> and let it be re-used from cache_slot. > >> > >> my pacth is attached. > > > > The patch should be to zend_vm_def.h since vm_execute is generated. > > Dmitry, what do you think about this? > > From the first look the patch makes sense. Of course it should be > applied to zend_vm_def.h. > > It's possible to workaround the problem by setting ZEND_ACC_NEVER_CACHE > in extensions, but the patch looks more robust. > > Thanks. Dmitry.