realm-java
realm-java copied to clipboard
App crash on startup when loading "librealm-jni.so" file.
How frequently does the bug occur?
All the time
Description
We've been running our application on many Android devices. Then one of the devices crashed on loading "librealm-jni.so" file at the app startup. Since then the app always crashes on the app startup on this device. The first call to Realm SDK is "Realm.init()". We get a native library stack trace when it crashes.
Stacktrace & log output
--------- beginning of crash
2022-04-07 11:59:48.829 2733-2733/com.epocal.epocnxs.release A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 2733 (epocnxs.release), pid 2733 (epocnxs.release)
2022-04-07 11:59:48.832 2382-2382/? I/ADB_SERVICES: for fd 79, revents = 10
2022-04-07 11:59:48.833 2382-2748/? I/ADB_SERVICES: post waitpid (pid=2747) status=0000
2022-04-07 11:59:48.891 2764-2764/? I/crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2022-04-07 11:59:48.892 533-533/? I//system/bin/tombstoned: received crash request for pid 2733
2022-04-07 11:59:48.894 2764-2764/? I/crash_dump64: performing dump of process 2733 (target tid = 2733)
2022-04-07 11:59:48.907 2764-2764/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2022-04-07 11:59:48.907 2764-2764/? A/DEBUG: Build fingerprint: 'AMobile/full_k62v1_64_bsp/k62v1_64_bsp:9/PPR1.180610.011/1615529741:user/test-keys'
2022-04-07 11:59:48.907 2764-2764/? A/DEBUG: Revision: '0'
2022-04-07 11:59:48.908 2764-2764/? A/DEBUG: ABI: 'arm64'
2022-04-07 11:59:48.908 2764-2764/? A/DEBUG: pid: 2733, tid: 2733, name: epocnxs.release >>> com.epocal.epocnxs.release <<<
2022-04-07 11:59:48.908 2764-2764/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
2022-04-07 11:59:48.908 2764-2764/? A/DEBUG: x0 0000000000000000 x1 0000000000000aad x2 0000000000000006 x3 0000000000000008
2022-04-07 11:59:48.908 2764-2764/? A/DEBUG: x4 fefefefefefeff63 x5 fefefefefefeff63 x6 fefefefefefeff63 x7 7f7f7f7f7f7f7f7f
2022-04-07 11:59:48.908 2764-2764/? A/DEBUG: x8 0000000000000083 x9 0000007215cb8b40 x10 fffffff87ffffbdf x11 0000000000000001
2022-04-07 11:59:48.908 2764-2764/? A/DEBUG: x12 0000000000000001 x13 ffffffffffffffff x14 0000000000000000 x15 ffffffffffffffff
2022-04-07 11:59:48.908 2764-2764/? A/DEBUG: x16 0000007215cf12c8 x17 0000007215c2f2d8 x18 000000002e383930 x19 0000000000000aad
2022-04-07 11:59:48.908 2764-2764/? A/DEBUG: x20 0000000000000aad x21 0000000000000083 x22 000000718a691e00 x23 000000718a69c9c0
2022-04-07 11:59:48.908 2764-2764/? A/DEBUG: x24 0000000000000000 x25 00000072186e75e0 x26 000000000123ff78 x27 0000007fc7710b08
2022-04-07 11:59:48.908 2764-2764/? A/DEBUG: x28 0000000000000000 x29 0000007fc770e3c0
2022-04-07 11:59:48.908 2764-2764/? A/DEBUG: sp 0000007fc770e380 lr 0000007215c23a90 pc 0000007215c23abc
2022-04-07 11:59:49.077 2764-2764/? A/DEBUG: backtrace:
2022-04-07 11:59:49.077 2764-2764/? A/DEBUG: #00 pc 0000000000021abc /system/lib64/libc.so (abort+124)
2022-04-07 11:59:49.077 2764-2764/? A/DEBUG: #01 pc 0000000000243cb4 /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/lib/arm64/librealm-jni.so (__gnu_cxx::__verbose_terminate_handler()+348)
2022-04-07 11:59:49.077 2764-2764/? A/DEBUG: #02 pc 0000000000217400 /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/lib/arm64/librealm-jni.so (__cxxabiv1::__terminate(void (*)())+8)
2022-04-07 11:59:49.077 2764-2764/? A/DEBUG: #03 pc 0000000000243980 /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/lib/arm64/librealm-jni.so
2022-04-07 11:59:49.077 2764-2764/? A/DEBUG: #04 pc 0000000000216c84 /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/lib/arm64/librealm-jni.so (__gxx_personality_v0+192)
2022-04-07 11:59:49.077 2764-2764/? A/DEBUG: #05 pc 0000000000258238 /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/lib/arm64/librealm-jni.so
2022-04-07 11:59:49.077 2764-2764/? A/DEBUG: #06 pc 0000000000258750 /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/lib/arm64/librealm-jni.so (_Unwind_Resume+116)
2022-04-07 11:59:49.077 2764-2764/? A/DEBUG: #07 pc 000000000012786c /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/lib/arm64/librealm-jni.so
2022-04-07 11:59:49.077 2764-2764/? A/DEBUG: #08 pc 0000000000127e48 /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/lib/arm64/librealm-jni.so
2022-04-07 11:59:49.077 2764-2764/? A/DEBUG: #09 pc 0000000000126cd8 /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/lib/arm64/librealm-jni.so
2022-04-07 11:59:49.077 2764-2764/? A/DEBUG: #10 pc 0000000000126d3c /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/lib/arm64/librealm-jni.so
2022-04-07 11:59:49.077 2764-2764/? A/DEBUG: #11 pc 00000000001a447c /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/lib/arm64/librealm-jni.so
2022-04-07 11:59:49.077 2764-2764/? A/DEBUG: #12 pc 00000000000ec978 /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/lib/arm64/librealm-jni.so
2022-04-07 11:59:49.077 2764-2764/? A/DEBUG: #13 pc 00000000000ed3f0 /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/lib/arm64/librealm-jni.so
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #14 pc 0000000000109d58 /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/lib/arm64/librealm-jni.so
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #15 pc 00000000000eaba8 /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/lib/arm64/librealm-jni.so
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #16 pc 000000000006e938 /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/lib/arm64/librealm-jni.so (Java_io_realm_internal_OsSharedRealm_nativeGetSharedRealm+480)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #17 pc 00000000001911c4 /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/oat/arm64/base.odex (offset 0x188000) (io.realm.internal.OsObjectSchemaInfo.nativeGetProperty [DEDUPED]+180)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #18 pc 00000000006244e8 /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/oat/arm64/base.odex (offset 0x188000) (io.realm.internal.OsSharedRealm.<init>+840)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #19 pc 00000000005b3548 /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/oat/arm64/base.odex (offset 0x188000) (io.realm.RealmCache.doCreateRealmOrGetFromCache+840)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #20 pc 0000000000606e48 /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/oat/arm64/base.odex (offset 0x188000) (io.realm.Realm.getDefaultInstance+424)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #21 pc 00000000005a2b7c /data/app/com.epocal.epocnxs.release-0o4Co_NQrw11w7XQTYzFpw==/oat/arm64/base.odex (offset 0x188000) (com.epocal.host4.init.App.onCreate+1804)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #22 pc 00000000007aed74 /system/framework/arm64/boot-framework.oat (offset 0x3f7000) (android.app.Instrumentation.callApplicationOnCreate+52)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #23 pc 00000000008cf844 /system/framework/arm64/boot-framework.oat (offset 0x3f7000) (android.app.ActivityThread.handleBindApplication+7396)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #24 pc 00000000008ca468 /system/framework/arm64/boot-framework.oat (offset 0x3f7000) (android.app.ActivityThread$H.handleMessage+6408)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #25 pc 0000000000b194d4 /system/framework/arm64/boot-framework.oat (offset 0x3f7000) (android.os.Handler.dispatchMessage+180)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #26 pc 0000000000b1c5d0 /system/framework/arm64/boot-framework.oat (offset 0x3f7000) (android.os.Looper.loop+1264)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #27 pc 00000000008d6e90 /system/framework/arm64/boot-framework.oat (offset 0x3f7000) (android.app.ActivityThread.main+720)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #28 pc 000000000055d04c /system/lib64/libart.so (art_quick_invoke_static_stub+604)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #29 pc 00000000000cf760 /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+232)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #30 pc 00000000004633b8 /system/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #31 pc 0000000000464e10 /system/lib64/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1440)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #32 pc 00000000003f43b0 /system/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+48)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #33 pc 00000000001276d4 /system/framework/arm64/boot.oat (offset 0x11d000) (java.lang.Class.getDeclaredMethodInternal [DEDUPED]+180)
2022-04-07 11:59:49.078 2382-2382/? I/ADB_SERVICES: local_socket_flush_outgoing read_data=70431
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #34 pc 0000000000c60c98 /system/framework/arm64/boot-framework.oat (offset 0x3f7000) (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+136)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #35 pc 0000000000c681b8 /system/framework/arm64/boot-framework.oat (offset 0x3f7000) (com.android.internal.os.ZygoteInit.main+3144)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #36 pc 000000000055d04c /system/lib64/libart.so (art_quick_invoke_static_stub+604)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #37 pc 00000000000cf760 /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+232)
2022-04-07 11:59:49.078 2764-2764/? A/DEBUG: #38 pc 00000000004633b8 /system/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
2022-04-07 11:59:49.079 2764-2764/? A/DEBUG: #39 pc 0000000000463010 /system/lib64/libart.so (art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+416)
2022-04-07 11:59:49.079 2764-2764/? A/DEBUG: #40 pc 0000000000366844 /system/lib64/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+644)
2022-04-07 11:59:49.079 2764-2764/? A/DEBUG: #41 pc 00000000000b38f0 /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+120)
2022-04-07 11:59:49.079 2764-2764/? A/DEBUG: #42 pc 00000000000b62ec /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+884)
2022-04-07 11:59:49.079 2764-2764/? A/DEBUG: #43 pc 00000000000021a0 /system/bin/app_process64 (main+1200)
2022-04-07 11:59:49.079 2764-2764/? A/DEBUG: #44 pc 00000000000ae780 /system/lib64/libc.so (__libc_init+88)
Can you reproduce the bug?
Yes, always
Reproduction Steps
It only happens on one device. There is no hardware issue on this device.
Version
"io.realm:realm-gradle-plugin:4.2.0"
What SDK flavour are you using?
Local Database only
Are you using encryption?
Yes, using encryption
Platform OS and version(s)
Windows 10 Enterprise Version 20H2.
Build environment
Android Studio 4.1.2 'com.android.tools.build:gradle:3.1.4'
@yakitabrunet Thanks for reporting this and sorry for the late reply! Which device is this occurring on?
@bmunkholm It's on AMobile PD470SH. Here's hardware spec.
OS: Android 9 Manufacture: AMobile (https://www.amobile-solutions.com/) Model: PD470SH CPU: MediaTek MT6762 8 Cortex-4 A53 2.0 GHz/4 A53 1.5 GHz Dimensions: 160mm (H) x 76 mm (W) x 22 mm(D) Display: 5.0 in Resolution: 1280 x 720 Memory: 2 GB RAM, 16 GB flash WLAN: 802.11 a/b/g/n/ac/r (2.4 GHz and 5 GHz) NFC: ISO 14443 Type A/B, FeliCa, MIFARE USB: USB 2.0 Type C micro SD slot Front camera : 5 megapixel Rear camera 13 megapixel Integrated 1D/2D bar-code imager Zebra SE4710 Battery: 4000 mAh
@yakitabrunet Thanks for the update.
- You say "it started crashing". Does that mean it didn't used to crash, but now it does?
- Have you ever been able to run the application on this device before without it crashing?
- Are you deleting the application completely before restarting the application?
- And then it crashes at first attempt to relaunch?
@bmunkholm Here are the answers to your questions.
-
You say "it started crashing". Does that mean it didn't used to crash, but now it does? Yes.
-
Have you ever been able to run the application on this device before without it crashing? Yes.
-
Are you deleting the application completely before restarting the application? No. The application is terminated, but not deleted (not un-installed). (We need to keep the database file for the application between the app restart.)
-
And then it crashes at first attempt to relaunch? No. Our app automatically starts after the device reboot (power off --> power on --> boot complete --> app starts) The app was able to restart after the device reboot numerous times, since the app installation. Then one day, the app crashed upon the device reboot. Since the first crash, the app always crashes upon relaunch (started by the device reboot, or started manually by pressing the app icon.)
I am seeing identical behavior to this across a number of devices in production. Users are fine for some time - initially multiple weeks, and then enter into this permanent crash loop.
I don't know if I'm being alarmist because I'm kinda up shit creek right now, but I imagine this is happening with a ton of users and many developers don't know - these crashes don't come through to Crashlytics, and will only be visible inside of the Play Store's release dashboard.
I believe the swath of native crashes that have started this year need urgent attention from the Realm team.
➤ Clemente Tort Barbero commented:
You are using version 4.2.0, could you please try a more recent one? This issue might have already been fixed.
@yakitabrunet Closing as the issue is reported against a very old version. Please try to update to the latest version and re-file an issue if you observe something similar.