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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nd0 at gmx dot de
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 14:01:35 2025 UTC