Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ndk-stack not working

Tags:

I am invoking ndk-stack as follows:

cat file_temp | ~/workspace/android-ndk-r6b/ndk-stack -sym /home/xyz/trunk/apk/obj/local/armeabi/

It finds the crash fingerprint but fails to show me the stack analysis. The error printed is:

ndk-stack: elff/elf_file.cc:102: static ElfFile* ElfFile::Create(const char*): Assertion `read_bytes != -1 && read_bytes == sizeof(header)' failed. Stack frame #00  pc 43121300  Aborted

Any ideas?

Thanks.

like image 374
user1058600 Avatar asked Nov 21 '11 21:11

user1058600


1 Answers

This is the ndk-stack program being unable to read the unstripped version of your shared libraries.

The specific crash occurs because a file exists matching the module name, but it's not large enough to contain an ELF header.

Things to do:

  1. Check that the files contained in the directory supplied via -sym are correct (and not truncated).

  2. Remove truncated files or files smaller than a few hundred bytes.

If you're curious, the source code for ndk-stack is in the android source tree under ndk/sources/host-tools/ndk-stack

like image 58
Michael O Avatar answered Sep 19 '22 18:09

Michael O