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

From: Date: Tue, 10 Jul 2018 08:28:27 +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-216251@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: bugs dot php dot net at oh3mqu dot pp dot hyper dot fi 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: 7.0.30 seems to still be broken. (For me it sounds, that string length is somewhere stored as 64bit and somewhere else as 32bit, causing upper bits to be "random" and string to be LONG) Previous Comments: ------------------------------------------------------------------------ [2018-07-06 00:10:31] federicodib at gmail dot com 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. ------------------------------------------------------------------------ [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/ ------------------------------------------------------------------------ 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 (#216251) next »