Date: 10/19/98
- Next message: Uwe Steinmann: "[PHP-DEV] access to variables from other modules"
- Previous message: Danny Heijl: "[PHP-DEV] 3.0 CVS tree no longer compiles "functions/mysql.c""
- In reply to: matt <email protected>: "[PHP-DEV] Bug #854: include() problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
matt <email protected> wrote:
> From: matt <email protected>
> 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 <email protected>
> For help: php-dev-help <email protected>
Hi, this is Marc from Barcelona:
I've thought about your problem and I'll explain what I do:
includedfile.h
<?
$text = "***************************************************************";
$text .= "***************************************************************\n";
$text .= "***************************************************************\n";
$text .= "***************************************************************\n";
?>
and the script:
<? include ("includedfile.h");
for ($i = 0; $i < 1550; $i++) {
echo $text;
}
?>
I don't know if it helps you, but, with this you don't use the include inside
the loop.
Regards,
Marc Muņoz
-- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe <email protected> For help: php-dev-help <email protected>
- Next message: Uwe Steinmann: "[PHP-DEV] access to variables from other modules"
- Previous message: Danny Heijl: "[PHP-DEV] 3.0 CVS tree no longer compiles "functions/mysql.c""
- In reply to: matt <email protected>: "[PHP-DEV] Bug #854: include() problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

