【问题标题】:Using ndk-stack to read crash logs使用 ndk-stack 读取崩溃日志
【发布时间】:2013-07-08 09:08:58
【问题描述】:

我正在使用 cocos2d-x v2.1.4,我有来自 logcat 的崩溃日志:

I/DEBUG   ( 6575): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   ( 6575): Build fingerprint: 'acer/a500_ww_gen1/picasso:4.0.3/IML74K/1333032611:user/release-keys'
I/DEBUG   ( 6575): pid: 6680, tid: 6680  >>> com.xxxxx.xxxxx <<<
I/DEBUG   ( 6575): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 5bd10d1f
I/DEBUG   ( 6575):  r0 0000006e  r1 5ceda8ec  r2 00000000  r3 5bd10d1f
I/DEBUG   ( 6575):  r4 00000000  r5 5bb4dfc1  r6 5bd13c38  r7 5ceda8ec
I/DEBUG   ( 6575):  r8 00007530  r9 00000000  10 00000000  fp 5bd13c38
I/DEBUG   ( 6575):  ip 5bd76e4c  sp 5ced9948  lr 5bb4e179  pc 5bb4dfce  cpsr 00000030
I/DEBUG   ( 6575):  d0  0000000000000000  d1  0000000000000000
I/DEBUG   ( 6575):  d2  0000000000000000  d3  000000003f000000
I/DEBUG   ( 6575):  d4  0000000000000000  d5  0000000000000000
I/DEBUG   ( 6575):  d6  0000000000000000  d7  0000000000000000
I/DEBUG   ( 6575):  d8  0000000000000000  d9  0000000000000000
I/DEBUG   ( 6575):  d10 0000000000000000  d11 0000000000000000
I/DEBUG   ( 6575):  d12 0000000000000000  d13 0000000000000000
I/DEBUG   ( 6575):  d14 0000000000000000  d15 0000000000000000
I/DEBUG   ( 6575):  scr 80000012
I/DEBUG   ( 6575): 
I/DEBUG   ( 6575):          #00  pc 0032ffce  /data/data/com.xxxxx.xxxxx/lib/libgame.so
I/DEBUG   ( 6575):          #01  pc 00330176  /data/data/com.xxxxx.xxxxx/lib/libgame.so
I/DEBUG   ( 6575):          #02  pc 00330f68  /data/data/com.xxxxx.xxxxx/lib/libgame.so (curl_mvsnprintf)
I/DEBUG   ( 6575):          #03  pc 00323e2c  /data/data/com.xxxxx.xxxxx/lib/libgame.so (Curl_failf)
I/DEBUG   ( 6575):          #04  pc 0031d39e  /data/data/com.xxxxx.xxxxx/lib/libgame.so (Curl_resolv_timeout)
I/DEBUG   ( 6575):          #05  pc 00329ea2  /data/data/com.xxxxx.xxxxx/lib/libgame.so (Curl_connect)

我可以从这个日志中看出它是由 cURL 方法未正确完成或其他原因引起的,但我想知道哪个函数导致崩溃。我尝试使用ndk-stack,但我得到了这个结果:

********** Crash dump: **********
Build fingerprint: 'acer/a500_ww_gen1/picasso:4.0.3/IML74K/1333032611:user/release-keys'
pid: 6498, tid: 6498  >>> com.xxxxx.xxxxx <<<
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 5bb71d1f
Stack frame #00  pc 0032ffce  /data/data/com.xxxxx.xxxxx/lib/libgame.so: Unable to locate routine information for address 32ffce in module /Users/xxxxx/Desktop/xxxxx/_projects/xxxxx/xxxxx/proj.android/obj/local/armeabi/libgame.so
Stack frame #01  pc 00330176  /data/data/com.xxxxx.xxxxx/lib/libgame.so: Unable to locate routine information for address 330176 in module /Users/xxxxx/Desktop/xxxxx/_projects/xxxxx/xxxxx/proj.android/obj/local/armeabi/libgame.so
Stack frame #02  pc 00330f68  /data/data/com.xxxxx.xxxxx/lib/libgame.so (curl_mvsnprintf): Unable to locate routine information for address 330f68 in module /Users/xxxxx/Desktop/xxxxx/_projects/xxxxx/xxxxx/proj.android/obj/local/armeabi/libgame.so
Stack frame #03  pc 00323e2c  /data/data/com.xxxxx.xxxxx/lib/libgame.so (Curl_failf): Unable to locate routine information for address 323e2c in module /Users/xxxxx/Desktop/xxxxx/_projects/xxxxx/xxxxx/proj.android/obj/local/armeabi/libgame.so
Stack frame #04  pc 0031d39e  /data/data/com.xxxxx.xxxxx/lib/libgame.so (Curl_resolv_timeout): Unable to locate routine information for address 31d39e in module /Users/xxxxx/Desktop/xxxxx/_projects/xxxxx/xxxxx/proj.android/obj/local/armeabi/libgame.so
Stack frame #05  pc 00329ea2  /data/data/com.xxxxx.xxxxx/lib/libgame.so (Curl_connect): Unable to locate routine information for address 329ea2 in module /Users/xxxxx/Desktop/xxxxx/_projects/xxxxx/xxxxx/proj.android/obj/local/armeabi/libgame.so

有没有办法从堆栈跟踪中获取更有意义的信息? 还是因为我使用的是编译为静态库的libcurl,而ndk-stack 找不到相关信息?

【问题讨论】:

  • 几天前刚刚遇到完全相同的问题。 ndk-stack 不是一个非常有用的解决方案 - 有时它会导致输出不佳。
  • 你找到更好的方法来anylayze堆栈跟踪了吗??

标签: android android-ndk stack-trace cocos2d-x


【解决方案1】:

您可以使用 VisualGDB ,使用 VisualGDB 您可以在 Visual Studio 中调试您的本机代码, 您必须在 Visual Studio 中安装 VisualGDB 插件,然后您可以将现有的 cocos2d-x Android Eclipse 项目导入到 Visual Studio。您可以查看以下链接

http://visualgdb.com/tutorials/android/

我已经在 VisualGDB 的帮助下将我的 cocos2d android 项目配置到了 Visual Studio,如果您遇到任何问题,请告诉我。

【讨论】:

    猜你喜欢
    • 2019-03-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-07
    • 1970-01-01
    相关资源
    最近更新 更多