|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-10-17 07:09 UTC] zeev
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 08:00:01 2025 UTC |
When an included module is called multiple times, its variable space can become corrupt. Perhaps include() was never intended to be used in this fashion, but it crashes in any case. Here's a fresh backtrace: Program terminated with signal 11, Segmentation fault. #0 pval_destructor (pvalue=0x0) at variables.c:76 76 if (pvalue->type == IS_STRING) { (gdb) bt #0 pval_destructor (pvalue=0x0) at variables.c:76 #1 0x2480e in tc_destroy (tc=0xd2a604) at token_cache.c:314 #2 0x2484e in tcm_destroy (tcm=0xa870c) at token_cache.c:328 #3 0x1dc66 in php3_request_shutdown (dummy=0x0) at main.c:728 #4 0x1fc35 in main (argc=3, argv=0xefbfdac0) at main.c:1790 Here's a script that crashes PHP: #!/usr/local/bin/php3 -q <? for ($i = 0; $i < 1550; $i++) { include ("crasher.html"); } ?> crasher.html: <? $text = "***************************************************************"; $text .= "***************************************************************\n"; $text .= "***************************************************************\n"; $text .= "***************************************************************\n"; ## etc... put in about a dozen or 20 of these lines... ## just build a long string, one way or another. ?> When I move the contents of crasher.html into the loop, replacing the include() call, the script works fine. Something is different about the way PHP treats the variable space of included code. Adding unset($text) to the end of the included module does not help.