From:             mes at zeroc dot com
Operating system: Windows 2000/XP
PHP version:      5.0.0RC1
PHP Bug Type:     Zend Engine 2 problem
Bug description:  Access violation while throwing exception

Description:
------------
I'm using PHP 5.0.0RC1 and Apache 2.0.49 on Windows 2000 & XP. After
executing the enclosed script a number of times, I eventually receive an
Access Violation notice. Sometimes it happens after two executions,
sometimes after 20, but it always happens.



I initially used the binary distributions of PHP5 and Apache, but I've
also compiled Apache and PHP5 from sources using VC 6.0 and VC 7.0, with
the same result. Unfortunately, the problem only appears when I compile in
release mode, not in debug mode.



However, I believe the problem occurs in the first while loop of
zend_fetch_debug_backtrace, where the args variable eventually points to
an invalid location and is then dereferenced.

Reproduce code:
---------------
<HTML>

<HEAD>

    <TITLE>Access Violation Demo</TITLE>

</HEAD>

<BODY>



    <H1>Access Violation Demo</H1>



<?php



if(isset($_POST["submitted"]))

{

    echo "<HR>\n";

    echo "<P>Status:<BR><B>\n";

    try

    {

        throw new Exception;

    }

    catch(Exception $ex)

    {

        echo "<pre>\n";

        print_r($ex);

        echo "</pre>\n";

    }

    echo "</B></P>\n";

    echo "<HR>\n";

}

?>



    <P>

    <FORM method="POST" action="<?php echo basename($_SERVER["PHP_SELF"]);
?>">

        <INPUT type="hidden" name="submitted" value="yes">

        <INPUT type="submit" name="Submit" value="Submit">

    </FORM>

</BODY>

</HTML>

Expected result:
----------------
Access violation dialog

Actual result:
--------------
Can't get a useful stack trace because it doesn't seem to happen in debug
mode.

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

Reply via email to