From:             php at vicaya dot com
Operating system: Linux 64-bit
PHP version:      5.2.1
PHP Bug Type:     Reproducible crash
Bug description:  cannot disable memory_limit with -1

Description:
------------
According to the documentation: http://us2.php.net/manual/en/ini.core.php

"Note that to have no memory limit, set this directive to -1."

But the code use more than 4GB virtual memory crashes with "Fatal error:
Allowed memory size of -1 bytes exhausted (tried to allocate 605 bytes) in
..." anyway.

Reproduce code:
---------------
<? count(file("a_10GB_file")) ?> // not production code :)
on a machine with enough ram and swap space.


Expected result:
----------------
number of lines in "a_10GB_file".

Actual result:
--------------
"Fatal error: Allowed memory size of -1 bytes exhausted (tried to allocate
605 bytes) in ..."

Suspect that memory limit directive is still a 32bit unsigned integer
(size_t) and -1 is converted to 4G-1.

-- 
Edit bug report at http://bugs.php.net/?id=40800&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40800&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40800&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40800&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40800&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40800&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40800&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40800&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40800&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40800&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40800&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40800&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40800&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40800&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40800&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40800&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40800&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40800&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40800&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40800&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40800&r=mysqlcfg

Reply via email to