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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

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: Sun May 05 12:01:32 2024 UTC