stack overflow in long running script.

From: Date: Mon, 05 Jul 1999 10:14:58 +0000
Subject: stack overflow in long running script.
Groups: php.version4 
Request: Send a blank email to php-version4+get-1893@lists.php.net to get a copy of this message
hi, this could be a tough one: a script that runs thru thousands of records (using classses etc) crashes after some time saying: FATAL: erealloc(): Unable to allocate -131072 bytes FATAL: erealloc(): Unable to allocate 0 bytes i traced it down to zend_ptr_stack_push and added a debug line like this: if (stack->top > 1000) fprintf(stderr, "> 0x%08x %d opcode %d on opline %d of %s() at %s:%d\n", stack, stack->top - 1, active_opline->opcode, active_opline-EG(active_op_array)->opcodes, get_active_function_name(), zend_get_executed_filename(ELS_C), zend_get_executed_lineno(ELS_C)); (dunno if the debug-output shows the correct script-line, but...) what i get is: ..... > 0x000e010c 8219 opcode 57 on opline 6 of _gettabletype() at > ../../php/package/phpbasic/phpsite/functions/dossier.fnc:2368 > 0x000e010c 8220 opcode 57 on opline 6 of _gettabletype() at > ../../php/package/phpbasic/phpsite/functions/dossier.fnc:2368 > 0x000e010c 8221 opcode 57 on opline 2078 of filtabexists() at > ../../php/package/phpbasic/phpsite/functions/dossier.fnc:1220 > 0x000e010c 8222 opcode 58 on opline 12 of modify() at > ../../php/package/phpbasic/phpsite/functions/dossier.fnc:556 > 0x000e010c 8223 opcode 58 on opline 12 of modify() at > ../../php/package/phpbasic/phpsite/functions/dossier.fnc:556 > 0x000e010c 8224 opcode 58 on opline 12 of modify() at > ../../php/package/phpbasic/phpsite/functions/dossier.fnc:556 > 0x000e010c 8225 opcode 58 on opline 12 of modify() at > ../../php/package/phpbasic/phpsite/functions/dossier.fnc:556 ..... > 0x000e010c 16399 opcode 57 on opline 48 of _parse() at > ../../php/package/phpbasic/phpsite/functions/dossier.fnc:1982 > 0x000e010c 16400 opcode 57 on opline 48 of _parse() at > ../../php/package/phpbasic/phpsite/functions/dossier.fnc:1982 > 0x000e010c 16401 opcode 1515870810 on opline -60479576Segmentation fault (core dumped) and so on - this stack is never ever popped, which causes the overflow & the crash. there's a lot of php code running - if you want i can get you access to one of my boxes! regards, tc Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!" Digital Collections Phone +49 40 235350 Fax +49 40 23535180 Hammerbrookstr. 93 20097 Hamburg / Germany

« previous php.version4 (#1893) next »