运行时期间Android ndk异常错误

时间:2013-04-19 13:00:51

标签: android-ndk

我已经将一些本机代码移植到了android,并且在运行时我收到了错误

 A/libc(7857): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)

但是我无法找出我的代码中哪一部分引发了此错误

如何在android ndk中有这些错误deatils

2 个答案:

答案 0 :(得分:1)

来自Android-NDK的ndk-stack是在logcat输出上运行的工具,如果你运气好的话,这可能会提供完整的堆栈跟踪

ndk-stack -sym <path> [-dump <path>]
  -sym  Contains full path to the root directory for symbols.
  -dump Contains full path to the file containing the crash dump.
        This is an optional parameter. If ommited, ndk-stack will
        read input data from stdin
See docs/NDK-STACK.html in your NDK installation tree for more details.

所以你可能想要运行

logcat | ndk-stack -sym <the symbol file from your project>

答案 1 :(得分:1)

如上所述,使用ndk-stack。可以找到一个好的指南here

相关问题