Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103135 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 66356 invoked from network); 6 Sep 2018 17:19:15 -0000 Received: from unknown (HELO xdebug.org) (82.113.146.227) by pb1.pair.com with SMTP; 6 Sep 2018 17:19:15 -0000 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 0526710C01D; Thu, 6 Sep 2018 14:22:21 +0100 (BST) Date: Thu, 6 Sep 2018 14:22:21 +0100 (BST) X-X-Sender: derick@singlemalt.home.derickrethans.nl To: Dmitry Stogov cc: PHP Developers Mailing List In-Reply-To: Message-ID: References: ,, User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1696493663-1536240142=:3099" Subject: Re: [PHP-DEV] Re: Mysterious (to me) Xdebug issue with PHP 7.3 From: derick@php.net (Derick Rethans) --8323329-1696493663-1536240142=:3099 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Hi Dmitry, this indeed seems to fix the problem =E2=80=94 thanks! cheers, Derick On Wed, 5 Sep 2018, Dmitry Stogov wrote: > I hope, it's fixed now. >=20 > Please verify. >=20 >=20 > Dmitry. >=20 > ________________________________ > From: Dmitry Stogov > Sent: Wednesday, September 5, 2018 1:36:33 PM > To: Derick Rethans > Cc: PHP Developers Mailing List > Subject: Re: [PHP-DEV] Re: Mysterious (to me) Xdebug issue with PHP 7.3 >=20 > I see the problem, and most probably, it has to be fixed in PHP sources. >=20 > I'll try to take a deeper look today evening. >=20 >=20 > Thanks. Dmitry. >=20 > ________________________________ > From: Derick Rethans > Sent: Wednesday, September 5, 2018 12:27:56 PM > To: Dmitry Stogov > Cc: PHP Developers Mailing List > Subject: [PHP-DEV] Re: Mysterious (to me) Xdebug issue with PHP 7.3 >=20 > Hi, >=20 > in Xdebug, I do supply my own opcode handlers for quite a few opcodes, > including ZEND_IS_EQUAL, and a whole bunch of others. Is it possible > that when you use zend_set_user_opcode_handler[1][2] that this swap > isn't done with zend_swap_operands? My opcode handler basically just > does some code and then uses ZEND_VM_DISPATCH[3]. >=20 > [1] https://github.com/derickr/xdebug/blob/PHP-7.3-support/xdebug_code_co= verage.h#L47-L48 > [2] https://github.com/derickr/xdebug/blob/PHP-7.3-support/xdebug.c#L781 > [3] https://github.com/derickr/xdebug/blob/PHP-7.3-support/xdebug_code_co= verage.c#L125-L142 >=20 > cheers, > Derick >=20 > On Wed, 5 Sep 2018, Dmitry Stogov wrote: >=20 > > Hi Derick, > > > > > > The message "Invalid opcode 17/1/8" means that PHP doesn't have handler= for opcode 17 (ZEND_IS_EQUAL) where first operand IS_CONST and second oper= and IS_CV. > > > > > > ZEND_IS_EQUAL is a commutative operator. zend_vm_gen.php doesn't genera= te code for ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER, but PHP code-generator swa= ps operands, if necessary, to use ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER. > > > > > > ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* op) > > { > > zend_uchar opcode =3D zend_user_opcodes[op->opcode]; > > uint32_t spec =3D zend_spec_handlers[opcode]; > > > > if (spec & SPEC_RULE_COMMUTATIVE) { > > if (op->op1_type < op->op2_type) { > > zend_swap_operands(op); > > } > > } > > op->handler =3D zend_vm_get_opcode_handler_ex(spec, op); > > } > > > > > > I have no idea, why PHP with xdebug doen't swap operands. > > > > > > Thanks. Dmitry. > > > > ________________________________ > > From: Derick Rethans > > Sent: Tuesday, September 4, 2018 7:26:49 PM > > To: Dmitry Stogov > > Cc: PHP Developers Mailing List > > Subject: Mysterious (to me) Xdebug issue with PHP 7.3 > > > > Hi, > > > > I'm finalizing Xdebug support for PHP 7.3, and although I have fixed > > many things, there is one thing that is (currently) eluding me. > > > > The branch I'm working on is > > https://github.com/derickr/xdebug/tree/PHP-7.3-support > > > > With Xdebug (just) loaded, the following script: > > > > $ cat /tmp/bug01471.php > > > $c =3D "aa" =3D=3D $ff ? 1 : 0; > > ?> > > > > Fails to run with: > > > > $ php -n -dzend_extension=3Dxdebug.so /tmp/bug01471.php > > > > Fatal error: Invalid opcode 17/1/8. in /tmp/bug01471.php on lin= e 2 > > > > Call Stack: > > 0.0002 0 1. {main}() /tmp/bug01471.php:0 > > > > I also see others, like when running with a Composer library: > > > > $ vendor/bin/phpunit --debug > > > > Fatal error: Invalid opcode 16/1/2. in /home/derick/dev/php/der= ickr-mongo-php-library/vendor/composer/autoload_real.php on line 18 > > > > Call Stack: > > 0.0003 431424 1. {main}() /home/derick/dev/php/derick= r-mongo-php-library/vendor/phpunit/phpunit/phpunit:0 > > 0.0005 433616 2. require('/home/derick/dev/php/derick= r-mongo-php-library/vendor/autoload.php') /home/derick/dev/php/derickr-mong= o-php-library/vendor/phpunit/phpunit/phpunit:51 > > 0.0008 450432 3. ComposerAutoloaderInit96731179a4aab6= 838b54de3a71995ee1::getLoader() /home/derick/dev/php/derickr-mongo-php-libr= ary/vendor/autoload.php:7 > > > > And I can't figure out why. The backtrace isn't particularly useful > > either. I got similar issues with get_zval_ptr [1], as it changed, but = I > > can't track this specific one down. Would you mind having a look? > > > > cheers, > > Derick > > > > [1] https://github.com/derickr/xdebug/commit/70d9189700d57707d842020493= a3df23e0c76098 > > -- > > > > > > -- > > https://derickrethans.nl | https://xdebug.org | https://dram.io > > Like Xdebug? Consider a donation: https://xdebug.org/donate.php, > > or become my Patron: https://www.patreon.com/derickr > > twitter: @derickr and @xdebug > > >=20 > -- > https://derickrethans.nl | https://xdebug.org | https://dram.io > Like Xdebug? Consider a donation: https://xdebug.org/donate.php, > or become my Patron: https://www.patreon.com/derickr > twitter: @derickr and @xdebug >=20 > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20 >=20 --=20 https://derickrethans.nl | https://xdebug.org | https://dram.io Like Xdebug? Consider a donation: https://xdebug.org/donate.php, or become my Patron: https://www.patreon.com/derickr twitter: @derickr and @xdebug --8323329-1696493663-1536240142=:3099--