Req #31052 [Com]: FATAL: erealloc(): Unable to allocate...
| From: | ajf@php.net | Date: | Thu, 08 Jan 2015 23:18:46 +0000 |
| Subject: | Req #31052 [Com]: FATAL: erealloc(): Unable to allocate... | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-189775@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=31052&edit=1
ID: 31052
Comment by: ajf@php.net
Reported by: dmih at in-solve dot ru
Summary: FATAL: erealloc(): Unable to allocate...
Status: Not a bug
Type: Feature/Change Request
Package: *General Issues
Operating System: Win32/all
PHP Version: 4.3.9
Block user comment: N
Private report: N
New Comment:
Also, in such a situation the engine is unstable so we can't just "not die", sorry.
Previous Comments:
------------------------------------------------------------------------
[2015-01-08 23:17:45] ajf@php.net
That error isn't actually a bug itself, it's usually just a symptom of other bugs.
Probably due to some memory corruption bug somewhere. That or your system ran out of RAM. So
I'm marking this as "Not a bug".
------------------------------------------------------------------------
[2004-12-10 10:42:15] dmih at in-solve dot ru
Description:
------------
We are hosting provider, running PHP for a years.
We are using Apache 1.3.* / PHP, now they are latest versions.
Apache 1.3.33, PHP 4.3.9. That feature is version independent.
Sometimes this code fails (zend_alloc.c):
if (!p) {
if (!allow_failure) {
fprintf(stderr,"FATAL: erealloc(): Unable to allocate %ld bytes\n", (long) size);
#if ZEND_DEBUG && HAVE_KILL && HAVE_GETPID
kill(getpid(), SIGSEGV);
#else
exit(1);
#endif
}
ADD_POINTER_TO_LIST(orig);
HANDLE_UNBLOCK_INTERRUPTIONS();
return (void *)NULL;
}
In Apache log you see "FATAL: erealloc(): Unable to allocate..." and process is killed.
There are different numbers while trying to allocate, all funny (something about 1.5 mb, 300 kb,
even 54 kb, so on).
The problem is that under Win32 the only Apache working process is killed. That does not harm
general operation, process is recreated, but that prevents long file downloads.
I've seen many instances of this bug but they all seems odd. I want to have some definite
solution: let the script that cannot realloc die, but PLEASE do not die the whole working process.
I have absolutely no idea how to prevent apache from restarting child processes with such your
behaviour. It seems that under Win32 it is impossible.
I may add that memory limit for PHP script is 8mb (but it is unrelated, we used to have 256 mb with
same probability of these errors).
Reproduce code:
---------------
There is no code definitely known to reproduce the error; the code is not the point.
Expected result:
----------------
I want some solution to let Apache working process survive this issue regardless of the cause. That
is very important.
I want to control the behaviour of this code point to make it allow to terminate current script, but
not the whole process (it seems unreasonable).
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=31052&edit=1