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

From: Date: Sun, 07 Jan 2018 16:46:33 +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-213407@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: herb at bobbingwide 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: 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 ) Previous Comments: ------------------------------------------------------------------------ [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. ------------------------------------------------------------------------ [2017-02-27 15:19:18] stumpe at gmail dot com Hello, i came across this error and can reproduce it. i compiled apache and php myself (on Linux hostname 3.12.62-60.64.8-default #1 SMP Tue Oct 18 12:21:38 UTC 2016 (42e0a66) x86_64 x86_64 x86_64 GNU/Linux) and saw this error pop up in the wordpress-instance PHP Fatal error: Allowed memory size of 6442450944 bytes exhausted (tried to allocate 15126708878888855354 bytes) in wp-includes/functions.php on line 5161 which is this function: function wp_is_stream( $path ) { $wrappers = stream_get_wrappers(); $wrappers_re = '(' . join('|', $wrappers) . ')'; return preg_match( "!^$wrappers_re://!", $path ) === 1; } so i tried this code - to take a look if this is a wordpress-problem <?php print_r(stream_get_wrappers()); ?> first time i called the URL for this code i got error 500 and another PHP Fatal Error in the log apache let the corrupted child die [Mon Feb 27 15:50:34.341436 2017] [core:notice] [pid 10599:tid 139796708411136] AH00052: child pid 5329 exit signal Segmentation fault (11) second time calling the script i got the output: Array ( [0] => https [1] => ftps [2] => compress.zlib [3] => php [4] => file [5] => glob [6] => data [7] => http [8] => ftp [9] => phar [10] => zip ) something is still weird apache 2.4.25 php 7.1.2 openssl 1.0.2k ------------------------------------------------------------------------ [2017-01-31 15:47:16] boldini at softcodex dot ch hi, I tried to run also ab and abs with -n 1000 -c 10 with the code $wrappers = stream_get_wrappers(); print_r($wrappers); $wrappers_re = '(' . join('|', $wrappers) . ')'; print($wrappers_re); but no crash happens! I can say my cash happen every 2/3 weeks Only have 1 site with phpmyadmin that use https, so few connections per day.. All other are normal http ------------------------------------------------------------------------ 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 (#213407) next »