php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41536 debug_backtrace crashes server by using call_user_func
Submitted: 2007-05-30 07:13 UTC Modified: 2007-05-30 09:05 UTC
From: ymasaki at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.2 OS: Windows Vista
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: ymasaki at gmail dot com
New email:
PHP Version: OS:

 

 [2007-05-30 07:13 UTC] ymasaki at gmail dot com
Description:
------------
debug_backtrace() crashes apache by using call_user_func.


Reproduce code:
---------------
<?php
	
	$class = new Test;
	$class->callMethod("execute");

class Test {
	function backtrace(){
		return debug_backtrace();
	}
	
	function display($dummy,$bk){
		print_r($bk);
	}
	
	function display2($bk){
		print_r($bk);
	}
	
	function callMethod($methodname){
		$ret = call_user_func(array($this,$methodname));
		
		return $ret;
	}
	
	function execute(){
		//CRASH!
		$this->display("dummy",$this->backtrace());

		//this works fine
//		$this->display("dummy",debug_backtrace());
		//this works fine too (only one arg)
//		$this->display2($this->backtrace());
	}
}


Expected result:
----------------
crash apache server

Actual result:
--------------
print backtrace normally

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-30 07:37 UTC] ymasaki at gmail dot com
sorry,please switch "Expected result:" and "Actual result:"...
 [2007-05-30 08:27 UTC] tony2001@php.net
Works perfectly fine here.
Please make sure all zend_extensions (like Zend Optimizer, APC, eAccelerator etc.) are disabled.
 [2007-05-30 08:53 UTC] ymasaki at gmail dot com
Thanks for answering.

I can run it fine by disable zend_extensions.
Is it possible to run the code with zend_extensions?
 [2007-05-30 09:05 UTC] tony2001@php.net
Please report this problem to the authors of the extension (you didn't specify it btw).
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 23:00:02 2026 UTC