Open Fil-Niantic opened 2 years ago
Hey, could you take a look at an attempt to repro: 6b4b0bae6afe77c41ed2412003cee0227581cbc1. I couldn't tell if you also resuming before pausing, but removing the call to resume has no effect).
I'm also testing with Don't keep activities
enabled, ensuring that ArSession_destroy
is called (and verifying this with the I1546
log).
Could you help me understand if this patch would repro?
Lightship ARDK upgraded its dependency of ARCore from 1.22 to 1.32, and since then ARCore has been causing Android apps to crash from a
JNI DETECTED ERROR IN APPLICATION: a thread (tid 8505 is making JNI calls without being attached in call to DeleteGlobalRef
Similar bugs reported in:
https://github.com/google-ar/arcore-android-sdk/issues/1359 https://github.com/google-ar/arcore-android-sdk/issues/1315#issuecomment-978090263 These reports' crash logs are consistent with the crash log that we observed. (crash logs attached below)
What we tried
This crash occurs when Lightship ARDK attempts to destroy the ar session. Looking at several FATAL EXCEPTION stack traces, we observe that the crash eventually stems from ARCore making an internal call to
/data/app/com.google.ar.core-GbjQW20pppfXgk8JnlTwEQ==/base.apk (ArSession_destroy+92)
(we have attached several logs to this that shows the stack traces)For additional context, we have observed that this crash on ar session destruction happens only if the following occurs.
ArSession_create()
ArCore functionArSession_pause()
ArCore function (before first camera feed buffer is rendered)ArSession_destroy()
ArCore function some time later (where crash occurs)Note: if the session is not paused immediately in step 2 and the session is later destroyed, then the crash doesn’t repro (we were able to workaround the crash by adding a 1 second delay before pausing the session)
So far, we have been able to repro this crash with the similar crash stack trace stemming from ArCore on 3 different apps (hence 3 logs below) that depend on Lightship ARDK (and hence the upgraded ArCore 1.32)
In the attached logs, searching
Deleting ArSession...
will show that arcore is attempting to destroy the ar session fromsession_lite_c_api.cc:37
(arcore class) but then runs intoUnable to delete global reference, JNIEnv* missing
, which eventually causes the above mentioned JNI errorError logs
arvoyage_crash.txt ardkexamples_plane_anchors_app_crash.txt wayfarer-crash.txt
adb shell pm dump com.google.ar.core | egrep versionName\|versionCode\|packages: | grep -v APEX
returns:adb shell getprop ro.build.fingerprint
returns:samsung/o1quew/o1q:12/SP1A.210812.016/G991U1UES5CVI8:user/release-keys
log.txt