Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102959 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19624 invoked from network); 23 Jul 2018 09:44:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2018 09:44:19 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Received: from [82.113.146.227] ([82.113.146.227:60638] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9A/D2-12660-F63A55B5 for ; Mon, 23 Jul 2018 05:44:16 -0400 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 4820910C010; Mon, 23 Jul 2018 10:44:11 +0100 (BST) Date: Mon, 23 Jul 2018 10:44:11 +0100 (BST) X-X-Sender: derick@singlemalt.home.derickrethans.nl To: "Christoph M. Becker" cc: Nikita Popov , Jan Ehrhardt , PHP internals In-Reply-To: <1da47ccf-15a6-7691-1120-6293995431b7@gmx.de> Message-ID: References: <15n3jdpoiprladjh50u6r2nn1hlmmvea3p@4ax.com> <87863116-5de1-c44d-d751-51e9327807f2@gmx.de> <66c6jdhurlnsaqlegs0epd56b7skj0n20v@4ax.com> <6fa23528-ddcd-d998-50cd-ddabcb038b45@gmx.de> <9274549c-4d08-7a68-77c3-aedfe6dc0962@gmx.de> <95d3db78-235e-ae54-4d24-8088914afad0@gmx.de> <1da47ccf-15a6-7691-1120-6293995431b7@gmx.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [PHP-DEV] Re: PHP 7.3 zif_handler changes From: derick@php.net (Derick Rethans) On Tue, 10 Jul 2018, Christoph M. Becker wrote: > On 09.07.2018 at 11:41, Derick Rethans wrote: > > > On Wed, 4 Jul 2018, Christoph M. Becker wrote: > > > >> On 04.07.2018 at 12:24, Nikita Popov wrote: > >> > >>> On Wed, Jul 4, 2018 at 11:32 AM, Christoph M. Becker > >>> wrote: > >>> > >>>> On 04.07.2018 at 01:16, Jan Ehrhardt wrote: > >>>> > >>>>> Another one: some extensioms suffer from the fact that the macro GC_G > >>>>> was removed from > >>>>> https://github.com/php/php-src/blob/master/Zend/zend_gc.h > >>>>> Some of the removed functionality has been reintroduced in gc_status > >>>>> https://github.com/php/php-src/commits/master/Zend/zend_gc.h > >>>>> > >>>>> Examples using GC_G: v8js, xdebug, tideways. > >>>>> v8js was using gc_active to check if garbage collection was running. > >>>>> I did a wild guess to fix it: > >>>>> https://github.com/Jan-E/v8js/commit/997df065d3cd06a9b11e399458c391 > >>>> eb797a850e#diff-dc446a69201ccda44a33d111152f6c8c > >>>> > >>>> This looks wrong, since zend_gc_collect_cycles() actually triggers the > >>>> GC, if I'm not mistaken. > >>>> > >>>> It seems to me that should be something like: > >>>> > >>>> zend_gc_status status; > >>>> zend_gc_get_status(&status); > >>>> if (status.runs) { > >>>> > >>> > >>> The correct way to handle this is to implement a proper get_gc() handler, > >>> which will be called in favor of get_properties() during GC. > >> > >> Ah, thanks! In some other cases, for instance, in Xdebug[1], using > >> zend_gc_get_status() would be correct, wouldn't it? > >> > >> [1] > >> > > > > It should be - care to make a patch? :-) Xdebug also doesn't do the hash > > protections correctly yet. I've not had the time to make a fix for that > > yet either (hint!) ;-) > > I'm already working on that. I'll submit a (partial?) PR ASAP. I've see that patch, but it needs a fair bit more work that I've started on. Once it all compiles, and works, I'll merge it including your commit. cheers, Derick -- 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