Bug #77387 [Opn->Ver]: Recursion detection broken when printing GLOBALS

From: Date: Mon, 31 Dec 2018 14:53:11 +0000
Subject: Bug #77387 [Opn->Ver]: Recursion detection broken when printing GLOBALS
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-218708@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 Updated by: cmb@php.net Reported by: sjon at hortensius dot net Summary: Recursion detection broken when printing GLOBALS -Status: Open +Status: Verified Type: Bug -Package: *General Issues +Package: Scripting Engine problem Operating System: archlinux PHP Version: 7.3.0 Block user comment: N Private report: N New Comment: > 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> Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#218708) next »