Page MenuHomePhabricator

[lldb/test] Enable faulthandler in dotest

Authored by rupprecht on Mon, Sep 14, 2:41 PM.



Register the faulthandler module so we can see what lldb tests are doing when they misbehave (e.g. run under a test runner that sets a timeout). This will print a stack trace for the following signals:

  • SIGSEGV, SIGFPE, SIGABRT, SIGBUS, and SIGILL (via faulthandler.enable())
  • SIGTERM (via faulthandler.register(SIGTERM)) [This is what our test runners sends when it times out].

The only signal we currently handle is SIGINT (via unittest2.signals.installHandler()) so there should be no overlap added by this patch.

Because this import is not available until python3, and the register() method is not available on Windows, this is enabled defensively.

This should have absolutely no effect when tests are passing (or even normally failing), but can be observed by running this while ninja is running:

kill -s SIGTERM $(ps aux | grep | head -1 | awk '{print $2}')

Diff Detail

Event Timeline

rupprecht created this revision.Mon, Sep 14, 2:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptMon, Sep 14, 2:41 PM
rupprecht requested review of this revision.Mon, Sep 14, 2:41 PM
JDevlieghere accepted this revision.Wed, Sep 16, 1:59 PM

I think this will be very useful. LGTM!

This revision is now accepted and ready to land.Wed, Sep 16, 1:59 PM
This revision was automatically updated to reflect the committed changes.