maplibre-native: Crash with android-v11.0.0-pre4 (Samsung Galaxy S4 Mini, LineageOS 16.0, Android 9)

Describe the bug App crashes on start

To Reproduce Steps to reproduce the behavior:

  1. Have app with working maplibre 10.0.2
  2. Upgrade to 11.0.0-pre4
  3. Start app
  4. See crash (looks like it happens after style is loaded, but I don’t see any map tiles are rendered)
19:32:42.633 libc                     A  Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8 in tid 32277 (GLThread 3086), pid 32229 (mplete.ml.debug)
19:32:43.117 DEBUG                    A  pid: 32229, tid: 32277, name: GLThread 3086  >>> de.westnordost.streetcomplete.ml.debug <<<
19:32:43.205 DEBUG                    A      #21 pc 00622405  /data/app/de.westnordost.streetcomplete.ml.debug-X6eOgc-FLo8RJAY1-LJMlw==/lib/arm/libmapbox-gl.so
19:32:43.205 DEBUG                    A      #22 pc 0063909d  /data/app/de.westnordost.streetcomplete.ml.debug-X6eOgc-FLo8RJAY1-LJMlw==/lib/arm/libmapbox-gl.so
19:32:43.205 DEBUG                    A      #23 pc 00637eff  /data/app/de.westnordost.streetcomplete.ml.debug-X6eOgc-FLo8RJAY1-LJMlw==/lib/arm/libmapbox-gl.so
19:32:43.205 DEBUG                    A      #24 pc 004a79e9  /data/app/de.westnordost.streetcomplete.ml.debug-X6eOgc-FLo8RJAY1-LJMlw==/lib/arm/libmapbox-gl.so
19:32:43.205 DEBUG                    A      #25 pc 004a67c7  /data/app/de.westnordost.streetcomplete.ml.debug-X6eOgc-FLo8RJAY1-LJMlw==/lib/arm/libmapbox-gl.so
19:32:43.205 DEBUG                    A      #26 pc 004b7595  /data/app/de.westnordost.streetcomplete.ml.debug-X6eOgc-FLo8RJAY1-LJMlw==/lib/arm/libmapbox-gl.so
19:32:43.206 DEBUG                    A      #27 pc 004c9483  /data/app/de.westnordost.streetcomplete.ml.debug-X6eOgc-FLo8RJAY1-LJMlw==/lib/arm/libmapbox-gl.so
19:32:43.206 DEBUG                    A      #28 pc 004c8817  /data/app/de.westnordost.streetcomplete.ml.debug-X6eOgc-FLo8RJAY1-LJMlw==/lib/arm/libmapbox-gl.so
19:32:43.206 DEBUG                    A      #29 pc 0037333f  /data/app/de.westnordost.streetcomplete.ml.debug-X6eOgc-FLo8RJAY1-LJMlw==/lib/arm/libmapbox-gl.so (mbgl::android::MapRenderer::render(_JNIEnv&)+194)
19:32:43.206 DEBUG                    A      #30 pc 003751a9  /data/app/de.westnordost.streetcomplete.ml.debug-X6eOgc-FLo8RJAY1-LJMlw==/lib/arm/libmapbox-gl.so (_ZZN3jni16MakeNativeMethodIZNS_17NativeMethodMakerIMZNS_30NativePeerMemberFunctionMethodIMN4mbgl7android11MapRendererEFvR7_JNIEnvEXadL_ZNS5_6renderES7_EEEclIS5_S5_vEEDaRKNS_5FieldIT0_xEEEUlS7_RNS_6ObjectIS5_EEE_KFvS7_SJ_EJEEclISK_EEDaPKcRKT_EUlPS6_PNS_7jobjectEE_EEDaSQ_SQ_ST_PNSt6__ndk19enable_ifIXsr3std8is_classISR_EE5valueEvE4typeEENUlSU_DpT_E_8__invokeIJSW_EEEDaSU_S14_+28)
19:32:43.206 DEBUG                    A      #39 pc 0056e994  /dev/ashmem/dalvik-classes.dex extracted in memory from /data/app/de.westnordost.streetcomplete.ml.debug-X6eOgc-FLo8RJAY1-LJMlw==/base.apk (deleted) (org.maplibre.android.maps.renderer.MapRenderer.onDrawFrame+12)
19:32:43.206 DEBUG                    A      #45 pc 0056f8a0  /dev/ashmem/dalvik-classes.dex extracted in memory from /data/app/de.westnordost.streetcomplete.ml.debug-X6eOgc-FLo8RJAY1-LJMlw==/base.apk (deleted) (org.maplibre.android.maps.renderer.glsurfaceview.GLSurfaceViewMapRenderer.onDrawFrame)
19:32:43.207 DEBUG                    A      #51 pc 00570406  /dev/ashmem/dalvik-classes.dex extracted in memory from /data/app/de.westnordost.streetcomplete.ml.debug-X6eOgc-FLo8RJAY1-LJMlw==/base.apk (deleted) (org.maplibre.android.maps.renderer.glsurfaceview.MapLibreGLSurfaceView$GLThread.guardedRun+994)
19:32:43.207 DEBUG                    A      #57 pc 00570960  /dev/ashmem/dalvik-classes.dex extracted in memory from /data/app/de.westnordost.streetcomplete.ml.debug-X6eOgc-FLo8RJAY1-LJMlw==/base.apk (deleted) (org.maplibre.android.maps.renderer.glsurfaceview.MapLibreGLSurfaceView$GLThread.run+48)

Expected behavior Normal startup

Platform information (please complete the following information):

  • OS: LineageOS 16.0 / Android 9
  • Platform: Android
  • Version: 9
  • Device: Samsung Galaxy S4 Mini

Additional context Works on other devices. S4 Mini supports OpenGL ES 3.0 in case the question comes up.

About this issue

  • Original URL
  • State: open
  • Created 3 months ago
  • Comments: 28 (9 by maintainers)

Most upvoted comments

Update: I got an S4 mini (SGH-I257M) which has an Adreno 3xx GPU and appears to be identical to the SKUs you listed. I put Lineage on it and was able to replicate the crash. Stopping the symbol layer from rendering resulted in an otherwise correct looking map. Screenshot_20240502-144713

I was also able to confirm it’s the shader compilation (glLinkProgram) crashing, so I can try and debug the shaders now to see what exactly is going wrong.

I do have to wonder how many devices are actually out there with an Adreno 3xx GPU and an Android API level high enough to work with MapLibre. The stock ROM on this device is API level 19 which isn’t high enough so you have to put a custom image like Lineage on it to even end up in this situation. For now, I think we should try and run on Adreno 3xx if it isn’t too difficult and/or there are other devices out there that can run MapLibre without custom OS installs.

Thank you for this list, even with duplicates there are still quite a few devices with 304/305 GPUs out there. I’ll provide further updates in a future PR linking to this issue when I track down the root cause in the shaders.

I do have to wonder how many devices are actually out there with an Adreno 3xx GPU and an Android API level high enough to work with MapLibre.

I have access to this data. Here is a list of all devices that use a Adreno 3xx GPU (, are supported by my app, i.e. have minimum Android API level of 21) and support at least OpenGL ES 3.0:

devices.csv

Looks like it crashed trying to link a permuted symbol layer shader. Both devices run Adreno 3xx GPUs which apparently have some pretty cursed conformance issues with OpenGL ES 3.0. I’ll try and get one of these devices to debug the shaders with, but it looks like there are a few known issues with those drivers.

For pre-06, debug symbols have been added. I suspect that debugging the source of the issue will be easier now.

Interesting, that might be a 32-bit problem then. If you can, could you build the Android demo application in this repository and run it on these devices? Building everything in debug mode will also hopefully provide a full call stack with C++ symbols.

Maybe there is some other issue… I just tested it on my other S4 Mini VE (9195I), which has Snapdragon 410 instead of 400, and got the same crash. Both use the older 32 bit armeabi-v7a (even though SD410 could run arm64-v8a).