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

未关闭
#2,450 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
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. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

mapbox/mapbox-maps-ios 的其他 Issue

查看 mapbox/mapbox-maps-ios 的全部 Issue

相似的 Issue

更多 Swift Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。