mapbox / mapbox/mapbox-maps-android

MapboxRenderThread.kt:555 produces ANR

Open
#2,689 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :beetle:
Dominant language
Kotlin
Stars
578
Forks
161
PR merge metrics
No merged PRs in 30d

Description

## Environment

- Android OS version: 16
- Devices affected: Galaxy S24 Ultra
- Maps SDK Version: 11.16.2
implementation "com.mapbox.maps:android-ndk27:11.16.2"
implementation "com.mapbox.extension:maps-compose:11.16.2"
implementation "com.mapbox.mapboxsdk:mapbox-sdk-turf:7.8.0"

` main (waiting):tid=1 systid=15263
at jdk.internal.misc.Unsafe.park(Native method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:371)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block(AbstractQueuedSynchronizer.java:519)
at java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3805)
at java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3746)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1707)
at com.mapbox.maps.renderer.MapboxRenderThread.onSurfaceDestroyed(MapboxRenderThread.kt:555)
at com.mapbox.maps.renderer.MapboxSurfaceRenderer.surfaceDestroyed(MapboxSurfaceRenderer.kt:57)
at com.mapbox.maps.renderer.MapboxSurfaceHolderRenderer.surfaceDestroyed(MapboxSurfaceHolderRenderer.kt:28)
at android.view.SurfaceView.notifySurfaceDestroyed(SurfaceView.java:2530)
at android.view.SurfaceView.updateSurface(SurfaceView.java:1487)
at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:590)
at android.view.View.dispatchWindowVisibilityChanged(View.java:17671)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1659)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1659)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1659)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4606)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:3924)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:12903)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1901)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1910)
at android.view.Choreographer.doCallbacks(Choreographer.java:1367)
at android.view.Choreographer.doFrame(Choreographer.java:1292)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1870)
at android.os.Handler.handleCallback(Handler.java:995)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loopOnce(Looper.java:273)
at android.os.Looper.loop(Looper.java:363)
at android.app.ActivityThread.main(ActivityThread.java:10060)
at java.lang.reflect.Method.invoke(Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)`

[stacktrace_from_firebase.txt](https://github.com/user-attachments/files/23498993/stacktrace_from_firebase.txt)

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting MapboxRenderThread.kt around line 555, then trace the surfaceDestroyed calls through MapboxSurfaceRenderer.kt and MapboxSurfaceHolderRenderer.kt. Reproduce the ANR on Android 16 with the reported Galaxy S24 Ultra and SDK 11.16.2, using the attached Firebase trace as a reference. Done means surface destruction no longer causes the reported main-thread wait.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.