|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-01-08 23:17 UTC] ajf@php.net
-Status: Open
+Status: Not a bug
-Package: Feature/Change Request
+Package: *General Issues
[2015-01-08 23:17 UTC] ajf@php.net
[2015-01-08 23:18 UTC] ajf@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Jun 13 20:00:01 2026 UTC |
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).