Bug #854: include() problem
| From: | matt at debris dot com | Date: | Fri, 16 Oct 1998 19:08:27 +0000 |
| Subject: | Bug #854: include() problem | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-1858@lists.php.net to get a copy of this message | ||
From: matt@debris.com
Operating system: BSDI 3.0
PHP version: 3.0.5
PHP Bug Type: Reproduceable crash
Bug description: include() problem
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.
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net