Project

General

Profile

Bug #1704

SIGSEV in libcrystax on x86

Added by Andrew Twyman over 3 years ago. Updated over 3 years ago.

Status:
Open
Priority:
High
Category:
libcrystax
Target version:
Start date:
02/16/2017
Due date:
% Done:

0%

Estimated time:
CPU Architecture:
x86
Host OS:
OS X
Toolchain:
gcc-4.9
Android version:
5.0 (android-21), 7.0 (android-24)
CrystaX Version:

Description

For context: I'm giving the CrystaX NDK a try on our cross-platform C++ code at Dropbox, previously built with NDK r11c, GCC 4.9, with GNU STL. I've reported my compile-time issues separately, but worked around them, and added libcrystax.so to our app to get it to load. It runs fine on armv7a on a device (Nexus 7), but on an x86 emulator (API 24). libcrystax itself loads successfully, but the load of my own libdropboxsync which depends on it crashes. There's no useful stack trace info other than stack frames all in libcrystax, which I've pasted below.

The .so I packaged for x86 came directly from sources/crystax/libs/x86/libcrystax.so, which I presume is the right one. Note that we have a custom system for deploying/loading native libraries, which stores the libraries in assets with unique names, and unpacks them before loading them explicitly. (This was built years ago to to work around upgrade problems, in the Android OS, similar to ReLinker which is an open-source solution to a similar problem.) I'm suspicious that the renaming of the library and repackaging could be to blame here, but the fact that everything works fine on ARM using the same system makes that unclear.

Is there anything useful you can gleam from the stack trace here? Note I'm launching from Android Studio 2.2.2, building in debug mode, with minSdkVersion 21 and targetSdkVersion 24. Let me know if I can provide any more info.

02-15 22:56:50.131 3402-3402/? I/com.dropbox.android.util.nativelib.NativeLibraryLoader: Loading /data/user/0/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.134 3418-3439/com.dropbox.android:crash_uploader D/com.dropbox.android.exception.CrashUploaderService: Started the uploader service
02-15 22:56:50.134 3418-3439/com.dropbox.android:crash_uploader D/com.dropbox.android.exception.CrashUploader: Looking for stack traces
02-15 22:56:50.134 3402-3402/? I/com.dropbox.android.util.nativelib.NativeLibraryLoader: Extracting /data/user/0/com.dropbox.android/files/extracted_libs/lib_dbxfileobserver_b492ffd532b8b6365d97439f842c164c3c90fd4e_x86
02-15 22:56:50.137 3418-3439/com.dropbox.android:crash_uploader D/com.dropbox.android.exception.CrashUploader: No stacktraces.
02-15 22:56:50.140 3402-3402/? I/com.dropbox.android.util.nativelib.NativeLibraryLoader: Loading /data/user/0/com.dropbox.android/files/extracted_libs/lib_dbxfileobserver_b492ffd532b8b6365d97439f842c164c3c90fd4e_x86
02-15 22:56:50.147 3402-3402/? I/com.dropbox.android.util.nativelib.NativeLibraryLoader: Extracting /data/user/0/com.dropbox.android/files/extracted_libs/lib_dropboxsync_da96c984fe63861df6a8358482733f65_x86
02-15 22:56:50.304 3402-3402/? I/com.dropbox.android.util.nativelib.NativeLibraryLoader: Loading /data/user/0/com.dropbox.android/files/extracted_libs/lib_dropboxsync_da96c984fe63861df6a8358482733f65_x86
02-15 22:56:50.319 3402-3402/? A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0xbf25dff0 in tid 3402 (dropbox.android)

                                       [ 02-15 22:56:50.320  1214: 1214 W/         ]
                                       debuggerd: handling request: pid=3402 uid=10062 gid=10062 tid=3402
02-15 22:56:50.309 3441-3441/? W/debuggerd: type=1400 audit(0.0:13): avc: denied { search } for name="com.dropbox.android" dev="vdc" ino=21263 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
02-15 22:56:50.309 3441-3441/? W/debuggerd: type=1400 audit(0.0:14): avc: denied { search } for name="com.dropbox.android" dev="vdc" ino=21263 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
02-15 22:56:50.319 3441-3441/? W/debuggerd: type=1400 audit(0.0:15): avc: denied { search } for name="com.dropbox.android" dev="vdc" ino=21263 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
02-15 22:56:50.319 3441-3441/? W/debuggerd: type=1400 audit(0.0:16): avc: denied { search } for name="com.dropbox.android" dev="vdc" ino=21263 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
02-15 22:56:50.376 3441-3441/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-15 22:56:50.376 3441-3441/? A/DEBUG: Build fingerprint: 'Android/sdk_phone_x86/generic_x86:7.0/NYC/3245079:userdebug/test-keys'
02-15 22:56:50.376 3441-3441/? A/DEBUG: Revision: '0'
02-15 22:56:50.376 3441-3441/? A/DEBUG: ABI: 'x86'
02-15 22:56:50.376 3441-3441/? A/DEBUG: pid: 3402, tid: 3402, name: dropbox.android  >>> com.dropbox.android <<<
02-15 22:56:50.377 3441-3441/? A/DEBUG: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xbf25dff0
02-15 22:56:50.377 3441-3441/? A/DEBUG:     eax 00000000  ebx 8dcd3438  ecx 00000000  edx 00001f80
02-15 22:56:50.377 3441-3441/? A/DEBUG:     esi bf25e004  edi 8da1f2e0
02-15 22:56:50.377 3441-3441/? A/DEBUG:     xcs 00000073  xds 0000007b  xes 0000007b  xfs 0000003b  xss 0000007b
02-15 22:56:50.377 3441-3441/? A/DEBUG:     eip 8dca7746  ebp 8da212e0  esp bf25dff0  flags 00010282
02-15 22:56:50.380 3441-3441/? A/DEBUG: backtrace:
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #00 pc 00087746  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #01 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #02 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #03 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #04 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #05 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #06 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #07 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #08 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #09 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #10 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #11 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #12 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #13 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #14 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #15 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #16 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #17 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #18 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #19 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #20 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #21 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #22 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #23 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #24 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #25 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #26 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #27 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #28 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #29 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #30 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #31 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #32 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #33 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #34 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #35 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #36 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #37 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #38 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #39 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #40 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #41 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #42 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #43 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #44 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #45 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #46 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #47 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #48 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #49 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #50 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #51 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #52 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.380 3441-3441/? A/DEBUG:     #53 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.381 3441-3441/? A/DEBUG:     #54 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.381 3441-3441/? A/DEBUG:     #55 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.381 3441-3441/? A/DEBUG:     #56 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.381 3441-3441/? A/DEBUG:     #57 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.381 3441-3441/? A/DEBUG:     #58 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.381 3441-3441/? A/DEBUG:     #59 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.381 3441-3441/? A/DEBUG:     #60 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.381 3441-3441/? A/DEBUG:     #61 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.381 3441-3441/? A/DEBUG:     #62 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86
02-15 22:56:50.381 3441-3441/? A/DEBUG:     #63 pc 0008775d  /data/data/com.dropbox.android/files/extracted_libs/lib_crystax_100302_x86

Also available in: Atom PDF