objectbox / objectbox-java

Android Database - first and fast, lightweight on-device vector database
https://objectbox.io
Apache License 2.0
4.39k stars 302 forks source link

[split_config.arm64_v8a.apk!libobjectbox-jni.so] Java_io_objectbox_query_Query_nativeFind #1147

Open jobernolte opened 1 year ago

jobernolte commented 1 year ago

Describe the bug Some of our users experience crashes of our App caused by the ObjectBox library. This is a follow up report to https://github.com/objectbox/objectbox-java/issues/1131

Basic info (please complete the following information):

To Reproduce not applicable

Expected behavior The App should not crash ;)

Logs, stack traces

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 9116 >>> com.elogames.app <<<

backtrace:
  #00  pc 0x000000000013ad98  /data/app/~~W2BhjsM0UKtJwGy4rjk51A==/com.elogames.app-Grauq7pIpDBoNE67XGqjNQ==/split_config.arm64_v8a.apk!libobjectbox-jni.so
  #01  pc 0x00000000000b58dc  /data/app/~~W2BhjsM0UKtJwGy4rjk51A==/com.elogames.app-Grauq7pIpDBoNE67XGqjNQ==/split_config.arm64_v8a.apk!libobjectbox-jni.so (Java_io_objectbox_query_Query_nativeFind+2572)
  #02  pc 0x000000000021e494  /data/app/~~W2BhjsM0UKtJwGy4rjk51A==/com.elogames.app-Grauq7pIpDBoNE67XGqjNQ==/oat/arm64/base.odex (art_jni_trampoline+116)
  #03  pc 0x000000000020b02c  /apex/com.android.art/lib64/libart.so (nterp_helper+7468)
  #04  pc 0x00000000036b31fa  /data/app/~~W2BhjsM0UKtJwGy4rjk51A==/com.elogames.app-Grauq7pIpDBoNE67XGqjNQ==/oat/arm64/base.vdex (io.objectbox.query.Query.lambda$find$2$io-objectbox-query-Query+22)
  #05  pc 0x000000000020a254  /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
  #06  pc 0x00000000036b1190  /data/app/~~W2BhjsM0UKtJwGy4rjk51A==/com.elogames.app-Grauq7pIpDBoNE67XGqjNQ==/oat/arm64/base.vdex (io.objectbox.query.Query$$ExternalSyntheticLambda4.call+4)
  #07  pc 0x000000000020b074  /apex/com.android.art/lib64/libart.so (nterp_helper+7540)
  #08  pc 0x000000000369cb3e  /data/app/~~W2BhjsM0UKtJwGy4rjk51A==/com.elogames.app-Grauq7pIpDBoNE67XGqjNQ==/oat/arm64/base.vdex (io.objectbox.BoxStore.callInReadTx+42)
  #09  pc 0x000000000020a254  /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
  #10  pc 0x000000000369cc3e  /data/app/~~W2BhjsM0UKtJwGy4rjk51A==/com.elogames.app-Grauq7pIpDBoNE67XGqjNQ==/oat/arm64/base.vdex (io.objectbox.BoxStore.callInReadTxWithRetry+6)
  #11  pc 0x000000000020a254  /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
  #12  pc 0x00000000036b3070  /data/app/~~W2BhjsM0UKtJwGy4rjk51A==/com.elogames.app-Grauq7pIpDBoNE67XGqjNQ==/oat/arm64/base.vdex (io.objectbox.query.Query.callInReadTx+20)
  #13  pc 0x000000000020a254  /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
  #14  pc 0x00000000036b318e  /data/app/~~W2BhjsM0UKtJwGy4rjk51A==/com.elogames.app-Grauq7pIpDBoNE67XGqjNQ==/oat/arm64/base.vdex (io.objectbox.query.Query.find+10)
  #15  pc 0x000000000020a254  /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
  #16  pc 0x00000000036b2822  /data/app/~~W2BhjsM0UKtJwGy4rjk51A==/com.elogames.app-Grauq7pIpDBoNE67XGqjNQ==/oat/arm64/base.vdex (io.objectbox.query.QueryPublisher.run+102)
  #17  pc 0x00000000001ea68c  /system/framework/arm64/boot.oat (java.util.concurrent.Executors$RunnableAdapter.call+76)
  #18  pc 0x00000000002985ec  /system/framework/arm64/boot.oat (java.util.concurrent.FutureTask.run+188)
  #19  pc 0x0000000000308ed0  /system/framework/arm64/boot.oat (java.util.concurrent.ThreadPoolExecutor.runWorker+976)
  #20  pc 0x00000000003060b8  /system/framework/arm64/boot.oat (java.util.concurrent.ThreadPoolExecutor$Worker.run+72)
  #21  pc 0x000000000017f210  /system/framework/arm64/boot.oat (java.lang.Thread.run+80)
  #22  pc 0x0000000000457b6c  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+556)
  #23  pc 0x0000000000484e54  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+156)
  #24  pc 0x0000000000484b20  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+400)
  #25  pc 0x00000000005ce3a0  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1684)
  #26  pc 0x00000000000b6668  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208)
  #27  pc 0x00000000000532cc  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
