0

I want to get stack trace when my progrom crash in my .so library, in fact, i call the interface in .so from JNI.

And I follow a old question, but not worked. All I get in the dumpBacktrace is the signal handler itself. Here's the link of old question.

platform: arm, ndk-version: android-ndk-r10d

Community
  • 1
  • 1
Matti
  • 11
  • 1
  • 1
    What exactly do you want to get? The terms "stacktrace" and "backtrace" are often used interchangeably. Do you want to get a stack *dump*? Or a *trace* of all functions in the *call stack*? – Some programmer dude Sep 21 '16 at 09:38
  • @Joachim Pileborg , Yes, i wanna get a trace of all functions in the call stack. There is no backtrace() in ndk. – Matti Sep 22 '16 at 04:38
  • After reading your question a little more thoroughly I have another couple of questions. Do you catch crashes (such as segmentation fault) using a signal handler (i.e. you install a handler for `SIGSEGV`)? Then you can't rely on the call stack because signal handlers are special cases and are called directly from the kernel. I do not personally know how to get a call trace in such a case, but the original (non-signal handler) stack should be available to get somehow from the kernel I think. – Some programmer dude Sep 22 '16 at 07:50

1 Answers1

0

you should definitely check out coffecatch: https://github.com/xroche/coffeecatch

V-master
  • 1,957
  • 15
  • 18