Edit report at https://bugs.php.net/bug.php?id=61476&edit=1
ID: 61476 Updated by: yohg...@php.net Reported by: kotai dot kristof at gmail dot com Summary: debug_backtrace() crashes if it has to return too large data -Status: Open +Status: Wont fix Type: Bug Package: *General Issues Operating System: All PHP Version: 5.4.0 Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2012-03-22 17:28:57] 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=61476&edit=1