Req #66488 [NEW]: 32-bit integers used internally

From: Date: Wed, 15 Jan 2014 15:02:37 +0000
Subject: Req #66488 [NEW]: 32-bit integers used internally
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183811@lists.php.net to get a copy of this message
From: scott at arciszewski dot me Operating system: Linux PHP version: 5.5.8 Package: GD related Bug Type: Feature/Change Request Bug description:32-bit integers used internally Description: ------------ Even when using PHP with GD on a 64-bit machine, the 4 GB memory limit rears its ugly head. Thus, we have problems like this one: https://stackoverflow.com/questions/20614686/gd-warning-product-of-memory-allocation-multiplication-would-exceed-int-max I would propose going in and updating the integer definitions to accommodate 64-bit processors and its larger memory space, but GD isn't my forte so I'm not sure if I would break all of the things if I went in and patched it. Test script: --------------- echo PHP_INT_MAX . '<br/>'; echo 174400 * 249600 . '<br/>'; $img = imagecreatetruecolor(174400, 249600); Expected result: ---------------- 9223372036854775807 43530240000 Warning: imagecreatetruecolor(): gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully in /home/bartek/Documents/WWW/WOF/application/controllers/EditorController.php on line 5 Actual result: -------------- <b>Parse error</b>: imagecreatetruecolor(): product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully -- Edit bug report at https://bugs.php.net/bug.php?id=66488&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66488&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66488&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66488&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=66488&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=66488&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=66488&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=66488&r=needscript Try newer version: https://bugs.php.net/fix.php?id=66488&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=66488&r=support Expected behavior: https://bugs.php.net/fix.php?id=66488&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=66488&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=66488&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=66488&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66488&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=66488&r=dst IIS Stability: https://bugs.php.net/fix.php?id=66488&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=66488&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=66488&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=66488&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=66488&r=mysqlcfg

« previous php.bugs (#183811) next »