Page MenuHomePhabricator

get bracktraces from hhvm fatals
Closed, DuplicatePublic

Description

Any ideas if I'm missing something or if that is not supported by HHVM yet?

Would a workaround for our installation be to enable hhvm.error_handling.call_user_handler_on_fatals?

$ cat test.php
<?php
function foo(DateTime $date) {
}
function foo2($date) {
  foo($date);
}
foo2(null);
$ cat php.ini
hhvm.debug.full_backtrace = true
hhvm.debug.server_stack_trace = true
hhvm.debug.server_error_message = true
hhvm.debug.translate_source = true
hhvm.debug.native_stack_trace = true
$ hhvm -c php.ini -m debug test.php
Welcome to HipHop Debugger!
Type "help" or "?" for a complete list of commands.

Program test.php loaded. Type '[r]un' or '[c]ontinue' to go.
hphpd> run
run

Catchable fatal error: Argument 1 passed to foo() must be an instance of DateTime, null given in /home/jan/projects/wikimedia/mediawiki/extensions/Wikibase/test.php on line 3
Program test.php exited normally.
hphpd> bt
bt
#0   ()
    at :1

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 14 2016, 3:49 PM
bd808 added a comment.Apr 14 2016, 5:00 PM

See T89169#1573731 for a reasonable overview of the error handling and logging options in HHVM. TL;DR you have to use hhvm.error_handling.call_user_handler_on_fatals and an handler that supports the un(der)documented 6th argument which passes you a call stack. The hhvm.debug.* settings are for HHVM's interpreter space logging (C++ stacks).