ID:               22836
 Updated by:       [EMAIL PROTECTED]
 Reported By:      brunswim at seas dot upenn dot edu
-Status:           Verified
+Status:           Closed
 Bug Type:         Scripting Engine problem
 Operating System: Debian Linux 2.4.18
 PHP Version:      4.3.2-RC
 New Comment:

This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2003-03-25 17:41:13] jseverson at myersinternet dot com

Same as bug <a href="http://bugs.php.net/bug.php?id=20583";>Bug
20583</a>

I've posted a list of all bug reports I've found that seem to be
related to this same php bug, 20583.

------------------------------------------------------------------------

[2003-03-24 11:39:03] brunswim at seas dot upenn dot edu

This seems similar to bug #22367 but causes problems more globally. 
Obviously, this is reproducible with a short script.  In the following
similar example, it may be more apparent that global corruption is
taking place.

<?
function &f1() {
        return($a);
}
function f2() {
        $x = "bar";
        $y = "bug!";
        var_dump($x);
        print "<br>\n$x";
}

$i =& f1();
$j =& f1();
f2();
?>

The output that I get is:
NULL
bug!

So, after 2 references to uninitialized variables, everything behaves
unpredictably.

It is easy to see how this situation could occur in "real" code.  In
our case, we were building objects from a database select query.  We
were iterating through the rows and putting data in $a[].  When there
were no rows, $a was never initialized, but it was extremely difficult
to isolate the problem because other functions, across many files, were
misbehaving due to this bug.

------------------------------------------------------------------------

[2003-03-24 04:29:46] [EMAIL PROTECTED]

This problem has much to do with bug #22367.

Assumed reason: unexpected change of EG(uninitialized_zval_ptr)..


------------------------------------------------------------------------

[2003-03-24 03:41:50] [EMAIL PROTECTED]

I get same output plus these leaks:

/usr/src/web/php/php4/Zend/zend_execute.c(436) :  Freeing 0x0875A804 (4
bytes), script=t.php
/usr/src/web/php/php4/Zend/zend_variables.c(111) : Actual location
(location was relayed)
/usr/src/web/php/php4/Zend/zend_execute.c(1702) :  Freeing 0x0875A6EC
(12 bytes), script=t.php



------------------------------------------------------------------------

[2003-03-24 01:45:41] brunswim at seas dot upenn dot edu

For the record, the output I am getting for this script is:

string(3) "foo"
foo
string(3) "foo"
foo
NULL
foo
NULL
foo
NULL
foo
NULL
foo
NULL
foo
NULL
foo

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/22836

-- 
Edit this bug report at http://bugs.php.net/?id=22836&edit=1

Reply via email to