Commit 82c911c3 authored by Alexei Svitkine's avatar Alexei Svitkine Committed by Commit Bot

Make Mac stack traces human readable.

Currently, if there's a crash - even in a debug build - on Mac, the
stack trace shown on the console (or on bots) is not symbolized. This
is because we disable this functionality when we're in the signal handler.

This makes it very frustrating for developers to diagnose failures - both
locally and on the bots. So this CL attempts to enable the symbolization.
The idea is that it's a better default since having useful stack traces
outweighs the risk involved in doing this.

TO SHERIFFS: It is possible that this may cause failures that would
previously crash to instead hang - and this may actually be worse than
the current behavior. If you see something like the above, then we may
want to revert this. I'm landing this to specifically see if we can do
this without ill effects.

BUG=

Change-Id: I9cdc03e2ee098305e32c8a4f119d7df6bdf3c3e4
Reviewed-on: https://chromium-review.googlesource.com/644142
Commit-Queue: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522131}
parent 573a2d17
......@@ -242,9 +242,16 @@ void StackDumpSignalHandler(int signal, siginfo_t* info, void* void_context) {
return;
}
// Do not take the "in signal handler" code path on Mac in a DCHECK-enabled
// build, as this prevents seeing a useful (symbolized) stack trace on a crash
// or DCHECK() failure. While it may not be fully safe to run the stack symbol
// printing code, in practice it's better to provide meaningful stack traces -
// and the risk is low given we're likely crashing already.
#if !defined(OS_MACOSX) || !DCHECK_IS_ON()
// Record the fact that we are in the signal handler now, so that the rest
// of StackTrace can behave in an async-signal-safe manner.
in_signal_handler = 1;
#endif
if (BeingDebugged())
BreakDebugger();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment