#30798 [Bgs->Csd]: debug_backtrace returns invalid data in some cases
| From: | mikko dot rantalainen at peda dot net | Date: | Fri, 28 Jan 2005 09:52:58 +0000 |
| Subject: | #30798 [Bgs->Csd]: debug_backtrace returns invalid data in some cases | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-72975@lists.php.net to get a copy of this message | ||
ID: 30798
User updated by: mikko dot rantalainen at peda dot net
Reported By: mikko dot rantalainen at peda dot net
-Status: Bogus
+Status: Closed
Bug Type: Reproducible crash
Operating System: Mandrake Linux 10.0
-PHP Version: Irrelevant
+PHP Version: 4.3.9
New Comment:
I just checked this problem again. The reproduce code segfaults 4.3.9
but works with 4.3.10. Marking as closed.
Previous Comments:
------------------------------------------------------------------------
[2004-11-15 18:40:47] 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.
.
------------------------------------------------------------------------
[2004-11-15 18:31:29] 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().
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30798&edit=1