View Issue Details

IDProjectCategoryView StatusLast Update
0000259XdebugUncategorizedpublic2020-03-12 17:07
Reporteraferber Assigned Toderick  
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Summary0000259: outputs exception backtrace even if exception is caught
Description

XDebug seems to log a backtrace to the error log even if the exception is caught and handled by the code.

This severely degrades functionality for me since for example doctrine (which I'm using) uses exceptions internally for many things, which makes it very difficult to distinguish those internal exceptions from the ones that really matter (ie. uncaught exceptions).

IMHO this behaviour should be configurable, and maybe there should be a function that can be called from exceptions handlers to log a backtrace of the exception.

TagsNo tags attached.
Operating System
PHP Version5.2.1

Activities

derick

2007-04-25 10:51

administrator   ~0000597

This is already configurable with the "xdebug.show_exception_trace" setting, see the documentation at: http://xdebug.org/docs-settings.php#show_exception_trace (and it defaults to off). However, there have been some versions where this configuration setting did not exist, so you might have to upgrade.

aferber

2007-04-25 12:07

reporter   ~0000598

The setting doesn't work for me.

I get the following behaviour for different combinations of show_exception_trace and catching/not catching exceptions:

  1. show_exception_trace = 1
    a. uncaught: logs stack trace twice to httpd error log
    b. caught: logs stack trace twice
  2. show_exception_trace = 0
    a. uncaught: logs stack trace once
    b. caught: logs stack trace once

When using the PHP commandline version:

  1. show_exception_trace = 1
    a. uncaught: displays stack trace once
    b. caught: no stack trace
  2. show_exception_trace = 0
    a. uncaught: displays stack trace once
    b. caught: no stack trace

What I want is the behaviour of the apache module version to be the same as the commandline version, ie. log a stack trace if an exception is not caught.

The tests were done with the following script:


echo "xdebug.show_exception_trace=".ini_get("xdebug.show_exception_trace")."\n";
flush();
try {
throw new Exception('test');
}
catch (Exception $e) {
echo "Caught!\n";
}

For the "uncaught" tests remove the try/catch.

This is with XDebug version 2.0.0RC3, AFAIK there is no more recent release. PHP version is 5.2.1, however behaviour was the same with 5.1.6. Apache is 2.0.54.

aferber

2007-04-25 12:11

reporter   ~0000599

Forgot to mention in my last note:

The php.ini used was exactly the same in both the apache and commandline tests. Only changes were with regards to the show_exception_trace option. All other xdebug related options are at defaults.

Apache LogLevel is "debug".

derick

2007-04-26 08:55

administrator   ~0000600

You'd have to use Xdebug from CVS - I addressed this issue on February 28th. See http://xdebug.org/install.php#source on how do install from CVS.

Issue History

Date Modified Username Field Change
2007-04-25 10:41 aferber New Issue
2007-04-25 10:51 derick Status new => resolved
2007-04-25 10:51 derick Resolution open => fixed
2007-04-25 10:51 derick Assigned To => derick
2007-04-25 10:51 derick Note Added: 0000597
2007-04-25 12:07 aferber Status resolved => feedback
2007-04-25 12:07 aferber Resolution fixed => reopened
2007-04-25 12:07 aferber Note Added: 0000598
2007-04-25 12:11 aferber Note Added: 0000599
2007-04-26 08:55 derick Status feedback => resolved
2007-04-26 08:55 derick Resolution reopened => fixed
2007-04-26 08:55 derick Note Added: 0000600
2020-03-12 16:56 derick Severity major => feature
2020-03-12 17:07 derick Category Feature/Change request => Uncategorized