Bug #39132 [Com]: integer overflow in memory_limit with memory >= 2GB.
Edit report at https://bugs.php.net/bug.php?id=39132&edit=1
ID: 39132
Comment by: mg at artigo dot pl
Reported by: php at vicaya dot com
Summary: integer overflow in memory_limit with memory >= 2GB.
Status: No Feedback
Type: Bug
Package: Unknown/Other Function
Operating System: Linux 64-bit
PHP Version: 5.1.6
Block user comment: N
Private report: N
New Comment:
Same issue on 5.6.14 64 bit + Apache 64 bit + Windows 64 bit.
Can't set "4096M", getting:
PHP Fatal error: Allowed memory size of 262144 bytes exhausted
Previous Comments:
------------------------------------------------------------------------
[2008-01-27 13:55:01] vadim at vadiaz dot com
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
------------------------------------------------------------------------
[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 https://bugs.php.net/bug.php?id=39132&edit=1
Thread (5 messages)