ART Debugging = No call stack on crash?

My Nexus 7 (1st gen) was crashing (SIGSEGV) during a debug session (due to a real crash bug).

It would crash cleanly with logcat showing the usual information, but Visual Studio would miss the crash entirely. Hitting stop on the debugger would cause Visual Studio to hang.

Finally, I discovered the “Art Debugging” flag in tools->options->android->debug. Setting this to false enabled me to get stack traces.

My application is all C++, save for the SDL2 “SDLActivity”. Having read the NDK 10d release notes and the ART debugging description, I am still fuzzy on what it is I am giving up.

I’ll say this, though: the docs were vague enough about this that I imagine there are devs out there, like myself, wondering where their SIGSEGV callstacks are.

Hi, thank you for bringing this up. In the new Android runtime (ART) SIGSEGVs are used for internal purposes and Google has provided a workaround for GDB to allow it skip the ART SIGSEGVs and stop on “real” ones via a breakpoint on an ART function. Unfortunately, this workaround is far from perfect and is known to fail to capture some of the segfaults, which is what you have experinced.

We are currently trying to find a way to mitigate that, but I can’t say when and if we’ll come with a better solution than the official workaround. Turning ART Debugging off effectively disables it, letting GDB catch all segfaults. It is safe to do so, but you must understand that there can be SIGSEGVs that aren’t problems or bugs in your app.

Thanks for expanding on the understanding that reading the documentation gave me. This confirms what I thought the issue was.

Since I wrote the original message, I can confirm that the issue also happened for me on the NVidia Shield Tablet.

Barring accurate SIGSEGV meaning detection, I would recommend turning this on by default, triggering false SIGSEGV messages at times. A 60 second Visual Studio not-responding hang after every launch resulting in a crash is pretty gross.

Tested on VS2012 & VS2013.

Unfortunately, turning all SIGSEGVs on by default is not a better option, since in some common scenarios there are a lot of internal ART segfaults. Because of this I think there are no good defaults for this property since some users will be having issues in either case.

The hang is not normal, of course. I’ll add a ticket in our internal bug tracker for that.