greenrobot-team commented 1 year ago

Thanks for reporting! It's odd as this should have thrown a Java exception. I passed this on to the team.

Internal issue objectbox/objectbox-java#181

greenrobot-team commented 1 year ago

@jobernolte Do you have any additional error logs associated to that crash? Any additional details would help.

jobernolte commented 1 year ago

There's only one crash showing up on Crashlytics. But I think this is a different problem.

Fatal Exception: java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider: androidx.startup.StartupException: java.lang.LinkageError: [ObjectBox] Android failed to load native library, check your APK/App Bundle includes a supported ABI or use ReLinker https://docs.objectbox.io/android/app-bundle-and-split-apk (vendor=The Android Project,os=linux,os.arch=x86_64,SUPPORTED_ABIS=[x86_64, arm64-v8a, x86, armeabi-v7a, armeabi])
       at android.app.ActivityThread.installProvider(ActivityThread.java:7464)
       at android.app.ActivityThread.installContentProviders(ActivityThread.java:6976)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6747)
       at android.app.ActivityThread.access$1500(ActivityThread.java:256)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2091)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:201)
       at android.os.Looper.loop(Looper.java:288)
       at android.app.ActivityThread.main(ActivityThread.java:7870)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
greenrobot-team commented 1 year ago

@jobernolte I mean like actual log output, e.g. what would be seen in Logcat, related to the error. Though if I remember correctly, Crashlytics can't collect the Android log output.

jobernolte commented 1 year ago

Unfortunately this is not possible, as we do not use any other framework to collect crashes and logcat information at the same time (eg Instabug).

15915763299 commented 1 week ago

I have the same problem. When my app is launching and go into homepage, launch some query then crash. It is the same user, crash many times.

