From:             php at mirzabah dot com
Operating system: Windows XP
PHP version:      4.3.4
PHP Bug Type:     Reproducible crash
Bug description:  Returning a reference to a reference parameter more than once causes 
crash

Description:
------------
If a variable is passed by reference to a function that returns it as a
reference more than once, PHP will hang then crash on exit. I'm guessing
it's some kind of garbage collection problem...

Reproduce code:
---------------
<html>

        <head><title>Ref Test</title></head>

        <body>

                <h1>Ref Test</h1>

                <?

                $a = 6 ;

                echo "<p>{$a}</p>\n" ;

                $a =& modify ($a) ;

                echo "<p>{$a}</p>\n" ;

                $a =& modify ($a) ;

                ?>

        </body>

</html><?

function &modify (&$thing)

        {

        $thing += 1 ;

        return $thing ;

        }

?>

Expected result:
----------------
I expect PHP to exit cleanly upon completion of the script.

Actual result:
--------------
When the script finishes execution, it hangs and eventually crashes. Note
that the function returns cleanly as often as you call it. The hang only
occurs once the script has completed.

-- 
Edit bug report at http://bugs.php.net/?id=27819&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27819&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27819&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27819&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27819&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27819&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27819&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27819&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27819&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27819&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27819&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27819&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27819&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27819&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27819&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27819&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27819&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27819&r=float

Reply via email to