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

From: Date: Wed, 02 Jan 2019 08:47:09 +0000
Subject: Bug #77387 [Ver->Csd]: Recursion detection broken when printing GLOBALS
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-218726@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: laruence@php.net Reported by: sjon at hortensius dot net Summary: Recursion detection broken when printing GLOBALS -Status: Verified +Status: Closed Type: Bug Package: Scripting Engine problem Operating System: archlinux PHP Version: 7.3.0 Block user comment: N Private report: N New Comment: Automatic comment on behalf of laruence@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=54a58a73805991d3cec927a112965368211b03a5 Log: Fixed bug #77387 (Recursion detection broken when printing GLOBALS) Previous Comments: ------------------------------------------------------------------------ [2019-01-01 14:14:36] sjon at hortensius dot net Thanks! I've found another problem - very likely related: https://3v4l.org/LUq3k this segfaults, while previously recursion was properly detected ------------------------------------------------------------------------ [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

« previous php.bugs (#218726) next »