Main-thread hangs in Puck2DRenderer/CoreMaps and background drawable cleanup (11.31.1)

オープン
#2,450 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
22/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
ios, swift

調査の方向性

Start with the reported stacks in Puck2DRenderer and MapView.reduceMemoryUse, then inspect the referenced 11.33.0 release notes and issue 2229 for symbol availability. The report provides no deterministic reproducer or resolved private frames, so first identify a bounded way to reproduce or diagnose each signature. Done means identifying a matching cause or fix and documenting a supported workaround or release; the issue reports no verified fix.

索引モデルが issue の本文から書いたものです。

説明

auto-triaged bug :beetle: needs info p3 performance :zap:

Environment

  • Flutter app, one phone MapView, mapbox_maps_flutter 2.31.1.
  • MapboxMaps/CoreMaps 11.31.1, MapboxCommon 24.31.1.
  • Case A: iPhone 12, iOS 27.0.1, release build.
  • Case B: iPhone 11, iOS 26.6.1, release build.
  • Sentry captured one >=2-second main-thread hang for each signature.
  • We do not use CarPlay, custom GL/Metal rendering or synthetic scene activation.

These are two separate signatures; we have not established a common cause.
The shipped watchdog is Sentry Cocoa 8.58.4 ANRTrackerV1: it checks foreground
and active application state and filters oversleep after suspension. Its
two-second message is a missed-main-queue-tick threshold, not a measured
duration of the function visible in the sampled stack.

Observed behavior and reproduction status

These are production observations. We do not have a deterministic reproduction or a minimal reproducer yet. The captured signatures involve a native location-puck update after returning to the foreground and automatic drawable cleanup during a scene-background notification, respectively.

Expected behavior: lifecycle transitions and location-puck updates keep the main thread responsive.

Case A: location puck update waits inside CoreMaps

The app returned to the foreground approximately 2.2 seconds before the
hang snapshot. The main-thread call chain, caller to callee, is:

PuckManager.subscribeOnUpdates
PuckManager.startRendering
Puck2DRenderer.state.setter / didset
Puck2DRenderer.startRendering
Puck2DRenderer.updateLayerFastPath
StyleManager.setLayerProperties
MBMStyleManager.setStyleLayerPropertiesForLayerId
MapboxCoreMaps +0xe9390 +0x145c70 +0x92bfa8 +0x25b520 +0x2600c8
              +0x4cf928 +0x3495bc +0x34a7d8 +0x4d6084 +0x4d5dc4
MapboxCommon  +0x1b9dcc +0x1baac4
std::__1::condition_variable::__do_timed_wait
_pthread_cond_wait
__psynch_cvwait

arm64 UUIDs:

  • CoreMaps: A6900208-95DF-33BA-9A4B-AF77F668EE78.
  • Common: 6A8EDD2C-FA7B-33FF-836E-13F17C762895.

The CoreMaps UUID matches the distributed 11.31.1 binary. Our application
dSYMs resolve the Swift wrappers; the private CoreMaps/Common frames remain
unresolved. In the all-thread snapshot, the Mapbox worker queues, including
MtlGpuUploader, are waiting/sleeping. No runnable lock owner is identifiable.
There is no overlapping app-owned style-reload breadcrumb. A snapshot does
not prove that one function occupied the entire hang interval.

We examined disabling puck bearing as a workaround but did not apply it:
heading still participates in PuckRendererState and the fast path still
writes location properties. We have no evidence that this avoids the wait.

Case B: background cleanup reaches MTKView.releaseDrawables

The main thread is in the scene-background notification:

UIScene lifecycle notification
MapView.sceneDidEnterBackground
MapView.reduceMemoryUse
-[MTKView releaseDrawables]
_mtkLinkedOnOrAfter.cold.1

The breadcrumbs show repeated pairs of app-requested reduceMemoryUse
around earlier background transitions. The latest pair was 13 ms apart,
with the second request 4 ms before that background breadcrumb. However,
that pair preceded the hang snapshot by approximately 73 seconds; a
foreground breadcrumb intervened approximately 38 seconds before detection.
We cannot identify those earlier requests as the cause of the sampled
cleanup. No later background breadcrumb was present in the captured event.

We removed app-initiated iOS memory cleanup in the next build and now leave
it to the SDK. This removes duplication, not a proven cause of this hang.
No active Mapbox renderer/worker is identifiable in the snapshot either.

Verification limits and questions

We have no affected physical device attached. Attempts to record a simulator
trace did not produce an exportable trace, so we have no measured hang-rate
or latency improvement to claim. The 11.33.0 release notes describe a
different startup distance-formatter blockage, not either stack above.

  1. Can you symbolicate the Case A library offsets and identify the awaited
    operation or the relevant lifecycle invariant?
  2. Is there a supported workaround or a release containing a matching fix
    for the Puck2DRenderer wait or drawable-release hang?
  3. What additional bounded diagnostic would identify the blocking owner on
    a production device without collecting user location or account data?

References: 11.33.0 release,
private symbol availability.
Issue 2444 describes
forced CarPlay background rendering and heap corruption; our setup and
signatures differ, so we do not treat it as the same defect.

主要言語
Swift
スター
601
フォーク
198
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

mapbox/mapbox-maps-ios のほかの issue

mapbox/mapbox-maps-ios の issue をすべて見る

似ている issue

Swift の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。