Christoph M. Becker
[PHP-DEV] PHP 7.3.0alpha2
June 21, 2018 12:40PM
Hi all!

The PHP team is glad to announce the release of the second PHP 7.3.0
version, PHP 7.3.0 Alpha 2. The rough outline of the PHP 7.3 release
cycle is specified in the PHP Wiki: https://wiki.php.net/todo/php73.

For source downloads of PHP 7.3.0 Alpha 2 please visit
https://downloads.php.net/~cmb/. Windows sources and binaries can be
found on https://windows.php.net/qa/.

Please carefully test this version and report any issues found in the
bug reporting system at http://bugs.php.net/.

THIS IS A DEVELOPMENT PREVIEW - DO NOT USE IT IN PRODUCTION!

For more information on the new features and other changes, you can read
the NEWS file
(https://github.com/php/php-src/blob/php-7.3.0alpha2/NEWS), or the
UPGRADING file
(https://github.com/php/php-src/blob/php-7.3.0alpha2/UPGRADING) for a
complete list of upgrading notes. These files can also be found in the
release archive.

The next release would be Alpha 3, planned for July 5.

The signatures for the release can be found at
https://gist.github.com/cmb69/2c54d0972b296a905062f52c0852e7cb or below:

php-7.3.0alpha2.tar.bz2
SHA256 hash:
92229e690593b537b2d775901a7db17ddfb568e9537e81c72b481d982bc6db26
PGP signature:
-----BEGIN PGP SIGNATURE-----

iQJABAABCAAqFiEEy69p8XOg/qS1N/Rw1myVkxGLzLYFAlsrZ4AMHGNtYkBwaHAu
bmV0AAoJENZslZMRi8y2Ak8QAIshF2NJua/3F9uL9ullf5U9WqqAC6v8MA0C2im+
fgGqAWi1dDfkFwse2GDRmU2HATzGEiB/wCC/4F7gtI37Yz6SEDd3ymVVmuEUCdEI
0cbpdVW/lVted/AFZSBjW4NmauCW9H3BJHseUIE1pmlMUTXc+y4yx107Pg1CB48D
h5oVgY7Jl9O9bJiNeNNKKo84xXNYL0b9sGaNZqEpiU5sOuNVDDo6zperZQyJ6O6g
fTSdvRCuI/rxP49JIQtYMUSyyjdz8KLegXrqol6T8KIJ4hil1mFm03tZTKtZc5MD
ph8PFVQHt5Kwf/ds54TLDVsQBz7QaKmRpjOrf8FDfP7GhwK4dqb0Ynm/Uf/hu+X1
ZgoUWrgqzMSsAfmTIFbVreHX6OmFih7LQDyZPuqgyoXKJgMEm1mNXN/kiLOrcgCX
yWL+vFJHuGz9RUMBmZdVit0/io45PkUYB0DODvLfHlwPTL1+tRHxEYkUL2yE5Xl3
4D7OKsi7SdqYric3bPYv2Hv7MCM42Lr1LI786zx3T4hwcOCpEQNvQn5BBZh2e0UP
MCQguGYG46EcPSLr4Xn2+Ss0z3P2YbYiDJCDwBFdk/pabJgCHpVTHVbl4uq98LAl
5l1uJI0AblaYBRKC41qD4+JaPCgyCQqWz4Q8s2cpWg/IDyPcU8QJja61RdyQqE2Y
9NxM
=Dw81
-----END PGP SIGNATURE-----


php-7.3.0alpha2.tar.gz
SHA256 hash:
eeb9bd49b2250888535aab8385aa908d9704b0caa7adc4ff980b317d6c71d52c
PGP signature:
-----BEGIN PGP SIGNATURE-----

iQJABAABCAAqFiEEy69p8XOg/qS1N/Rw1myVkxGLzLYFAlsrZ4IMHGNtYkBwaHAu
bmV0AAoJENZslZMRi8y23UAP/ings23Z+GOyxxAah8fHIZsgzJVCTmTRJfrwQ061
a0MMstwj2aTFU5eyYW6neY9XfohRTR/uwZaYALmlNCFtpq7ysAmd3y7WnLzO96f0
I4OKiG3mfecWZKkPnE3NxApnu1cTBjrJAMFosdQmtlVreIgBN3NK2W4Tka6tbHq6
hfztKGKgCQT5Vipy34EUBzQMpkhYOzVou0cL89sNzVed9TLLYburusjwyjbO8QpO
NVT83oHd+9l/I4Ds7uzjZWWd6j7FzMXEqmhBNU1j+NoR2QGDCLyDNGM6aTBVaks1
ZwELHCMm5Em/WCUd6kivhR7ur9lWyfI9kzF58ZmbaZOgMuD0Eay2DYlkWio1/aaN
IzyYA/OyroyKmnxvqobA8qaHCCYqyEqEHbO87dAUXKas0rLVKLMHAUXSw5RlfQZw
A9IqNG2kJ5l29ISccY9jeKzJodhjDtgrj89+uTv6RIfl2R0/+5XppjY5D5MUI/61
Q9/GK0OFCSBOS6TgodM2ovQ/HC/rmBKarn4ksss03IusB6rgwqSQ9o8Iapn7M+AW
F3V3dhsDCz35Ic8/mQm9x9p1XwUQvAh1qtaZ+EBIyf9FBT+0S8rAirkTDYwP57Hj
+1lxk2DHd+mxfHPyoL2NUUOZiocvFheHch8uM4dzaBr/AfNWuL4eL2oSqvqVFegR
vxLi
=+2Ka
-----END PGP SIGNATURE-----


php-7.3.0alpha2.tar.xz
SHA256 hash:
63e74a67228ec2239fda57d9c47749e5d917c50d76e4002092b145ee8d40ac39
PGP signature:
-----BEGIN PGP SIGNATURE-----

iQJABAABCAAqFiEEy69p8XOg/qS1N/Rw1myVkxGLzLYFAlsrZ4MMHGNtYkBwaHAu
bmV0AAoJENZslZMRi8y29nUP/10HH9jKuNOdwKbHBj2sFZHOTlaKa6bN12W2lWLG
vsdn1C2AyS4iI4qO8SdhWjm1SkHMOtP78rRp3yu9dZVGn84zB9ftKIQNPmBcy60/
B+OuLW5AQx2dR/ZIyjvTgOStWGa1MjAWBHDm1udxsH8Ay9VCSpOzXGnNEp7TQIgr
RGjCSLOM9DPbod5eG+Rt0GjWBFKlhYAIUNmP4y6nVBc5YvVkxjx8ckoLc3tJPINq
dvFQVluOXelythEuSOJetpezxa5uaDLhdMu2OiPhsB5SWG2zgyA7kKyjutQ/VTGJ
E5LUlF0UZXzHDL9M9r9mD6G9Jvj/otewpdhY04VpTmm57/p59+S0CFh49vZ2N1YD
+KhGqpex/avrNjEOQS16qsVhX4eRqbnT1DCxVyk3QKzxjrGwPHPok2dJBsa+C/Kr
nM0r41HB6M3z5gJpV/Lmy/ofxO2zHLAm1SA5ASoRHE5Qp4ktc7vjFS1pl4I33COB
+ZwViDaPrvnmN6wvOYIAcqqR23Gpod9MAkBEpSh5n07pDlr0fcAobDesNOPXuZmZ
Kw5YIeWzFFe7+t0BXjmEriZRnjuqsmFYUkrKcgPAluaIbTEAbheFxQDDx3nmLJ4n
oOmLX1toHLmNKkndOIYiau6JV+ChdJByD6EiGAfHCuI+NnbWHo1/pKRfhy6ztFBJ
VsMP
=p1f7
-----END PGP SIGNATURE-----

Thanks,
Your friendly neighborhood PHP 7.3 RMs

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Jan Ehrhardt
[PHP-DEV] PHP 7.3 zif_handler changes
June 26, 2018 08:50AM
"Christoph M. Becker" in php.internals (Thu, 21 Jun 2018 12:28:49
+0200):
>For more information on the new features and other changes, you can read
>the NEWS file
>(https://github.com/php/php-src/blob/php-7.3.0alpha2/NEWS), or the
>UPGRADING file
>(https://github.com/php/php-src/blob/php-7.3.0alpha2/UPGRADING) for a
>complete list of upgrading notes. These files can also be found in the
>release archive.

Apparently, there were changes in the zend internal functions handler
(aka zif_handler), but I cannot find any info on it. Neither in the
linked documents, nor in
https://github.com/php/php-src/blob/php-7.3.0alpha2/UPGRADING.INTERNALS

I ran into this in at least three extensions, while compiling on Windows
(vc15, x64, nts).

pcs:
|PCS_Loader.c(575): error C2440: '=': cannot convert from 'zif_handler' to 'void (__cdecl *)(zend_execute_data *,zval *)'
|PCS_Loader.c(581): error C2440: '=': cannot convert from 'zif_handler' to 'void (__cdecl *)(zend_execute_data *,zval *)'
|PCS_Loader.c(587): error C2440: '=': cannot convert from 'zif_handler' to 'void (__cdecl *)(zend_execute_data *,zval *)'

pecl_http:
|php_http_client_curl_user.c(190): error C2440: '=': cannot convert from 'void (__cdecl *)(zend_execute_data *,zval *)' to 'zif_handler'

taint seems to have comparable errors. See
https://github.com/laruence/taint/commit/9debfe9682d22e172906cd2e7754a8380bf13453#commitcomment-29461798

Can this be fixed and/or added to UPGRADING.INTERNALS?
--
Jan

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Christoph M. Becker
[PHP-DEV] Re: PHP 7.3 zif_handler changes
June 26, 2018 01:20PM
On 26.06.2018 at 08:42, Jan Ehrhardt wrote:

> Apparently, there were changes in the zend internal functions handler
> (aka zif_handler), but I cannot find any info on it. Neither in the
> linked documents, nor in
> https://github.com/php/php-src/blob/php-7.3.0alpha2/UPGRADING.INTERNALS
>
> I ran into this in at least three extensions, while compiling on Windows
> (vc15, x64, nts).
>
> pcs:
> |PCS_Loader.c(575): error C2440: '=': cannot convert from 'zif_handler' to 'void (__cdecl *)(zend_execute_data *,zval *)'
> |PCS_Loader.c(581): error C2440: '=': cannot convert from 'zif_handler' to 'void (__cdecl *)(zend_execute_data *,zval *)'
> |PCS_Loader.c(587): error C2440: '=': cannot convert from 'zif_handler' to 'void (__cdecl *)(zend_execute_data *,zval *)'
>
> pecl_http:
> |php_http_client_curl_user.c(190): error C2440: '=': cannot convert from 'void (__cdecl *)(zend_execute_data *,zval *)' to 'zif_handler'
>
> taint seems to have comparable errors. See
> https://github.com/laruence/taint/commit/9debfe9682d22e172906cd2e7754a8380bf13453#commitcomment-29461798
>
> Can this be fixed and/or added to UPGRADING.INTERNALS?

Apparently, zif_handler() has been changed to use the ZEND_FASTCALL
calling convention[1] which results in this incompatibility. Not sure
if that should be reverted, or just documented in UPGRADING.INTERNALS.

[1]
https://github.com/php/php-src/commit/f3aca3c852df1dc169e73c01ef1d47927a51a57a

https://github.com/php/php-src/commit/0673aa7f6182dae11798c7a9055dbfd672d87c01

--
Christoph M. Becker

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Jan Ehrhardt
[PHP-DEV] Re: PHP 7.3 zif_handler changes
June 27, 2018 08:50AM
"Christoph M. Becker" in php.internals (Tue, 26 Jun 2018 13:15:32
+0200):
>On 26.06.2018 at 08:42, Jan Ehrhardt wrote:
>
>> https://github.com/php/php-src/blob/php-7.3.0alpha2/UPGRADING.INTERNALS
>>
>> pecl_http:
>> |php_http_client_curl_user.c(190): error C2440: '=': cannot convert from 'void (__cdecl *)(zend_execute_data *,zval *)' to 'zif_handler'

Mike fixed pecl_http:
https://github.com/m6w6/ext-http/commit/512f733beac73f37ba4acbcf730ebc6c6de849b6

But we ran into another undocumented change:
https://github.com/m6w6/ext-http/commit/377d576a6e68def5708cf1ffcd3c233c4dddf356
`zval_ptr_dtor` had to be replaced by `zval_internal_dtor`.

>> taint seems to have comparable errors. See
>> https://github.com/laruence/taint/commit/9debfe9682d22e172906cd2e7754a8380bf13453#commitcomment-29461798

I fixed taint:
https://github.com/laruence/taint/commit/9debfe9682d22e172906cd2e7754a8380bf13453#commitcomment-29510740

>> Can this be fixed and/or added to UPGRADING.INTERNALS?
>
>Apparently, zif_handler() has been changed to use the ZEND_FASTCALL
>calling convention[1] which results in this incompatibility. Not sure
>if that should be reverted, or just documented in UPGRADING.INTERNALS.

Any news from the RM's on this?
--
Jan

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Christoph M. Becker
[PHP-DEV] Re: PHP 7.3 zif_handler changes
June 27, 2018 03:50PM
On 27.06.2018 at 08:47, Jan Ehrhardt wrote:

> "Christoph M. Becker" in php.internals (Tue, 26 Jun 2018 13:15:32
> +0200):
>
>> On 26.06.2018 at 08:42, Jan Ehrhardt wrote:
>>
>>> https://github.com/php/php-src/blob/php-7.3.0alpha2/UPGRADING.INTERNALS
>>>
>>> pecl_http:
>>> |php_http_client_curl_user.c(190): error C2440: '=': cannot convert from 'void (__cdecl *)(zend_execute_data *,zval *)' to 'zif_handler'
>
> Mike fixed pecl_http:
> https://github.com/m6w6/ext-http/commit/512f733beac73f37ba4acbcf730ebc6c6de849b6
>
> But we ran into another undocumented change:
> https://github.com/m6w6/ext-http/commit/377d576a6e68def5708cf1ffcd3c233c4dddf356
> `zval_ptr_dtor` had to be replaced by `zval_internal_dtor`.
>
>>> taint seems to have comparable errors. See
>>> https://github.com/laruence/taint/commit/9debfe9682d22e172906cd2e7754a8380bf13453#commitcomment-29461798
>
> I fixed taint:
> https://github.com/laruence/taint/commit/9debfe9682d22e172906cd2e7754a8380bf13453#commitcomment-29510740
>
>>> Can this be fixed and/or added to UPGRADING.INTERNALS?
>>
>> Apparently, zif_handler() has been changed to use the ZEND_FASTCALL
>> calling convention[1] which results in this incompatibility. Not sure
>> if that should be reverted, or just documented in UPGRADING.INTERNALS.
>
> Any news from the RM's on this?

Well, I'm looking forward to hear from the engine guys. :)

--
Christoph M. Becker

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Xinchen Hui
Re: [PHP-DEV] Re: PHP 7.3 zif_handler changes
June 28, 2018 06:30AM
Hey:
On Wed, Jun 27, 2018 at 9:44 PM Christoph M. Becker <[email protected]>
wrote:

> On 27.06.2018 at 08:47, Jan Ehrhardt wrote:
>
> > "Christoph M. Becker" in php.internals (Tue, 26 Jun 2018 13:15:32
> > +0200):
> >
> >> On 26.06.2018 at 08:42, Jan Ehrhardt wrote:
> >>
> >>>
> https://github.com/php/php-src/blob/php-7.3.0alpha2/UPGRADING.INTERNALS
> >>>
> >>> pecl_http:
> >>> |php_http_client_curl_user.c(190): error C2440: '=': cannot convert
> from 'void (__cdecl *)(zend_execute_data *,zval *)' to 'zif_handler'
> >
> > Mike fixed pecl_http:
> >
> https://github.com/m6w6/ext-http/commit/512f733beac73f37ba4acbcf730ebc6c6de849b6
> >
> > But we ran into another undocumented change:
> >
> https://github.com/m6w6/ext-http/commit/377d576a6e68def5708cf1ffcd3c233c4dddf356
> > `zval_ptr_dtor` had to be replaced by `zval_internal_dtor`.
> >
> >>> taint seems to have comparable errors. See
> >>>
> https://github.com/laruence/taint/commit/9debfe9682d22e172906cd2e7754a8380bf13453#commitcomment-29461798
> >
> > I fixed taint:
> >
> https://github.com/laruence/taint/commit/9debfe9682d22e172906cd2e7754a8380bf13453#commitcomment-29510740
> >
> >>> Can this be fixed and/or added to UPGRADING.INTERNALS?
> >>
> >> Apparently, zif_handler() has been changed to use the ZEND_FASTCALL
> >> calling convention[1] which results in this incompatibility. Not sure
> >> if that should be reverted, or just documented in UPGRADING.INTERNALS.
> >
> > Any news from the RM's on this?
>
> Well, I'm looking forward to hear from the engine guys. :)
>
FAST_CALL should only affects win32. and it can bring some improvement in
win32..

People should use zif_handler instead of define there own from now on, I
think documented it in UPGRADING is enough....

thanks

>
> --
> Christoph M. Becker
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--
Xinchen Hui
@Laruence
http://www.laruence.com/
Christoph M. Becker
Re: [PHP-DEV] Re: PHP 7.3 zif_handler changes
June 28, 2018 01:00PM
On 28.06.2018 at 06:22, Xinchen Hui wrote:

> FAST_CALL should only affects win32. and it can bring some improvement in
> win32..
>
> People should use zif_handler instead of define there own from now on, I
> think documented it in UPGRADING is enough....

Thanks! I've pushed
http://git.php.net/?p=php-src.git;a=commit;h=2ff26bdf7370fff79d743c390e23cd9f477c855d.

Please have a look at
https://github.com/m6w6/ext-http/commit/377d576a6e68def5708cf1ffcd3c233c4dddf356.
Apparently, zval_ptr_dtor() had to be replaced with
zval_internal_dtor() to avoid a segfault with PHP 7.3. Is this caused
by a change in the engine? If so, is this change documented?

--
Christoph M. Becker

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Jan Ehrhardt
Re: [PHP-DEV] Re: PHP 7.3 zif_handler changes
July 04, 2018 01:20AM
"Christoph M. Becker" in php.internals (Thu, 28 Jun 2018 12:56:43
+0200):
>Apparently, zval_ptr_dtor() had to be replaced with
>zval_internal_dtor() to avoid a segfault with PHP 7.3. Is this caused
>by a change in the engine? If so, is this change documented?

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/997df065d3cd06a9b11e399458c391eb797a850e#diff-dc446a69201ccda44a33d111152f6c8c

Are the changes to zend_gc.h documneted?
--
Jan

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Christoph M. Becker
Re: [PHP-DEV] Re: PHP 7.3 zif_handler changes
July 04, 2018 11:40AM
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/997df065d3cd06a9b11e399458c391eb797a850e#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) {

> Are the changes to zend_gc.h documneted?

Apparently not. The relevant commit is baa9890[1].

[1]
http://git.php.net/?p=php-src.git;a=commit;h=baa9890112a863f10e62bbb4c5a1623642a5db3c

--
Christoph M. Becker


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Christoph M. Becker
Re: [PHP-DEV] Re: PHP 7.3 zif_handler changes
July 04, 2018 12:30PM
On 04.07.2018 at 11:32, Christoph M. Becker wrote:

>> Are the changes to zend_gc.h documneted?
>
> Apparently not. […]

Fixed with
http://git.php.net/?p=php-src.git;a=commit;h=d798fd491be77943fb751ad97d85475bf324192c.

--
Christoph M. Becker

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Nikita Popov
Re: [PHP-DEV] Re: PHP 7.3 zif_handler changes
July 04, 2018 12:30PM
On Wed, Jul 4, 2018 at 11:32 AM, Christoph M. Becker <[email protected]>
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.

Nikita
Christoph M. Becker
Re: [PHP-DEV] Re: PHP 7.3 zif_handler changes
July 04, 2018 12:40PM
On 04.07.2018 at 12:24, Nikita Popov wrote:

> On Wed, Jul 4, 2018 at 11:32 AM, Christoph M. Becker <[email protected]>
> 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]
<https://github.com/xdebug/xdebug/blob/27e20b16d23ab611d2a8e74d2e3c061710e18d8f/xdebug_gc_stats.c#L47-L57>;

--
Christoph M. Becker

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Jan Ehrhardt
Re: [PHP-DEV] Re: PHP 7.3 zif_handler changes
July 04, 2018 07:00PM
Nikita Popov in php.internals (Wed, 4 Jul 2018 12:24:10 +0200):
>On Wed, Jul 4, 2018 at 11:32 AM, Christoph M. Becker <[email protected]>
>wrote:
>
>> 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.

Could you put an example snippet in the comments of this PR for the v8js
extension: https://github.com/phpv8/v8js/pull/363
--
Jan

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Derick Rethans
Re: [PHP-DEV] Re: PHP 7.3 zif_handler changes
July 09, 2018 11:50AM
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 <[email protected]>
> > 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]
> <https://github.com/xdebug/xdebug/blob/27e20b16d23ab611d2a8e74d2e3c061710e18d8f/xdebug_gc_stats.c#L47-L57>;

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!) ;-)

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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Christoph M. Becker
Re: [PHP-DEV] Re: PHP 7.3 zif_handler changes
July 10, 2018 03:50PM
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 <[email protected]>
>>> 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]
>> <https://github.com/xdebug/xdebug/blob/27e20b16d23ab611d2a8e74d2e3c061710e18d8f/xdebug_gc_stats.c#L47-L57>;
>
> 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.

--
Christoph M. Becker

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Derick Rethans
Re: [PHP-DEV] Re: PHP 7.3 zif_handler changes
July 23, 2018 11:50AM
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 <[email protected]>
> >>> 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]
> >> <https://github.com/xdebug/xdebug/blob/27e20b16d23ab611d2a8e74d2e3c061710e18d8f/xdebug_gc_stats.c#L47-L57>;
> >
> > 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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Sorry, only registered users may post in this forum.

Click here to login