objectbox / objectbox-java

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

profiling crash #989

Open XWayne opened 3 years ago

XWayne commented 3 years ago
2021-06-03 12:02:12.448 28996-29081/com.xxx.test A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1f in tid 29081 (IoThreadPool-3), pid 28996 (mlive.soulmatch)
2021-06-03 12:02:12.557 30112-30112/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2021-06-03 12:02:12.557 30112-30112/? A/DEBUG: Build fingerprint: 'Xiaomi/umi/umi:11/RKQ1.200826.002/V12.5.3.0.RJBCNXM:user/release-keys'
2021-06-03 12:02:12.557 30112-30112/? A/DEBUG: Revision: '0'
2021-06-03 12:02:12.557 30112-30112/? A/DEBUG: ABI: 'arm'
2021-06-03 12:02:12.557 30112-30112/? A/DEBUG: Timestamp: 2021-06-03 12:02:12+0800
2021-06-03 12:02:12.557 30112-30112/? A/DEBUG: pid: 28996, tid: 29081, name: IoThreadPool-3  >>> com.xxx.test <<<
2021-06-03 12:02:12.557 30112-30112/? A/DEBUG: uid: 10323
2021-06-03 12:02:12.557 30112-30112/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1f
2021-06-03 12:02:12.557 30112-30112/? A/DEBUG: Cause: null pointer dereference
2021-06-03 12:02:12.557 30112-30112/? A/DEBUG:     r0  b8535d50  r1  ffffffff  r2  00434c4e  r3  ba8e9f2c
2021-06-03 12:02:12.557 30112-30112/? A/DEBUG:     r4  b8535cf8  r5  b8535d50  r6  00000008  r7  b8535c98
2021-06-03 12:02:12.557 30112-30112/? A/DEBUG:     r8  00000000  r9  ee48225c  r10 00000001  r11 00000000
2021-06-03 12:02:12.557 30112-30112/? A/DEBUG:     ip  ba9bef4c  sp  b8535c98  lr  ba9816bf  pc  ba981832
2021-06-03 12:02:12.558 30112-30112/? A/DEBUG: backtrace:
2021-06-03 12:02:12.558 30112-30112/? A/DEBUG:     NOTE: Function names and BuildId information is missing for some frames due
2021-06-03 12:02:12.558 30112-30112/? A/DEBUG:     NOTE: to unreadable libraries. For unwinds of apps, only shared libraries
2021-06-03 12:02:12.558 30112-30112/? A/DEBUG:     NOTE: found under the lib/ directory are readable.
2021-06-03 12:02:12.558 30112-30112/? A/DEBUG:       #00 pc 000b3832  /data/app/~~00YxkLGiG1YOyAeTooUK3g==/com.xxx.test-EfSCw5nCpf_O4JABr9F_xA==/lib/arm/libobjectbox-jni.so (BuildId: ac56a4d61ea1694fd1df7fc4e9fd04b41c1fd9cb)
2021-06-03 12:02:12.558 30112-30112/? A/DEBUG:       #01 pc 000b36bb  /data/app/~~00YxkLGiG1YOyAeTooUK3g==/com.xxx.test-EfSCw5nCpf_O4JABr9F_xA==/lib/arm/libobjectbox-jni.so (BuildId: ac56a4d61ea1694fd1df7fc4e9fd04b41c1fd9cb)
2021-06-03 12:02:12.558 30112-30112/? A/DEBUG:       #02 pc 000a993d  /data/app/~~00YxkLGiG1YOyAeTooUK3g==/com.xxx.test-EfSCw5nCpf_O4JABr9F_xA==/lib/arm/libobjectbox-jni.so (BuildId: ac56a4d61ea1694fd1df7fc4e9fd04b41c1fd9cb)
2021-06-03 12:02:12.558 30112-30112/? A/DEBUG:       #03 pc 000a98f1  /data/app/~~00YxkLGiG1YOyAeTooUK3g==/com.xxx.test-EfSCw5nCpf_O4JABr9F_xA==/lib/arm/libobjectbox-jni.so (__gxx_personality_v0+208) (BuildId: ac56a4d61ea1694fd1df7fc4e9fd04b41c1fd9cb)
2021-06-03 12:02:12.558 30112-30112/? A/DEBUG:       #04 pc 001d70c0  /data/user/0/com.xxx.test/code_cache/libjvmtiagent_arm.so
2021-06-03 12:02:12.558 30112-30112/? A/DEBUG:       #05 pc 001d79e4  /data/user/0/com.xxx.test/code_cache/libjvmtiagent_arm.so

xiaomi10 -- android 11 -- objectBoxVersion:2.9.0 -- Android studio 4.1.3 100% crash when use android profiler

greenrobot-team commented 3 years ago

Thanks. This is a known issue with Android profiler since a while, see #472. Is there any additional information you can share to help us reproduce this?

XWayne commented 3 years ago

sorry for the slip.

It remind me of a similar intersting issue with HUAWEI profiling: Everytime when GC happen, HUAWEI will crash profiling because the Register r0 ==0(I still don't know how it happens) . And I found an intersting library Android_Inline_Hook , I change the register R0 to R7 + 20,then magically it works for me .I guess it is because of the concurrency or something else .

image image

Hope this help.

greenrobot-team commented 3 years ago

Thanks. But the above crash trace does not include libobjectbox-jni.so. No?

Why do you think this applies to ObjectBox? Just because it is a null pointer dereference as well?