Harden failure signal handler in the face of memory corruptions
authorTudor Bosman <tudorb@fb.com>
Mon, 24 Feb 2014 22:56:23 +0000 (14:56 -0800)
committerDave Watson <davejwatson@fb.com>
Fri, 28 Feb 2014 22:01:42 +0000 (14:01 -0800)
commitaf7e70660f867873638ef2ce5bb33b19771bdd41
tree691cb077b934b495bfb32adc8491fd7f28c78a24
parenta9ba07eb94a5b85985859568789559882ad0e33d
Harden failure signal handler in the face of memory corruptions

Summary:
@mhorowitz got

*** Aborted at 1393267847 (Unix time, try 'date -d @1393267847') ***
*** Signal 11 (SIGSEGV) (0x0) received by PID 12652 (TID 0x7f59cbfff700), stack trace: ***
pure virtual method called
terminate called without an active exception
Entered fatal signal handler recursively. We're in trouble.

in a test, and no stack trace.

The first time we enter recursively (ie. the second time overall), try to dump
without symbolization. The next time, give up.

Test Plan: folly/experimental/symbolizer/test, ran crash with a modified dumpStackTrace to force it to enter recursively

Reviewed By: lucian@fb.com

FB internal diff: D1187942
folly/experimental/symbolizer/SignalHandler.cpp
folly/experimental/symbolizer/Symbolizer.cpp
folly/experimental/symbolizer/Symbolizer.h