PHP 4.0 Bug #7355: weird global variable corruption
| From: | dolecek at ibis dot cz | Date: | Thu, 19 Oct 2000 22:27:20 +0000 |
| Subject: | PHP 4.0 Bug #7355: weird global variable corruption | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-35578@lists.php.net to get a copy of this message | ||
From: dolecek@ibis.cz
Operating system: NetBSD 1.5H
PHP version: 4.0.3pl1
PHP Bug Type: Scripting Engine problem
Bug description: weird global variable corruption
I use PHP as DSO module loaded to Apache 1.3.12.
I have a module file, which is brought in via
include_once statement. There are two module-global
variables in the module. One of them is filled in
by data from database when the module is loaded, like
this
while($row = mysql_fetch_object($dbres)) {
$arr[$row->id] = $row;
}
Later on, the contents of the array is
printed via one of module's function. Now, one
of items in the array get's corrupted (third of four
items). It suddenly contains an array which contains
link to itself - print_r() of that item doesn't
end ever (stopped the browser after received
about 15MB of data, where the script generates
like 4KB maximum). After that, the httpd gets
caboom, no PHP script returns any output and
httpd is closing connections immediatelly, before
even reading client headers. If I kill httpd,
it takes excessively long to die off - like
2 minutes where it normally takes like 5s.
After I restart httpd and try the same script,
it fails the same way. Seems like stack corruption or something of that sort. It's repeatable
for me,
though creating simple script which would trigger
the same bug would be probably quite problematic.
Unfortunately, I've not had enough time to track this
thing to the end yet, so I don't know what it is caused
by. All I know is that this problem
doesn't exist on 4.0.1pl2 - the same code works okay
on it. I'd be willing to track this problem down.
Just tell me which info you need and I'd try to provide
it.
--
Edit Bug report at: http://bugs.php.net/?id=7355&edit=1