mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.38k stars 1.32k forks source link

MapRenderer.nativeRender makes App crash #12194

Closed stoefln closed 6 years ago

stoefln commented 6 years ago

Platform: Android Mapbox SDK version: 6.1.2 & 6.2.0 (both tested) Location Layer Plugin: 0.5.3

Steps to trigger behavior

  1. Navigate around for around 5-10 minutes
  2. App closes without any notification, log shows no warnings or errors. Also other apps close/crash (screen recording app, audio player), system UI needs a second or two to rebuild.

Edit:

Finally managed to reproduce this bug in the emulator and it shows me a stacktrace:

06-22 10:38:45.059 6665-7953/com.toursprung.bikemap E/AndroidRuntime: FATAL EXCEPTION: GLThread 6879
    Process: com.toursprung.bikemap, PID: 6665
    java.lang.Error: std::bad_alloc
        at com.mapbox.mapboxsdk.maps.renderer.MapRenderer.nativeRender(Native Method)
        at com.mapbox.mapboxsdk.maps.renderer.MapRenderer.onDrawFrame(MapRenderer.java:90)
        at com.mapbox.mapboxsdk.maps.renderer.glsurfaceview.GLSurfaceViewMapRenderer.onDrawFrame(GLSurfaceViewMapRenderer.java:55)
        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1571)
        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1270)
06-22 10:38:45.060 6665-7953/com.toursprung.bikemap E/BikemapApplication: uncaughtException
    java.lang.Error: std::bad_alloc
        at com.mapbox.mapboxsdk.maps.renderer.MapRenderer.nativeRender(Native Method)
        at com.mapbox.mapboxsdk.maps.renderer.MapRenderer.onDrawFrame(MapRenderer.java:90)
        at com.mapbox.mapboxsdk.maps.renderer.glsurfaceview.GLSurfaceViewMapRenderer.onDrawFrame(GLSurfaceViewMapRenderer.java:55)
        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1571)
        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1270)
06-22 10:38:45.060 6665-7953/com.toursprung.bikemap D/BikemapApplication: logExceptionWithCrash

Edit2:

After days of debugging, we figured out that this crash can be avoided by NOT tilting the camera and adjusting the zoomlevel (more distant view). Still we really need to tilt the camera...

kkaefer commented 6 years ago

This looks like an OOM crash. refs https://github.com/mapbox/mapbox-gl-native/issues/9037

LukasPaczos commented 6 years ago

Is this one still reproducible with the latest versions of the libraries @stoefln? Can this be related to https://github.com/mapbox/mapbox-gl-native/pull/12296 and https://github.com/mapbox/mapbox-plugins-android/issues/570 instead of https://github.com/mapbox/mapbox-gl-native/issues/9037?

I'm going to close this one regardless in favor of https://github.com/mapbox/mapbox-gl-native/issues/9037 but please let us know if it's still an issue.

novriamsyah commented 1 year ago

same issue, try mapbox_gl_modified new package. work for me