New issue
Advanced search Search tips

Issue 729757 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Jul 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

Stacks not printed with symbols when crashing on Mac

Project Member Reported by ccameron@chromium.org, Jun 5 2017

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.
 
Erik, you mentioned that you have some pointers for places to start looking here.
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.
Cc: mark@chromium.org
Summary: Stacks not printed with symbols when crashing on Mac (was: Stacks not printed with symbols when crashing in skia)
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.
Status: WontFix (was: Assigned)

Sign in to add a comment