Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88891 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40500 invoked from network); 20 Oct 2015 15:53:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Oct 2015 15:53:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=bobwei9@hotmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=bobwei9@hotmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hotmail.com designates 65.55.111.102 as permitted sender) X-PHP-List-Original-Sender: bobwei9@hotmail.com X-Host-Fingerprint: 65.55.111.102 blu004-omc2s27.hotmail.com Received: from [65.55.111.102] ([65.55.111.102:54472] helo=BLU004-OMC2S27.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7A/29-54881-F7366265 for ; Tue, 20 Oct 2015 11:53:37 -0400 Received: from BLU436-SMTP68 ([65.55.111.73]) by BLU004-OMC2S27.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Tue, 20 Oct 2015 08:53:33 -0700 X-TMN: [AbvtuAOrxzcOsC5V+kWt0b2L0cZtpsse] X-Originating-Email: [bobwei9@hotmail.com] Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_DCAD4E1C-4C55-462E-B1F6-D2ABB588768A" MIME-Version: 1.0 (Mac OS X Mail 9.0 \(3094\)) In-Reply-To: Date: Tue, 20 Oct 2015 17:53:37 +0200 CC: Dmitry Stogov , PHP Developers Mailing List References: To: Xinchen Hui , Derick Rethans X-Mailer: Apple Mail (2.3094) X-OriginalArrivalTime: 20 Oct 2015 15:53:30.0487 (UTC) FILETIME=[77740870:01D10B4F] Subject: Re: [PHP-DEV] Issues with exceptions and overloading opcodes From: bobwei9@hotmail.com (Bob Weinand) --Apple-Mail=_DCAD4E1C-4C55-462E-B1F6-D2ABB588768A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" > Am 20.10.2015 um 17:11 schrieb Xinchen Hui : >=20 > Hey: >=20 >=20 >=20 > On Tue, Oct 20, 2015 at 10:45 PM, Derick Rethans > wrote: >=20 >> Hi! >>=20 >> When hacking on Xdebug for PHP 7, I ran into some issues where PHP = would >> just spin around. This happens when there is an exception, and I use >> overloaded opcodes. I wrote a small example extension at >> https://github.com/derickr/php-minimal-opcode-overloading-example = with a >> test case >> ( >> = https://github.com/derickr/php-minimal-opcode-overloading-example/blob/mas= ter/tests/test.php >> ) >> that shows that something is looping in executing opcodes, as the >> HANDLE_EXCEPTION iirc doesn't advance to the next opline. I believe = this >> is a recent enough change, as it only started happening after I = upgraded >> from about RC1 to latest master. >>=20 >> Would you care to have a look? >>=20 > This is introduced by a fix made by Bob, > https://github.com/php/php-src/commit/808f62bb = >=20 > Bob, I am going to revert this for now, since you didn't include a = test > script to show where the problem was, I am not sure why you made = this? >=20 >=20 > thanks >=20 >>=20 >> cheers, >> Derick >>=20 >> -- >> http://derickrethans.nl | = http://xdebug.org >> Like Xdebug? Consider a donation: http://xdebug.org/donate.php = >> twitter: @derickr and @xdebug >> Posted with an email client that doesn't mangle email: alpine >>=20 >=20 >=20 >=20 > --=20 > Xinchen Hui > @Laruence > http://www.laruence.com/ I didn't add any test case as we don't have any APIs in php-src using = that user_opcode handler. I discussed the change back then with Dmitry and committed with his = review. It concretely broke uopz which might throw an exception itself. And in = turn we realized that for integrity we need to ensure that opline =3D=3D = EX(opline) else we'll end up with different behavior in global register = builds and normal builds. In general, you should not overload ZEND_HANDLE_EXCEPTION (if you need = to, have a special handling for it, but never directly dispatch to it). = It is quite special being the only opcode actually allowing = EG(exception) to be non-NULL at the start of it. You are doing an #ifdef ZTS to exempt it=E2=80=A6 why don't you always = exempt it? Bob= --Apple-Mail=_DCAD4E1C-4C55-462E-B1F6-D2ABB588768A--