|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-01-14 19:44 UTC] jdw at nearlyfreespeech dot net
Description: ------------ We have seen this error under the following conditions - FreeBSD 4-STABLE - Using Apache 1.3.33 - PHP 4.3.10 - multiple servers - servers have hundreds of megs of available RAM and gigs of free swap - httpd processes are well within resource limits - happens with random PHP scripts, even simple pages that don't use much memory - pages that generate the error may work if immediately reloaded (unchanged with respect to code and data), suggesting that this is not a per-request memory limit being exceeded - almost always happens *before* headers are sent - occurs on pages not using gzip or zlib or output compression or anything else that would defer content output - happens with alloc amounts from 7500 bytes to about 1meg, averaging between 100-300k. - happens in repetitive "clusters" Problem persists across "apachectl graceful" but "goes away" (for awhile at least) after "apachectl restart" so the Apache parent process may tie in somehow. Is there a way I can obtain more helpful debug information about this in a production environment? Thanks for any help with this! Reproduce code: --------------- n/a... virtually any PHP page appears susceptible, which is consistent with the observation that it occurs before headers are sent. Expected result: ---------------- PHP script should run. Actual result: -------------- Example from Apache error log: (all messages appear in immediate succession) FATAL: erealloc(): Unable to allocate 7500 bytes FATAL: erealloc(): Unable to allocate 7500 bytes FATAL: erealloc(): Unable to allocate 7500 bytes FATAL: erealloc(): Unable to allocate 7500 bytes FATAL: erealloc(): Unable to allocate 7500 bytes FATAL: erealloc(): Unable to allocate 7500 bytes PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 06:00:01 2025 UTC |
A very large number of them this morning: FATAL: erealloc(): Unable to allocate 61440 bytes 2 FATAL: erealloc(): Unable to allocate 983040 bytes FATAL: erealloc(): Unable to allocate 61440 bytes 4 FATAL: erealloc(): Unable to allocate 983040 bytes FATAL: erealloc(): Unable to allocate 61440 bytes 9 FATAL: erealloc(): Unable to allocate 983040 bytes FATAL: erealloc(): Unable to allocate 61440 bytes FATAL: erealloc(): Unable to allocate 983040 bytes To reproduce this, I believe it is important to have apache do a graceful restart a few hundred times. Could the leak be in parsing PHP config variables out of httpd.conf? Here's a stack trace: #0 0x28178a62 in memcpy () from /usr/lib/libc.so.4 #1 0xbfbf948c in ?? () #2 0x283702b1 in php_apache_admin_value_handler (cmd=0xbfbf9460, conf=0x280c7d80, arg1=0x8b1e3cc "max_execution_time", arg2=0x8b1e3e4 "180") at /tmp/source/php_apache_debug/php4-STABLE-200501171730/sapi/apache/mod_php4.c:780 #3 0x08074f58 in invoke_cmd (cmd=0x285406b0, parms=0xbfbf9460, mconfig=0x280c7d80, args=0xbfbf52c6 "") at http_config.c:826 #4 0x08075872 in ap_handle_command (parms=0xbfbf9460, config=0x85885c4, l=0xbfbf52a0 "php_admin_value max_execution_time 180") at http_config.c:1037 #5 0x080758f9 in ap_srm_command_loop (parms=0xbfbf9460, config=0x85885c4) at http_config.c:1051 #6 0x08079c86 in virtualhost_section (cmd=0xbfbf9460, dummy=0x80d79cc, arg=0xbfbf73cd "*") at http_core.c:1972 #7 0x08074dd2 in invoke_cmd (cmd=0x80bc700, parms=0xbfbf9460, mconfig=0x80d79cc, args=0xbfbf73cd "*") at http_config.c:796 #8 0x08075872 in ap_handle_command (parms=0xbfbf9460, config=0x80d6d84, l=0xbfbf73c0 "<VirtualHost *") at http_config.c:1037 #9 0x080758f9 in ap_srm_command_loop (parms=0xbfbf9460, config=0x80d6d84) at http_config.c:1051 #10 0x0807607c in ap_process_resource_config (s=0x80d6034, fname=0x8588314 "/nfsn/apps/apache/vhosts/ninjaman.conf", p=0x80d600c, ---Type <return> to continue, or q <return> to quit--- ptemp=0xca8b00c) at http_config.c:1343 #11 0x0807b0b8 in include_config (cmd=0xbfbfb650, dummy=0x80d79cc, name=0x8588314 "/nfsn/apps/apache/vhosts/ninjaman.conf") at http_core.c:2769 #12 0x08074ea8 in invoke_cmd (cmd=0x80bcdf0, parms=0xbfbfb650, mconfig=0x80d79cc, args=0xbfbf95de "") at http_config.c:814 #13 0x08075872 in ap_handle_command (parms=0xbfbfb650, config=0x80d6d84, l=0xbfbf95b0 "Include /nfsn/apps/apache/vhosts/ninjaman.conf") at http_config.c:1037 #14 0x080758f9 in ap_srm_command_loop (parms=0xbfbfb650, config=0x80d6d84) at http_config.c:1051 #15 0x0807607c in ap_process_resource_config (s=0x80d6034, fname=0x19d831e4 "/nfsn/apps/apache/conf/vhosts.conf", p=0x80d600c, ptemp=0xca8b00c) at http_config.c:1343 #16 0x0807b0b8 in include_config (cmd=0xbfbfd840, dummy=0x80d79cc, name=0x19d831e4 "/nfsn/apps/apache/conf/vhosts.conf") at http_core.c:2769 #17 0x08074ea8 in invoke_cmd (cmd=0x80bcdf0, parms=0xbfbfd840, mconfig=0x80d79cc, args=0xbfbfb7b8 "") at http_config.c:814 #18 0x08075872 in ap_handle_command (parms=0xbfbfd840, config=0x80d6d84, l=0xbfbfb7a0 "include conf/vhosts.conf") at http_config.c:1037 #19 0x080758f9 in ap_srm_command_loop (parms=0xbfbfd840, config=0x80d6d84) at http_config.c:1051 #20 0x0807607c in ap_process_resource_config (s=0x80d6034, ---Type <return> to continue, or q <return> to quit--- fname=0xb5bb28c "/nfsn/apps/apache/conf/cluster.conf", p=0x80d600c, ptemp=0xca8b00c) at http_config.c:1343 #21 0x0807b0b8 in include_config (cmd=0xbfbffa30, dummy=0x80d79cc, name=0xb5bb28c "/nfsn/apps/apache/conf/cluster.conf") at http_core.c:2769 #22 0x08074ea8 in invoke_cmd (cmd=0x80bcdf0, parms=0xbfbffa30, mconfig=0x80d79cc, args=0xbfbfd9a9 "") at http_config.c:814 #23 0x08075872 in ap_handle_command (parms=0xbfbffa30, config=0x80d6d84, l=0xbfbfd990 "Include conf/cluster.conf") at http_config.c:1037 #24 0x080758f9 in ap_srm_command_loop (parms=0xbfbffa30, config=0x80d6d84) at http_config.c:1051 #25 0x0807607c in ap_process_resource_config (s=0x80d6034, fname=0x80cbaa0 "/nfsn/conf/httpd.conf", p=0x80d600c, ptemp=0xca8b00c) at http_config.c:1343 #26 0x0807697c in ap_read_config (p=0x80d600c, ptemp=0xca8b00c, confname=0x80cbaa0 "/nfsn/conf/httpd.conf") at http_config.c:1635 #27 0x08080fb5 in standalone_main (argc=1, argv=0xbfbffbb4) at http_main.c:5373 #28 0x080818fe in main (argc=1, argv=0xbfbffbb4) at http_main.c:5767 #29 0x0804fc26 in _start () (gdb)