0 | #00 pc 00000000001004c4 /data/app/com.jglive.xinlian-TtVL4Y1pVgOfBpLuWFVJsg==/lib/arm64/libobjectbox-jni.so
1 | #01 pc 00000000000b3a08 /data/app/com.jglive.xinlian-TtVL4Y1pVgOfBpLuWFVJsg==/lib/arm64/libobjectbox-jni.so (Java_io_objectbox_query_Query_nativeFind+2512)
2 | #02 pc 00000000005625e4 /system/lib64/libart.so
3 | #03 pc 000000000055958c /system/lib64/libart.so
4 | #04 pc 00000000000b160c /system/lib64/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+204)
5 | #05 pc 0000000000265efc /system/lib64/libart.so (_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPNS_11ShadowFrameEtPNS_6JValueE+348)
6 | #06 pc 0000000000261028 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb1ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+752)
7 | #07 pc 00000000005223d4 /system/lib64/libart.so (MterpInvokeVirtualRange+580)
8 | #08 pc 000000000054bf18 /system/lib64/libart.so (ExecuteMterpImpl+15000)
9 | #09 pc 0000000000239c08 /system/lib64/libart.so
10 | #10 pc 000000000023f6fc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadERKNS_20CodeItemDataAccessorEPNS_11ShadowFrameEPNS_6JValueE+220)
11 | #11 pc 000000000025fee8 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+944)
12 | #12 pc 0000000000521ee8 /system/lib64/libart.so (MterpInvokeDirect+300)
13 | #13 pc 000000000054bd18 /system/lib64/libart.so (ExecuteMterpImpl+14488)
14 | #14 pc 0000000000239c08 /system/lib64/libart.so
15 | #15 pc 000000000023f6fc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadERKNS_20CodeItemDataAccessorEPNS_11ShadowFrameEPNS_6JValueE+220)
16 | #16 pc 000000000025fee8 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+944)
17 | #17 pc 00000000005220ac /system/lib64/libart.so (MterpInvokeStatic+208)
18 | #18 pc 000000000054bd98 /system/lib64/libart.so (ExecuteMterpImpl+14616)
19 | #19 pc 0000000000239c08 /system/lib64/libart.so
20 | #20 pc 000000000023f6fc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadERKNS_20CodeItemDataAccessorEPNS_11ShadowFrameEPNS_6JValueE+220)
21 | #21 pc 000000000025fee8 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+944)
22 | #22 pc 0000000000521960 /system/lib64/libart.so (MterpInvokeInterface+948)
23 | #23 pc 000000000054be18 /system/lib64/libart.so (ExecuteMterpImpl+14744)
24 | #24 pc 0000000000239c08 /system/lib64/libart.so
25 | #25 pc 000000000023f6fc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadERKNS_20CodeItemDataAccessorEPNS_11ShadowFrameEPNS_6JValueE+220)
26 | #26 pc 000000000025fee8 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+944)
27 | #27 pc 0000000000520ba4 /system/lib64/libart.so (MterpInvokeVirtual+592)
28 | #28 pc 000000000054bc18 /system/lib64/libart.so (ExecuteMterpImpl+14232)
29 | #29 pc 0000000000239c08 /system/lib64/libart.so
30 | #30 pc 000000000023f6fc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadERKNS_20CodeItemDataAccessorEPNS_11ShadowFrameEPNS_6JValueE+220)
31 | #31 pc 000000000025fee8 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+944)
32 | #32 pc 0000000000520ba4 /system/lib64/libart.so (MterpInvokeVirtual+592)
33 | #33 pc 000000000054bc18 /system/lib64/libart.so (ExecuteMterpImpl+14232)
34 | #34 pc 0000000000239c08 /system/lib64/libart.so
35 | #35 pc 000000000023f6fc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadERKNS_20CodeItemDataAccessorEPNS_11ShadowFrameEPNS_6JValueE+220)
36 | #36 pc 000000000025fee8 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+944)
37 | #37 pc 0000000000520ba4 /system/lib64/libart.so (MterpInvokeVirtual+592)
38 | #38 pc 000000000054bc18 /system/lib64/libart.so (ExecuteMterpImpl+14232)
39 | #39 pc 0000000000239c08 /system/lib64/libart.so
40 | #40 pc 000000000023f6fc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadERKNS_20CodeItemDataAccessorEPNS_11ShadowFrameEPNS_6JValueE+220)
41 | #41 pc 000000000025fee8 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+944)
42 | #42 pc 0000000000520ba4 /system/lib64/libart.so (MterpInvokeVirtual+592)
43 | #43 pc 000000000054bc18 /system/lib64/libart.so (ExecuteMterpImpl+14232)
44 | #44 pc 0000000000239c08 /system/lib64/libart.so
45 | #45 pc 000000000023f6fc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadERKNS_20CodeItemDataAccessorEPNS_11ShadowFrameEPNS_6JValueE+220)
46 | #46 pc 000000000025fee8 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+944)
47 | #47 pc 0000000000520ba4 /system/lib64/libart.so (MterpInvokeVirtual+592)
48 | #48 pc 000000000054bc18 /system/lib64/libart.so (ExecuteMterpImpl+14232)
49 | #49 pc 0000000000239c08 /system/lib64/libart.so
50 | #50 pc 000000000023f6fc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadERKNS_20CodeItemDataAccessorEPNS_11ShadowFrameEPNS_6JValueE+220)
51 | #51 pc 000000000025fee8 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+944)
52 | #52 pc 00000000005220ac /system/lib64/libart.so (MterpInvokeStatic+208)
53 | #53 pc 000000000054bd98 /system/lib64/libart.so (ExecuteMterpImpl+14616)
54 | #54 pc 0000000000239c08 /system/lib64/libart.so
55 | #55 pc 000000000023f6fc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadERKNS_20CodeItemDataAccessorEPNS_11ShadowFrameEPNS_6JValueE+220)
56 | #56 pc 000000000025fee8 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+944)
57 | #57 pc 0000000000520ba4 /system/lib64/libart.so (MterpInvokeVirtual+592)
58 | #58 pc 000000000054bc18 /system/lib64/libart.so (ExecuteMterpImpl+14232)
59 | #59 pc 0000000000239c08 /system/lib64/libart.so
60 | #60 pc 000000000023f6fc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadERKNS_20CodeItemDataAccessorEPNS_11ShadowFrameEPNS_6JValueE+220)
61 | #61 pc 000000000025fee8 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+944)
62 | #62 pc 0000000000520ba4 /system/lib64/libart.so (MterpInvokeVirtual+592)
63 | #63 pc 000000000054bc18 /system/lib64/libart.so (ExecuteMterpImpl+14232)
64 | io.objectbox.query.Query.nativeFind(Native Method)
65 | io.objectbox.query.Query.u(Query.java:12)
66 | io.objectbox.query.Query.d(Query.java:1)
67 | io.objectbox.query.e.call(R8$$SyntheticClass:2)
68 | io.objectbox.BoxStore.e(BoxStore.java:20)
69 | io.objectbox.BoxStore.f(BoxStore.java:3)
70 | io.objectbox.query.Query.g(Query.java:11)
71 | io.objectbox.query.Query.n(Query.java:4)
72 | com.jglive.xinlian.objectbox.impl.h.d(ObjectboxModel.kt:55)
73 | com.jglive.xinlian.objectbox.impl.h.e(ObjectboxModel.kt:8)
greenrobot commented 1 week ago

@15915763299 Thanks for reaching out. What ObjectBox version is this? Can you update to the latest version?