#40765 [Opn]: calling backtrace inside nested static class functions causes segfault
| From: | nd0 at gmx dot de | Date: | Fri, 09 Mar 2007 12:29:46 +0000 |
| Subject: | #40765 [Opn]: calling backtrace inside nested static class functions causes segfault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-110137@lists.php.net to get a copy of this message | ||
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 http://bugs.php.net/?id=40765&edit=1