#39132 [Com]: integer overflow in memory_limit with memory >= 2GB.
ID: 39132
Comment by: vadim at vadiaz dot com
Reported By: php at vicaya dot com
Status: No Feedback
Bug Type: Unknown/Other Function
Operating System: Linux 64-bit
PHP Version: 5.1.6
New Comment:
same behavior on 5.2.5
setting memory_limit to 4096M result in almost any script produce
following error:
Allowed memory size of
262144 bytes exhausted
262144 == 0x40000
I put 4000000000 in php.ini and it looks like it work now
so parsing '4096M' does produce memory_limit 4Gb
Previous Comments:
------------------------------------------------------------------------
[2006-10-20 01:00:00] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2006-10-12 09:57:01] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
------------------------------------------------------------------------
[2006-10-12 08:05:22] derick@php.net
Yes, it's using a size_t which AFAIK is limited to 32bit on most
systems.
------------------------------------------------------------------------
[2006-10-12 03:17:37] php at vicaya dot com
Description:
------------
Looks like memory_limit is kept using a 32-bit signed integer even with
php compiled on 64-bit Linux.
Reproduce code:
---------------
set memory_limit to -1 or >= 2048M
<?= count(file("a_big_file")) ?>
Expected result:
----------------
number of lines in "a_big_file".
Actual result:
--------------
"Integer overflow in memory_limit check detected"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39132&edit=1
Thread (5 messages)