php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7355 weird global variable corruption
Submitted: 2000-10-19 18:27 UTC Modified: 2000-11-29 06:14 UTC
From: dolecek at ibis dot cz Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.3pl1 OS: NetBSD 1.5H
Private report: No CVE-ID: None
 [2000-10-19 18:27 UTC] dolecek at ibis dot cz
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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-23 05:09 UTC] stas@php.net
Please produce as short as possible script that reproduces this problem, if possible - without needing any external entity, such as SQL server.
 [2000-11-29 06:14 UTC] stas@php.net
No feedback
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 15:00:01 2026 UTC