问题
Pretty self explanatory. I compiled a native c++ exe using the ndk. When I run the app, it gets a SIGSEGV, seg faults and exits. There is no stack trace or cpu context in the logcat.
Why? Any suggestions on how to fix it?
回答1:
there are two tools you can use to debug your sigsev
. ndk-stac
k and arm-linux-androideabi-addr2line
located into your $NDK
dir.The first help you to filter the stacktrace and addr2line translates program addresses into file names and line num. Check into your $NDK
dir, for the documentation.
回答2:
You're all wrong, you need to enable logging to logcat for STDIO and STDERR.
http://developer.android.com/tools/debugging/debugging-log.html#viewingStd
来源:https://stackoverflow.com/questions/9708069/for-a-native-android-application-that-seg-faults-why-is-there-no-stack-trace-in