|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-03-31 10:22 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2021-03-31 10:22 UTC] cmb@php.net
[2021-04-11 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 27 05:00:01 2025 UTC |
Description: ------------ Follwing script outputs """ X Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home/jlopuszanski/test.php on line 8 B Segmentation fault """ on php 5.3.27. The problem is quite difficult to reproduce, as it greately depends on the filename, length of arguments etc. Therefore I run it in a loop with different length of an argument passed to the script. Sometimes uncommenting the line with echo "Y\n"; (even though it is obviously unreachable) helps to cause the error. Sometimes I have to use ~/test.php or ./test.php instead of test.php as a filename to trigger the Segfault. Once I find a good combination of filename and arguments, the problem is persistent and can be reproduced 100% of times for that combination. Test script: --------------- cat test.php <?php class A{ function __construct(){ register_shutdown_function(array(__CLASS__, 'handle_shutdown')); echo "X\n"; while(1){ $t[]=new B(); } // echo "Y\n"; } static public function handle_shutdown(){ echo "B\n"; $b=new B(); $b=null; } } class B{ } $a=new A(); ?> for((n=0;n<100;++n)); do echo $n; php-5.3.27/bin/php ~/test.php `for((i=0;i<n;++i));do echo -n a;done`; done Expected result: ---------------- X Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home/jlopuszanski/test.php on line 8 B Actual result: -------------- X Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home/jlopuszanski/test.php on line 8 B Segmentation fault