php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30798 debug_backtrace returns invalid data in some cases
Submitted: 2004-11-15 18:31 UTC Modified: 2005-01-28 10:52 UTC
From: mikko dot rantalainen at peda dot net Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 4.3.9 OS: Mandrake Linux 10.0
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mikko dot rantalainen at peda dot net
New email:
PHP Version: OS:

 

 [2004-11-15 18:31 UTC] mikko dot rantalainen at peda dot net
Description:
------------
Attached script crashes PHP 4.3.4 (plus security fixes) which is latest versions distributed with Mandrake Linux.

Reproduce code:
---------------
<?php function __errorHandler($errno, $errstr, $errfile, $errline, $errcontext)
{
	error_log("__errorHandler: $errno: $errstr");
	$trace = debug_backtrace();
	foreach ($trace as $data)
	{
		$function = isset($data["function"]) ? $data["function"] : "???";
		if ($function == "__errorhandler")
			continue; # don't print error handler
		$file = isset($data["file"]) ? $data["file"] : "???";
		$line = isset($data["line"]) ? $data["line"] : "??";
		$args = isset($data["args"]) ? serialize($data["args"]) : ""; # XXX
		error_log("$file:$line: $function($args)\n");
	}
}
print("<h1>Check log.</h1>");
set_error_handler("__errorHandler");
$parts = split("/",array()); # generate error here
print("EOF.");
?>


Expected result:
----------------
A warning message have been sent to server log and a full page should have been returned to a client.

Actual result:
--------------
PHP crashes at line marked with "XXX". The problem seems to be related to the fact that the error is generated with incorrect call to split().


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-15 18:40 UTC] derick@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

.
 [2005-01-28 10:52 UTC] mikko dot rantalainen at peda dot net
I just checked this problem again. The reproduce code segfaults 4.3.9 but works with 4.3.10. Marking as closed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 15:01:28 2024 UTC