Stacks not printed with symbols when crashing on Mac |
|||
Issue description
To reproduce, make skia crash in the renderer.
The following diff in third_party/skia will do that
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 6fded02..08ef8ad 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1764,6 +1764,7 @@ void SkCanvas::drawImage(const SkImage* image, SkScalar x, SkScalar y, const SkP
void SkCanvas::drawImageRect(const SkImage* image, const SkRect& src, const SkRect& dst,
const SkPaint* paint, SrcRectConstraint constraint) {
RETURN_ON_NULL(image);
+ SkASSERT(0);
if (dst.isEmpty() || src.isEmpty()) {
return;
}
This will crash pretty much immediately, but doesn't dump a useful stack -- it just gives the stack frame addresses without symbols.
[53267:775:0605/140956.518134:INFO:SkCanvas.cpp(1767)] ../../third_party/skia/src/core/SkCanvas.cpp:1767: fatal error: "assert(0)"
Received signal 6
[0x00010dc4b78e]
[0x00010dc4b82d]
[0x00010dc49aac]
[0x00010dc4b677]
[0x7fffad879b3a]
[0x7fff5208e2e0]
[0x7fffad6fe420]
This is different from Linux, where we actually get the symbols for the stack.
,
Jun 5 2017
bool EnableInProcessStackDumping() Gets it's stack trace from: debug::StackTrace().Print(); https://cs.chromium.org/chromium/src/base/debug/stack_trace_posix.cc?type=cs&l=301 So I guess I'd try that from within skia code and see if it symbolizes correctly. I'm guessing that whatever we use to do in-process symbolization doesn't work correctly with Skia.
,
Jun 5 2017
Thanks! This has nothing to do with Skia, but rather, stack dumping for anything besides base/logging-based dumps (e.g, DCHECK) is broken on Mac. Those work because we're not in the signal handler. Things only work on linux because it hits the USE_SYMBOLIZE branch in ProcessBacktrace. We don't call backtrace_symbols because we're in the signal handler ... see: // Below part is async-signal unsafe (uses malloc), so execute it only // when we are not executing the signal handler. Added in crrev.com/167714. IMO we should at the very least just do backtrace_symbols_fd(..., STDERR_FILENO). That way, when my layout test tryjobs faceplant, I can start to get an idea as to what went wrong.
,
Jul 18 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by ccameron@chromium.org
, Jun 5 2017