Note that there are some explanatory texts on larger screens.

plurals
  1. POstack traces stop before getting to my code (on Android using NDK)
    primarykey
    data
    text
    <p>I'm developing on Android 2.3.x using NDK r5b. Occasionally my code crashes and I'd like to know where. I already know how to get the corresponding line in my application when I have a have a pointer (i.e. from Android's stack traces.)</p> <p>However, oftentimes I see useless stack traces like this (full stack trace):</p> <pre><code> #00 pc 0006561a /system/lib/egl/libGLESv2_adreno200.so #01 pc 0006b900 /system/lib/egl/libGLESv2_adreno200.so #02 pc 0005aac8 /system/lib/egl/libGLESv2_adreno200.so #03 pc 0001687a /system/lib/egl/libGLESv1_CM_adreno200.so #04 pc 000096ce /system/lib/egl/libGLESv1_CM_adreno200.so </code></pre> <p>or this:</p> <pre><code>(gdb) bt #0 0xafd0c51c in epoll_wait () from /Volumes/SecureCode/webos/rta/android/obj/local/armeabi/libc.so #1 0xa81216a6 in ?? () </code></pre> <p>that don't even mention my code at all.</p> <p>Is there any way at all to get better stack traces than this? Why are some library functions "opaque" in that they don't allow the backtrace to "see through" to the calling function, causing a stop in the stack trace?</p> <p>As far as I can tell, the only way to debug a problem like this is to use logging at each point in the program and/or step through each line with gdb.</p> <p>Are there ROMs available with debug versions of these Android libraries instead of runtime ones, and would that help? (I use one phone solely for development, so I'm not concerned about keeping full functionality.) (<em><strong>Actually</strong></em>, I noticed that the path to <code>libc.so</code> in the above <code>gdb</code> stack trace is within my application directory. Could I possibly just package it with a different (debug) <code>libc.so</code>, and would that help?)</p> <p>One last thing that might help: in the above stack trace from logcat (the first one,) my library is mentioned in the raw stack dump:</p> <pre><code>stack: ... ... 4471cb88 00000028 4471cb8c afd4649c 4471cb90 80b4eb71 /data/data/com.audia.dev.rta/lib/librta.so 4471cb94 00299180 ... ... </code></pre> <p>but that is not a function pointer. What could that be, and would it be of any help after the app has crashed? I'm guessing probably not if it's a heap pointer or something like that.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload