This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Random native crash makes our CI integration flaky #6286
Copy link
Copy link
Closed
Description
We currently run instrumentation tests as part of our CI integration on Android. I have been hearing about reports of the test being flaky. Most occurrences of flakyness are coming from random native crashes. I haven't been able to pinpoint where these are coming from since they are not reproducible on demand and I haven't noticed this issue while running on a device locally.
An example of such a native crash:
09-07 09:15:06.169: I/DEBUG(357): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-07 09:15:06.169: I/DEBUG(357): Build fingerprint: 'google/shamu/shamu:5.1.1/LMY48Y/2364368:user/release-keys'
09-07 09:15:06.169: I/DEBUG(357): Revision: '33696'
09-07 09:15:06.169: I/DEBUG(357): ABI: 'arm'
09-07 09:15:06.169: I/DEBUG(357): pid: 22827, tid: 24280, name: Worker >>> com.mapbox.mapboxsdk.testapp <<<
09-07 09:15:06.170: I/DEBUG(357): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
09-07 09:15:06.213: I/DEBUG(357): r0 00000000 r1 912a9970 r2 a08b8e00 r3 8c073d40
09-07 09:15:06.213: I/DEBUG(357): r4 910aeed8 r5 912a9970 r6 968e2760 r7 9965bb70
09-07 09:15:06.213: I/DEBUG(357): r8 7a18293c r9 9965bb84 sl 910aef00 fp 9965bb74
09-07 09:15:06.213: I/DEBUG(357): ip b6e907dc sp 9965baf8 lr a17a0da4 pc a17a0e84 cpsr 600f0010
09-07 09:15:06.214: I/DEBUG(357): backtrace:
09-07 09:15:06.214: I/DEBUG(357): #00 pc 00128e84 /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm/libmapbox-gl.so
09-07 09:15:06.214: I/DEBUG(357): #01 pc 00128da0 /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm/libmapbox-gl.so
09-07 09:15:06.214: I/DEBUG(357): #02 pc 00138ae8 /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm/libmapbox-gl.so
09-07 09:15:06.214: I/DEBUG(357): #03 pc 0013ddf4 /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm/libmapbox-gl.so
09-07 09:15:06.214: I/DEBUG(357): #04 pc 0013dc04 /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm/libmapbox-gl.so
09-07 09:15:06.214: I/DEBUG(357): #05 pc 0014114c /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm/libmapbox-gl.so
09-07 09:15:06.214: I/DEBUG(357): #06 pc 00141030 /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm/libmapbox-gl.so
09-07 09:15:06.214: I/DEBUG(357): #07 pc 00139188 /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm/libmapbox-gl.so
09-07 09:15:06.214: I/DEBUG(357): #08 pc 001390d0 /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm/libmapbox-gl.so
09-07 09:15:06.214: I/DEBUG(357): #09 pc 00016baf /system/lib/libc.so (__pthread_start(void*)+30)
09-07 09:15:06.214: I/DEBUG(357): #10 pc 00014af3 /system/lib/libc.so (__start_thread+6)
Links to the some actual failing test cases:
- https://console.cloud.google.com/testlab/mobile/histories/bh.1470d2ab45df6f1f/executions/7254157111626696740/steps/bs.96fb3f21972cba29?project=android-gl-native#logs
- https://console.cloud.google.com/testlab/mobile/histories/bh.1470d2ab45df6f1f/executions/7905015661860257611/steps/bs.34774c9f1ca3e6e2?project=android-gl-native#logs\
- https://console.cloud.google.com/testlab/mobile/histories/bh.1470d2ab45df6f1f/executions/6290063756259092618/steps/bs.3dcf07284cd8b464?project=android-gl-native#logs
- https://console.cloud.google.com/testlab/mobile/histories/bh.1470d2ab45df6f1f/executions/7254157111626696740/steps/bs.96fb3f21972cba29?project=android-gl-native#logs
cc @mapbox/mobile
Activity
jfirebaugh commentedon Sep 7, 2016
@tobrun Is it possible to symbolicate the stack trace automatically, so that when issues like this occur in CI we at least have the code location leading up the the crash?
tobrun commentedon Sep 7, 2016
yes, been talking with @ivovandongen about this. Just need to get the stacktrace stripped from the logcat file and run ndk-stack on it. I'm handling this as a high priority since this is blocking other people and making them mad ("grinding their teeth").
tobrun commentedon Sep 8, 2016
While trying to make the build fail with a native crash, I'm also running into:
tobrun commentedon Sep 8, 2016
I was able to integrate the suggestion from #6286 (comment).
When the logcat output from Firebase test lab contains a native stacktrace. eg:
Than the output from ndk-stack command will be shown in the bitrise output as:
Note: it doesn't show output with file and line numbers... I think this has to do with having our Buildtype set to release. Need to look into this more before merging.
Update: setting buildtype to debug doesn't resolve the issue, seeing the same result as above. @ivovandongen / @zugaldia any idea why this is not working?
tobrun commentedon Sep 8, 2016
Thanks to @ivovandongen for 👀. It seemed the path for ndk-stack has changed with the introduction of the cmake build system. After changing the path I'm able to symbolicate the crash:
jfirebaugh commentedon Sep 8, 2016
Sqlite error on a
UPDATE resources ...query. Probably #6193. #6267 should help diagnose more precisely.Does ndk-stack have a mode where you can pipe output through it? Ideally the symbolicated stack trace appears in the proper context of the rest of the log, like in Android Studio output.
tobrun commentedon Sep 8, 2016
Capturing from @ivovandongen that it doesn't seem supported or we need to "smart" parse it ourselves in parts. FWIW this it the source of ndk-stack.
tobrun commentedon Sep 9, 2016
Received report of another random crash:
friedbunny commentedon Sep 9, 2016
That’s #6300, which @jfirebaugh closed as a dupe of #6263.
tobrun commentedon Sep 12, 2016
Strictmode is acting up occasionally. eg:
jfirebaugh commentedon Sep 13, 2016
Original report here is #6263. Let's open separate issues for other CI failures.