Android libc.so crash?

只愿长相守 提交于 2019-11-30 02:30:39
Andrey Ermakov

You should use addr2line tool as described here and lookup these two addresses in your library to find what causes the crash:

#02  pc 00026558  /data/data/com.prattia.webs.testgfx5/lib/libandenginephysicsbox2dextension.so
#03  pc 00013e7c  /data/data/com.prattia.webs.testgfx5/lib/libandenginephysicsbox2dextension.so

So under Windows you should:

  1. Copy the library from device:

    adb pull /data/data/com.prattia.webs.testgfx5/lib/libandenginephysicsbox2dextension.so C:\
    
  2. Run addr2line tool for it using command line:

    cd %PATH_TO_YOUR_NDK%\toolchains\arm-linux-androideabi-4.4.3\prebuilt\linux-x86\bin
    arm-linux-androideabi-addr2line -C -f -e C:\libandenginephysicsbox2dextension.so
    
  3. Enter adress by adress:

    00026558 [ENTER]
    > here will be function name and line
    00013e7c [ENTER]
    > and again
    

Note: running this tool under Windows may give you less information than under Linux, so you may choose to install the distro as a virtual machine and follow instructions from the link to original answer above.

Update

Another (easier?) way is to use ndk-stack:

  1. As previously
  2. Save your dump into file. Let's call it 'dump.txt'.
  3. Run ndk-stack:

    cd %PATH_TO_YOUR_NDK%
    ndk-stack -sym C:\libandenginephysicsbox2dextension.so -dump C:\dump.txt
    

libc is experiencing a segmentation violation, almost certainly because andengine gave it a bad pointer. You probably don't have debug symbols for libc, but you can adb pull and objdump it to figure out what dynamic function is being given bad arguments. Or if your andengine library has debug symbols, you can track down the address there using the address to line tool.

You will have to figure out if it is a bug in what you are asking andengine to do, or if the bug is in andengine itself.

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