Re: maybe serious error in RC3 memory manager
| From: | Stig Venaas | Date: | Sat, 24 Nov 2001 21:35:53 +0000 |
| Subject: | Re: maybe serious error in RC3 memory manager | ||
| References: | 1 2 3 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-71546@lists.php.net to get a copy of this message | ||
By setting the default time limit to 1, I'm now able to reproduce the
problem with this simple script:
set_time_limit(0);
for($i=0;$i<500000;$i++) {
$d[][][] = 1;
}
echo "done\n";
I changed the time limit by changing 30 to 1 in
PHP_INI_ENTRY("max_execution_time", ....
in main.c
Whether the script works depends on amount of RAM and CPU I guess,
you might need to adjust the upper bound.
It seems that we are interrupted by the timeout during shutdown. When
we then try to shut down again, there might be some inconsistencies I
guess.
There is a timeout in shutdown_memory_manager(), backtrace:
#0 zend_timeout (dummy=27) at zend_execute_API.c:666
#1 <signal handler called>
#2 0x4012ba16 in chunk_free (ar_ptr=0x401dd4a0, p=0x969a1a0) at malloc.c:3231
#3 0x4012b980 in __libc_free (mem=0x969a210) at malloc.c:3154
#4 0x080bd370 in _efree (ptr=0x969a21c) at zend_alloc.c:246
#5 0x080bd703 in shutdown_memory_manager (silent=0, clean_cache=0)
at zend_alloc.c:469
#6 0x0805bf53 in php_request_shutdown (dummy=0x0) at main.c:742
#7 0x0805afef in main (argc=2, argv=0xbffffa84) at cgi_main.c:776
then shutdown_memory_manager is called again
#0 shutdown_memory_manager (silent=1, clean_cache=1) at zend_alloc.c:465
#1 0x0805c3ba in php_module_shutdown () at main.c:1008
#2 0x0805b05d in main (argc=2, argv=0xbffffa84) at cgi_main.c:788
And inside here it crashes. If I in main.c in php_request_shutdown()
move the zend_unset_timeout() call before the
shutdown_memory_manager(CG(unclean_shutdown), 0);
call, it works, since I then don't get any timeout while doing shutdown.
In that case shutdown_memory_manager() is also called twice, but then
the parameters are 0, 1 the second time.
Well, that's what I have so far.
Stig