Repository navigation
Closed
Description
This was also issue in r10.
When using 64-bit ARM target on 64-bit device (e.g. Samsung Galaxy S6) and triggering segfault, while attempting to catch stack trace with adb logcat | ndk-stack -sym ./obj/local/arm64-v8a/, I get "File format not recognized" error:
$ adb logcat | ndk-stack -sym ./obj/local/arm64-v8a/
********** Crash dump: **********
Build fingerprint: 'samsung/zerofltexx/zeroflte:6.0.1/MMB29K/G920FXXU3DPB8:user/release-keys'
pid: 10952, tid: 11448, name: Recognition >>> com.microblink.test <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x18
Stack frame #00 pc 00000000000752cc /data/app/com.microblink.test-1/lib/arm64/libBlinkRecognizer.so (Java_com_microblink_recognition_NativeRecognizerWrapper_initNativeRecognizers+144): Routine ndk-stack: ./obj/local/arm64-v8a//libBlinkRecognizer.so: File format not recognized
When forcing the same crash on arm7 target on same device, I get much more information (note the source file and line numbers):
$ adb logcat | ndk-stack -sym ./obj/local/armeabi-v7a/
********** Crash dump: **********
Build fingerprint: 'samsung/zerofltexx/zeroflte:6.0.1/MMB29K/G920FXXU3DPB8:user/release-keys'
pid: 12211, tid: 12459, name: Recognition >>> com.microblink.test <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xc
Stack frame #00 pc 000371cc /data/app/com.microblink.test-2/lib/arm/libBlinkRecognizer.so (Java_com_microblink_recognition_NativeRecognizerWrapper_initNativeRecognizers+91): Routine Ref<protection::LicenseToken>::operator==(protection::LicenseToken const*) at /Users/dodo/Work/Microblink/android-core/core/CoreUtils/Source/Counted.hpp:191
Stack frame #01 pc 006f9e19 /data/app/com.microblink.test-2/oat/arm/base.odex (offset 0x4f1000) (long com.microblink.recognition.NativeRecognizerWrapper.initNativeRecognizers(long, long[], boolean, long)+140)
Stack frame #02 pc 006f9fbd /data/app/com.microblink.test-2/oat/arm/base.odex (offset 0x4f1000) (long com.microblink.recognition.NativeRecognizerWrapper.llIIlIlIIl(long, long[], boolean, long)+88)
Stack frame #03 pc 006f7981 /data/app/com.microblink.test-2/oat/arm/base.odex (offset 0x4f1000) (void com.microblink.recognition.NativeRecognizerWrapper$1.run()+1636)
Stack frame #04 pc 0373da47 /system/framework/arm/boot.oat (offset 0x2f1e000)
I would be nice if ndk-stack could work with 64-bit binaries, since in development I only build native code to match ABI target of connected device (i.e. when I plug in SGS6, my gradle script builds native code only for AMR64, thus not wasting time on building native code for all supported platforms).
Reacted by Kostiantyn Zghirovskyi, Trent and Aleksandr Zatsepin
Activity
slavasav commentedon Oct 10, 2016
Still the same problem with r13
silentnuke commentedon Jun 3, 2017
@DanAlbert is there any updates on that?
2 remaining items
enh commentedon Jun 3, 2017
i suspect the best way forward here is to kill the existing ndk-stack and switch to the "stack" script we use internally (suitably adjusted to work with the NDK rather than the platform tools). anyone good at python can probably take stack, stack_core.py, and symbol.py from https://android.googlesource.com/platform/development.git/+/master/scripts/ and send us the diff.
obviously if you're on Windows there's probably a bit more work involved, .
other than this regular expression (which doesn't seem like it would lead to the error folks are seeing)...
https://cs.corp.google.com/android/ndk/sources/host-tools/ndk-stack/ndk-stack-parser.c?l=74
...i took another look at ndk-stack and still don't see any obvious problem (unless somehow the libbfd it's linking against doesn't contain the LP64 arches, but i also didn't see where anything like that was configured).
anyway, anyone with a bit of time and some python ought to be able to switch us over to the platform tool (which even has tests!).
silentnuke commentedon Aug 1, 2017
@DanAlbert is there any updates on that?
DanAlbert commentedon Aug 1, 2017
No, unfortunately. We're still working on actually filling that new hire slot. It might happen in the r16 time frame, but almost certainly not for beta 1.
DoDoENT commentedon Aug 24, 2017
Any updates/progress on that? Have you filled a new hire slot? Are there any workarounds I could use until official fix comes? I currently have a stack trace reported by a client on 64-bit samsung device and I am unable to symbolificate it using
ndk-stack. Any help would be appreciated!enh commentedon Aug 24, 2017
see "anyone with a bit of time and some python ought to be able to switch us over to the platform tool (which even has tests!)" above. we should have someone starting next month, and what better introduction to the life than deleting ancient ndk-specific cruft and replacing it with the thing we use in the platform?
DanAlbert commentedon Aug 24, 2017
Yep, should be able to make this happen for r16.
rprichard commentedon Sep 25, 2017
FWIW: On my 64-bit Linux machine, ndk-stack already handles ARM64.
I see these lines in
build-ndk-stack.sh:I think the Linux
ndk-stackis being configured to work with host binaries, which are 64-bit. Maybe the 32-bit triplearm-linux-androideabiconfigures the macOSndk-stackto handle only 32-bit binaries, so changing the target (toaarch64-linux-android?) might fix this issue on macOS?I wonder about the Windows
ndk-stack.I'm still looking at replacing
ndk-stackwith the platformstackscript, though.DanAlbert commentedon Oct 5, 2017
Fix was merged into r16.
DanAlbert commentedon Mar 15, 2018
Yes.
Configure macOS ndk-stack for arm64 rather than arm32
luoqii commentedon Jan 8, 2019
cool!!!! r16 has fixed this.
hyUrbanManager commentedon May 16, 2019
r16b can do it