#40765 [NEW]: calling backtrace inside nested static class functions causes segfault

Ask a Question related to PHP Bugs, Design and Development.

  1. #1

    Default #40765 [NEW]: calling backtrace inside nested static class functions causes segfault

    From: ndroege at bimp dot de
    Operating system: linux debian
    PHP version: 5.2.1
    PHP Bug Type: Reproducible crash
    Bug description: calling backtrace inside nested static class functions causes segfault

    Description:
    ------------
    Testet on 5.2.0 and 5.2.1

    I was able to reproduce segfaults in this situation
    on the commandline and with apache!


    Reproduce code:
    ---------------
    <?php
    class CrashHelper
    {
    function call2($tpl_var, $value = null) {}
    function call1($value = null) {}
    }

    class Crash
    {
    static function outerCall($param)
    {
    $ch = new CrashHelper();

    # $test = Crash::innerCall($param);
    # $ch->call2('test', $test); // don't crash

    # $ch->call1(Crash::innerCall($param)); // don't crash

    $ch->call2('test', Crash::innerCall($param)); // crash
    }
    static function innerCall($param)
    {
    $backtrace = debug_backtrace();
    echo '<pre>'.var_export($backtrace, true).'</pre>';
    }
    }

    function doCrash($param)
    {
    # $ch = new CrashHelper();
    # $ch->call2('test', Crash::innerCall($param)); // don't crash

    Crash::outerCall($param);
    }

    doCrash($_GET['id']);
    ?>


    Expected result:
    ----------------
    backtrace,
    no crash

    Actual result:
    --------------
    Speicherzugriffsfehler

    --
    Edit bug report at [url]http://bugs.php.net/?id=40765&edit=1[/url]
    --
    Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40765&r=trysnapshot44[/url]
    Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40765&r=trysnapshot52[/url]
    Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40765&r=trysnapshot60[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40765&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=40765&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=40765&r=needtrace[/url]
    Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40765&r=needscript[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=40765&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=40765&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=40765&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=40765&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=40765&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=40765&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40765&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=40765&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=40765&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40765&r=gnused[/url]
    Floating point limitations: [url]http://bugs.php.net/fix.php?id=40765&r=float[/url]
    No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40765&r=nozend[/url]
    MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40765&r=mysqlcfg[/url]
    ndroege at bimp dot de Guest

  2. Similar Questions and Discussions

    1. #39346 [NEW]: Unsetting a static variable inside a destructor causes segfault later on
      From: daan at parse dot nl Operating system: Slackware 10.2 PHP version: 5.2.0RC5 PHP Bug Type: Reproducible crash Bug...
    2. #39177 [NEW]: Need mechanism to identifed calling class in static methods
      From: acarheden at gmail dot com Operating system: Windows 2K3 Server PHP version: 5.1.6 PHP Bug Type: Feature/Change Request...
    3. #25652 [Opn->Ver]: Calling Global functions dynamically fails from Class scope
      ID: 25652 Updated by: sniper@php.net Reported By: john@php.net -Status: Open +Status: Verified Bug...
    4. #25652 [Com]: Calling Global functions dynamically fails from Class scope
      ID: 25652 Comment by: peter dot prochaska at datev dot de Reported By: john@php.net Status: Open Bug Type: ...
    5. Calling functions that are inside an included php file. Please Help
      Why are you including a file using "http://localhost" . If your first script is running file using : <?include("selfedit.php");?> Then use it...
  3. #2

    Default #40765 [Opn]: calling backtrace inside nested static class functions causes segfault

    ID: 40765
    User updated by: nd0 at gmx dot de
    -Reported By: ndroege at bimp dot de
    +Reported By: nd0 at gmx dot de
    Status: Open
    Bug Type: Reproducible crash
    Operating System: linux debian
    PHP Version: 5.2.1
    New Comment:

    new email


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

    [2007-03-09 12:20:28] nd0 at gmx dot de

    Description:
    ------------
    Testet on 5.2.0 and 5.2.1

    I was able to reproduce segfaults in this situation
    on the commandline and with apache!


    Reproduce code:
    ---------------
    <?php
    class CrashHelper
    {
    function call2($tpl_var, $value = null) {}
    function call1($value = null) {}
    }

    class Crash
    {
    static function outerCall($param)
    {
    $ch = new CrashHelper();

    # $test = Crash::innerCall($param);
    # $ch->call2('test', $test); // don't crash

    # $ch->call1(Crash::innerCall($param)); // don't crash

    $ch->call2('test', Crash::innerCall($param)); // crash
    }
    static function innerCall($param)
    {
    $backtrace = debug_backtrace();
    echo '<pre>'.var_export($backtrace, true).'</pre>';
    }
    }

    function doCrash($param)
    {
    # $ch = new CrashHelper();
    # $ch->call2('test', Crash::innerCall($param)); // don't crash

    Crash::outerCall($param);
    }

    doCrash($_GET['id']);
    ?>


    Expected result:
    ----------------
    backtrace,
    no crash

    Actual result:
    --------------
    Speicherzugriffsfehler


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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40765&edit=1[/url]
    nd0 at gmx dot de Guest

  4. #3

    Default #40765 [Opn->Fbk]: calling backtrace inside nested static class functions causes segfault

    ID: 40765
    Updated by: [email]tony2001@php.net[/email]
    Reported By: nd0 at gmx dot de
    -Status: Open
    +Status: Feedback
    Bug Type: Reproducible crash
    Operating System: linux debian
    PHP Version: 5.2.1
    New Comment:

    Cannot reproduce.
    Please make sure you've disabled all zend_extensions like Zend
    Optimizer, APC, Xdebug, ionCube etc.


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

    [2007-03-09 12:29:45] nd0 at gmx dot de

    new email

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

    [2007-03-09 12:20:28] nd0 at gmx dot de

    Description:
    ------------
    Testet on 5.2.0 and 5.2.1

    I was able to reproduce segfaults in this situation
    on the commandline and with apache!


    Reproduce code:
    ---------------
    <?php
    class CrashHelper
    {
    function call2($tpl_var, $value = null) {}
    function call1($value = null) {}
    }

    class Crash
    {
    static function outerCall($param)
    {
    $ch = new CrashHelper();

    # $test = Crash::innerCall($param);
    # $ch->call2('test', $test); // don't crash

    # $ch->call1(Crash::innerCall($param)); // don't crash

    $ch->call2('test', Crash::innerCall($param)); // crash
    }
    static function innerCall($param)
    {
    $backtrace = debug_backtrace();
    echo '<pre>'.var_export($backtrace, true).'</pre>';
    }
    }

    function doCrash($param)
    {
    # $ch = new CrashHelper();
    # $ch->call2('test', Crash::innerCall($param)); // don't crash

    Crash::outerCall($param);
    }

    doCrash($_GET['id']);
    ?>


    Expected result:
    ----------------
    backtrace,
    no crash

    Actual result:
    --------------
    Speicherzugriffsfehler


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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40765&edit=1[/url]
    tony2001@php.net Guest

  5. #4

    Default #40765 [Fbk->Opn]: calling backtrace inside nested static class functions causes segfault

    ID: 40765
    Updated by: [email]tony2001@php.net[/email]
    Reported By: nd0 at gmx dot de
    -Status: Feedback
    +Status: Open
    Bug Type: Reproducible crash
    Operating System: linux debian
    PHP Version: 5.2.1
    New Comment:

    Do not file bugs when you have Zend extensions (zend_extension=)
    loaded. Examples are Zend Optimizer, Zend Debugger, Turck MM Cache,
    APC, Xdebug and ionCube loader. These extensions often modify engine
    behavior which is not related to PHP itself.




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

    [2007-03-09 12:36:21] [email]tony2001@php.net[/email]

    Cannot reproduce.
    Please make sure you've disabled all zend_extensions like Zend
    Optimizer, APC, Xdebug, ionCube etc.

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

    [2007-03-09 12:29:45] nd0 at gmx dot de

    new email

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

    [2007-03-09 12:20:28] nd0 at gmx dot de

    Description:
    ------------
    Testet on 5.2.0 and 5.2.1

    I was able to reproduce segfaults in this situation
    on the commandline and with apache!


    Reproduce code:
    ---------------
    <?php
    class CrashHelper
    {
    function call2($tpl_var, $value = null) {}
    function call1($value = null) {}
    }

    class Crash
    {
    static function outerCall($param)
    {
    $ch = new CrashHelper();

    # $test = Crash::innerCall($param);
    # $ch->call2('test', $test); // don't crash

    # $ch->call1(Crash::innerCall($param)); // don't crash

    $ch->call2('test', Crash::innerCall($param)); // crash
    }
    static function innerCall($param)
    {
    $backtrace = debug_backtrace();
    echo '<pre>'.var_export($backtrace, true).'</pre>';
    }
    }

    function doCrash($param)
    {
    # $ch = new CrashHelper();
    # $ch->call2('test', Crash::innerCall($param)); // don't crash

    Crash::outerCall($param);
    }

    doCrash($_GET['id']);
    ?>


    Expected result:
    ----------------
    backtrace,
    no crash

    Actual result:
    --------------
    Speicherzugriffsfehler


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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40765&edit=1[/url]
    tony2001@php.net Guest

  6. #5

    Default #40765 [Opn->Bgs]: calling backtrace inside nested static class functions causes segfault

    ID: 40765
    Updated by: [email]tony2001@php.net[/email]
    Reported By: nd0 at gmx dot de
    -Status: Open
    +Status: Bogus
    Bug Type: Reproducible crash
    Operating System: linux debian
    PHP Version: 5.2.1
    New Comment:

    ..


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

    [2007-03-09 13:45:11] [email]tony2001@php.net[/email]

    Do not file bugs when you have Zend extensions (zend_extension=)
    loaded. Examples are Zend Optimizer, Zend Debugger, Turck MM Cache,
    APC, Xdebug and ionCube loader. These extensions often modify engine
    behavior which is not related to PHP itself.



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

    [2007-03-09 12:36:21] [email]tony2001@php.net[/email]

    Cannot reproduce.
    Please make sure you've disabled all zend_extensions like Zend
    Optimizer, APC, Xdebug, ionCube etc.

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

    [2007-03-09 12:29:45] nd0 at gmx dot de

    new email

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

    [2007-03-09 12:20:28] nd0 at gmx dot de

    Description:
    ------------
    Testet on 5.2.0 and 5.2.1

    I was able to reproduce segfaults in this situation
    on the commandline and with apache!


    Reproduce code:
    ---------------
    <?php
    class CrashHelper
    {
    function call2($tpl_var, $value = null) {}
    function call1($value = null) {}
    }

    class Crash
    {
    static function outerCall($param)
    {
    $ch = new CrashHelper();

    # $test = Crash::innerCall($param);
    # $ch->call2('test', $test); // don't crash

    # $ch->call1(Crash::innerCall($param)); // don't crash

    $ch->call2('test', Crash::innerCall($param)); // crash
    }
    static function innerCall($param)
    {
    $backtrace = debug_backtrace();
    echo '<pre>'.var_export($backtrace, true).'</pre>';
    }
    }

    function doCrash($param)
    {
    # $ch = new CrashHelper();
    # $ch->call2('test', Crash::innerCall($param)); // don't crash

    Crash::outerCall($param);
    }

    doCrash($_GET['id']);
    ?>


    Expected result:
    ----------------
    backtrace,
    no crash

    Actual result:
    --------------
    Speicherzugriffsfehler


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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40765&edit=1[/url]
    tony2001@php.net Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139