Bug #72451 [Com]: Wordpress/ stream_get_wrappers causes crash

From: Date: Fri, 06 Jul 2018 00:10:34 +0000
Subject: Bug #72451 [Com]: Wordpress/ stream_get_wrappers causes crash
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216164@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72451&edit=1 ID: 72451 Comment by: federicodib at gmail dot com Reported by: oldbucsfan at hotmail dot com Summary: Wordpress/ stream_get_wrappers causes crash Status: Closed Type: Bug Package: Apache2 related Operating System: Windows Server 2012 R2 PHP Version: 7.0.7 Assigned To: ab Block user comment: N Private report: N New Comment: PHP 7.2 Fatal error: Allowed memory size of 201326592 bytes exhausted (tried to allocate 6426960508499 bytes) in wp-includes\functions.php on line 5231 Is this still a bug? If not, can anyone help me understand what is this stream_get_wrappers() function used for, and how to debug the cause of this. Previous Comments: ------------------------------------------------------------------------ [2018-01-07 16:46:33] herb at bobbingwide dot com I've had this problem recently with PHP 7.2.0. When the problem occurred the message was like this Fatal error: Allowed memory size of 201326592 bytes exhausted (tried to allocate 2178642796290 bytes) in wp-includes\functions.php on line 5216 I added some debug information into the WordPress function wp_is_stream to discover that $wrappers[5] was corrupted. function wp_is_stream( $path ) { $wrappers = stream_get_wrappers(); echo count( $wrappers ) . PHP_EOL; echo strlen( $wrappers[5] ). PHP_EOL; print_r( $wrappers ); The print_r()failed due to out of memory since $wrappers[5] was a very long string. I experienced the problem more than once, over a couple of days, but cannot reproduce it at will. I had to stop and restart Apache to recover from the error. When it's working the debug output is: 11 3 Array ( [0] => php [1] => file [2] => glob [3] => data [4] => http [5] => ftp [6] => zip [7] => compress.zlib [8] => https [9] => ftps [10] => phar ) ------------------------------------------------------------------------ [2018-01-07 16:46:22] herb at bobbingwide dot com I've had this problem recently with PHP 7.2.0. When the problem occurred the message was like this Fatal error: Allowed memory size of 201326592 bytes exhausted (tried to allocate 2178642796290 bytes) in wp-includes\functions.php on line 5216 I added some debug information into the WordPress function wp_is_stream to discover that $wrappers[5] was corrupted. function wp_is_stream( $path ) { $wrappers = stream_get_wrappers(); echo count( $wrappers ) . PHP_EOL; echo strlen( $wrappers[5] ). PHP_EOL; print_r( $wrappers ); The print_r()failed due to out of memory since $wrappers[5] was a very long string. I experienced the problem more than once, over a couple of days, but cannot reproduce it at will. I had to stop and restart Apache to recover from the error. When it's working the debug output is: 11 3 Array ( [0] => php [1] => file [2] => glob [3] => data [4] => http [5] => ftp [6] => zip [7] => compress.zlib [8] => https [9] => ftps [10] => phar ) ------------------------------------------------------------------------ [2017-03-29 12:23:09] ab@php.net The fix for this bug has been committed. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Actually can be closed. ------------------------------------------------------------------------ [2017-03-29 12:16:12] ab@php.net Please try using this snapshot: http://snaps.php.net/php-trunk-latest.tar.gz For Windows: http://windows.php.net/snapshots/ ------------------------------------------------------------------------ [2017-03-08 17:47:06] ab@php.net Please check the current master snapshots, a comprehensive patch fixing this kind of issues has landed there. thanks. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=72451 -- Edit this bug report at https://bugs.php.net/bug.php?id=72451&edit=1

« previous php.bugs (#216164) next »