From: paul at paulscripts dot nl Operating system: Linux PHP version: 5.2.6 PHP Bug Type: Reproducible crash Bug description: php gives negative memory error with memory limit at 2 gig
Description: ------------ php gives the next fatal error: Fatal error: Allowed memory size of -2147483648 bytes exhausted (tried to allocate 2147221481 bytes) in /root/convert.php on line 6 when trying to use a script with a memory limit of 2gig. Reproduce code: --------------- <?php ini_set('memory_limit', '2048M'); $d = ''; while (true) { $d .= 'a'; } Expected result: ---------------- Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 2147221481 bytes) in /root/convert.php on line 6 Actual result: -------------- Fatal error: Allowed memory size of -2147483648 bytes exhausted (tried to allocate 2147221481 bytes) in /root/convert.php on line 6 -- Edit bug report at http://bugs.php.net/?id=45271&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45271&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45271&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45271&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=45271&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=45271&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=45271&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=45271&r=needscript Try newer version: http://bugs.php.net/fix.php?id=45271&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=45271&r=support Expected behavior: http://bugs.php.net/fix.php?id=45271&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=45271&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=45271&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=45271&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45271&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=45271&r=dst IIS Stability: http://bugs.php.net/fix.php?id=45271&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=45271&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=45271&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=45271&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=45271&r=mysqlcfg