php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40765 calling backtrace inside nested static class functions causes segfault
Submitted: 2007-03-09 12:20 UTC Modified: 2007-03-09 13:57 UTC
From: nd0 at gmx dot de Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.2.1 OS: linux debian
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
6 + 14 = ?
Subscribe to this entry?

 
 [2007-03-09 12:20 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-09 12:29 UTC] nd0 at gmx dot de
new email
 [2007-03-09 12:36 UTC] tony2001@php.net
Cannot reproduce.
Please make sure you've disabled all zend_extensions like Zend Optimizer, APC, Xdebug, ionCube etc.
 [2007-03-09 13:45 UTC] tony2001@php.net
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 13:57 UTC] tony2001@php.net
.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 19:01:30 2024 UTC