Bug #77387 [Com]: Recursion detection broken when printing GLOBALS
| From: | sjon at hortensius dot net | Date: | Tue, 01 Jan 2019 14:14:36 +0000 |
| Subject: | Bug #77387 [Com]: Recursion detection broken when printing GLOBALS | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-218715@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77387&edit=1
ID: 77387
Comment by: sjon at hortensius dot net
Reported by: sjon at hortensius dot net
Summary: Recursion detection broken when printing GLOBALS
Status: Verified
Type: Bug
Package: Scripting Engine problem
Operating System: archlinux
PHP Version: 7.3.0
Block user comment: N
Private report: N
New Comment:
Thanks! I've found another problem - very likely related:
https://3v4l.org/LUq3k
this segfaults, while previously recursion was properly detected
Previous Comments:
------------------------------------------------------------------------
[2018-12-31 14:53:11] cmb@php.net
> I found this while going through
> https://3v4l.org/bughunt/7.3.0/7.2.13+7.2.12.
Highly appreciated â thanks!
This bug is caused by refactoring the recursion protection[1].
The Z_REFCOUNTED_P() check[2] fails for $GLOBALS, so the recursion
protection is not applied.
[1] <http://git.php.net/?p=php-src.git;a=commit;h=cb9d81ef4f07f82835273800b0cb3d6a67816050>
[2] <https://github.com/php/php-src/blob/php-7.3.0/Zend/zend.c#L427>
------------------------------------------------------------------------
[2018-12-31 10:40:24] sjon at hortensius dot net
Description:
------------
I found this while going through https://3v4l.org/bughunt/7.3.0/7.2.13+7.2.12.
Previously when printing _GLOBALS - recursion was detected and prevented. This seems broken
Test script:
---------------
See https://3v4l.org/AdLgJ
print_r($GLOBALS);
Expected result:
----------------
Array ( ... ) [GLOBALS] => Array *RECURSION* )
Actual result:
--------------
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 31461376 bytes) in
/in/AdLgJ on line 3
Process exited with code 255.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77387&edit=1