Native crash on Android tgkill

topbktopbk AUMember ✭✭

Hi Guys,

I have an Android app built on Xamarin Form Cross Platform. It is working fine except it has crash some time which I can't figure it out.
This is what I can find from Play Console.

#00 pc 000000000004acf4 /system/lib/ (tgkill+12)
#01 pc 0000000000048493 /system/lib/ (pthread_kill+34)
#02 pc 000000000001d5c1 /system/lib/ (raise+10)
#03 pc 00000000000190a1 /system/lib/ (__libc_android_abort+34)
#04 pc 0000000000017104 /system/lib/ (abort+4)
#05 pc 000000000029cc6c /data/app/com.topbookkeeper.topbk-2/lib/arm/

Appreciate if anyone can give an idea.



  • robbitrobbit CNMember Xamurai

    You need use addr2line to translate the number to line to get more accurate error.

    I found this for you.

  • topbktopbk AUMember ✭✭

    Hi Mate,
    Thanks for your reply. I'm completely lost. how can I install addr2line in my PC (win 10)? I did not find any article explaining it.

  • robbitrobbit CNMember Xamurai

    In the answer, you can find:

    I'm using NDK r5, so the executable I'm using is located at $NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin; make sure that is in your $PATH. The command to use looks like

    The addr2line's path is your ndk's path+/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin.

    You can find the NDK path by this document.

    And I have found a article to introduce addr2line.

  • topbktopbk AUMember ✭✭

    Hi Mate,

    Really appreciate your help.

    addr2line is locate as below.

    and I set the environment path

    but where do I need to run this command? is it in Command prompt?

  • robbitrobbit CNMember Xamurai
    edited August 2018

    Or you can use ndk-stack to get the crash.

    Firstly, use adb command to catch the crash into foo.txt file:

    adb logcat > /tmp/foo.txt

    If you want to run this command in cmd, you need add the adb into your pc environment path. And you can replace the path /tmp/foo.txt to yourself path like D:\foo.txt.

    Then the cmd window will get into waiting state. And then you can run you app, and the adb logcat will catch your crash and write it into D:\foo.txt. You can check the foo.txt.

    Secondly, use ndk-stack tool to profile the crash, open a new cmd window to run below command:

    $NDK/ndk-stack -sym $PROJECT_PATH/obj/local/armeabi -dump foo.txt

    About $NDK, it is your NDK's location, and the $PROJECT_PATH/obj/local/armeabi, you need find your .so file's location, and replace it.

  • topbktopbk AUMember ✭✭

    Hi Mate,

    I have set up ndk-stack.exe but the issue is how to find .so file. based on the error I need to look for "" file. My project is in Visual Studio 2017 with Xamarine Form cross-platform app. I did the file search on my project folder but I can't find this file.

  • topbktopbk AUMember ✭✭

    I'm really stuck. I need to know the location of file then I can run ndk-stack.exe

  • I have the same issue, with the same backtrace. Did you find a solution?



  • topbktopbk AUMember ✭✭

    Unfortunately, no

    I'm still struggling.

  • sethnsethn Member ✭✭

    Saw somewhere else that to get the so file, you need to unzip the apk file and it is in there. I tried doing this method and I have been able to read the dump file with ndk-stack. This actually didn't have anything useful for me, turned out my problem was fixed just by updating my visual studio.

Sign In or Register to comment.