Enrico Casini
Enrico Casini

Reputation: 171

ndk-stack: Unable to open symbol file .../../libutil.so. Error (9): Bad file descriptor

I'm trying to use the ndk-stack utility to get some help during the debug of my app which is using native libraries. The problem is that all I get using the utility is this:

*** Crash dump: *** Build fingerprint: 'tmobile/htc_vision/vision:2.3.4/GRJ22/82286:user/ release-keys' pid: 15769, tid: 15794 >>> us.ihmc.aci.dsproapp <<< signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000024 Stack frame #00 pc 00063710 /data/data/us.ihmc.aci.dsproapp/lib/ libutil.so: Unable to open symbol file /home/enrico/CVSROOT/android/ aci/dsproapp/obj/local/armeabi/libutil.so. Error (9): Bad file descriptor

The command that I'm using is this:

ndk-stack -sym ../obj/local/armeabi -dump /home/enrico/stacktrace/crash_waypoint.txt

All my native libraries are compiled with

APP_OPTIM := debug APP_STL := gnustl_static

In the Application.mk, so the debug symbols should be present. Did anyone of you had this problem before? Thanks, Enrico

Upvotes: 6

Views: 4378

Answers (3)

Vaiden
Vaiden

Reputation: 16132

Happened to me while trying to debug a crash in my C code. Scratched my head over this for about 3 hours.

You're probably using the .so file from {project_root}/libs/arm*/. You should use the one fron {project_root}/obj/local/arm*/. This one has the symbolic information.

Upvotes: 4

user831170
user831170

Reputation:

I suppose

Your Application.mk should be like this :

APP_STL := gnustl_static
APP_ABI := armeabi
APP_OPTIM := debug

and your Android.mk should be like this :

LOCAL_CFLAGS    := -I <Your header files goes here>
LOCAL_CFLAGS    += -g
LOCAL_CFLAGS    += -ggdb
LOCAL_CFLAGS    += -O1

Upvotes: 1

Tary
Tary

Reputation: 1021

I have seen this error when the .so file is present but the file does not contain the symbolic imformation. My guess is that your file did not have the symbols generated for it.

Upvotes: 1

Related Questions