|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-04-11 02:49 UTC] ehassler at synapsestudios dot com
Description: ------------ In Vista with PHP 5.2.6 and 5.2.9 and in CentOS with PHP 5.2.6 we encountered an error where, a call_user_func_array without class_exists called before it causes the following error message: Fatal error: Possible integer overflow in memory allocation (4 * 3080682076 + 0) In the windows environment, it just crashes our local instances of Apache, but in Linux we get this error message. Prefacing the call_user_func_array with a class_exists causes the crash/error to not occur. If we do not preface it, or if we add the extra argument to not autoload, then the crash/error occurs again. We tried to reproduce the error by having two files, one with the class, the other with an autoload function and the call to call_user_func_array, and this did NOT cause a crash. In our environment where the error actually occurred, the autoloaded file would have causes several other classes to autoload, so perhaps this is more relevant to the bug than simple autoloading. Actual result: -------------- Fatal error: Possible integer overflow in memory allocation (4 * 3080682076 + 0) in /var/www/phxphp.com/svn/trunk/application/models/upload_type.php on line 49 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 05:00:01 2025 UTC |
When editing you have to use the "Edit Submission" tab to re-open it. Are you sure the script you provided is correct - it works for me, as far as I can tell, on 5.2 and 5.3 while there is a warning for a missing parameter: $ php -n index.php <pre>array(7) { [0]=> array(7) { ["file"]=> string(47) "/tmp/test47948/muqker/index.php" ["line"]=> int(41) ["function"]=> string(1) "f" ["class"]=> string(1) "A" ["object"]=> object(A)#2 (0) { } ["type"]=> string(2) "->" ["args"]=> array(0) { } } [1]=> array(7) { ["file"]=> string(47) "/tmp/test47948/muqker/index.php" ["line"]=> int(45) ["function"]=> string(1) "g" ["class"]=> string(1) "A" ["object"]=> object(A)#2 (0) { } ["type"]=> string(2) "->" ["args"]=> array(0) { } } [2]=> array(7) { ["file"]=> string(47) "/tmp/test47948/muqker/index.php" ["line"]=> int(15) ["function"]=> string(1) "h" ["class"]=> string(1) "A" ["object"]=> object(A)#2 (0) { } ["type"]=> string(2) "->" ["args"]=> array(0) { } } [3]=> array(7) { ["file"]=> string(47) "/tmp/test47948/muqker/index.php" ["line"]=> int(19) ["function"]=> string(2) "zz" ["class"]=> string(10) "Controller" ["object"]=> object(Controller)#1 (0) { } ["type"]=> string(2) "->" ["args"]=> array(0) { } } [4]=> array(7) { ["file"]=> string(47) "/tmp/test47948/muqker/index.php" ["line"]=> int(23) ["function"]=> string(10) "executeNew" ["class"]=> string(10) "Controller" ["object"]=> object(Controller)#1 (0) { } ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> &NULL } } [5]=> array(7) { ["file"]=> string(47) "/tmp/test47948/muqker/index.php" ["line"]=> int(59) ["function"]=> string(13) "executeClient" ["class"]=> string(10) "Controller" ["object"]=> object(Controller)#1 (0) { } ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> &NULL } } [6]=> array(4) { ["file"]=> string(47) "/tmp/test47948/muqker/index.php" ["line"]=> int(62) ["function"]=> string(4) "main" ["args"]=> array(0) { } } } Warning: Missing argument 2 for CheckedFacilityPeer::getCheckedFacilities() in /tmp/test47948/muqker/CheckedFacilityPeer.php on line 42 ffSame problem on Debian 5 32bit + php 5.2.6 when using recursive call_user_func_array function. The workaround is to use eval statement: $object = 'foo'; $method = 'bar'; $args = array();//some arguments $i=0; $strArg=''; foreach ($args as $arg){ $varname = 'arg'.$i; $$varname = $arg; $strArg .= '$'.$varname.','; $i++; } $strArg = substr($strArg,0,-1); $cmd = '$_return = '.$object.'::'.$method.'('.$strArg.');'; eval($cmd); //Enjoy :-) return $_return; Regards, Cyril