For a native android application that seg faults, why is there no stack trace in logcat?

◇◆丶佛笑我妖孽 提交于 2021-02-07 09:42:00

问题


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-stack 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!