php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61476 debug_backtrace() crashes if it has to return too large data
Submitted: 2012-03-22 17:28 UTC Modified: 2013-07-30 02:53 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: kotai dot kristof at gmail dot com Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 5.4.0 OS: All
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: kotai dot kristof at gmail dot com
New email:
PHP Version: OS:

 

 [2012-03-22 17:28 UTC] kotai dot kristof at gmail dot com
Description:
------------
version 5.3.3.7

So the problem is that I use debug_backtrace() for logging, when an error 
occurs, so that I have record of what happened and where.

The problem is that if you are using for example Zend framework, and a couple of 
huge objects are encountered, then PHP basically crashes (nothing is logged in 
the error log, no error output is produced, only a blank output). This is 
probably because of the lack of memory.

Yes, I know that I should use the ..._PROVIDE_OBJECT flag to skip them, but 
that's the point. I don't want to. Because I need it 99% of the time, but 
sometimes I get these huge backtraces which makes PHP fail.

So there should either be a way to check how big the output debug_backtrace() 
produces, (so that I will know when not to execute it), or it should return 
FALSE if there is not enough memory to store the result or something similar no? 
You added the limit parameter in PHP 5.4 I can see that, but that still doesn't 
guarantee you that you will have enough memory to get results of this function. 
It can still cause a crash.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-30 02:53 UTC] yohgaki@php.net
-Status: Open +Status: Wont fix
 [2013-07-30 02:53 UTC] yohgaki@php.net
I suppose you don't have enough memory.
All you can do is increase memory_limit. memory_limit is protection againse 
resource exhaustion attack. Changing it automatically is not a good idea.

http://www.php.net/manual/en/ini.core.php#ini.memory-limit

Increase memory_limit or disalbe it with -1 in your custome debug_backtrace() 
wrapper function.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 17:01:31 2024 UTC