|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-07-12 19:20 UTC] pollita@php.net
[2010-03-18 08:34 UTC] nasretdinov at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 12:00:01 2025 UTC |
Description: ------------ I am getting a crash from PHP when I mistakenly attempt to read 1,761,607,681 bytes from an incoming socket. Now I would reasonably assume that since this is far above the memory limit set in my PHP.ini file memory_limit = 8M I would expect it to stop before even attempting to allocate such a rediculous ammount of memory for the script. In this case it fails with a FATAL: emalloc() unable to allocate 1761607681 bytes. Should this be what it does? I would expect it to issue an ERROR as opposed to crashing. Reproduce code: --------------- <?php $fp=fsockopen("http://php.net"); $data=fread($fp,1761607681); ?> Expected result: ---------------- It would be expected to receive an error as opposed to PHP trying to allocate this memory Actual result: -------------- Stated above, causes FATAL: emalloc() could not......