EXC_BAD_ACCESS in generateMipmapsForTexture: nil texture during render while MtlGpuUploader is uploading
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 12/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- ios, swift
调研方向
Start with the frames the report names: MetalView.draw(_:) at MetalView.swift:75 and MapView.updateFromDisplayLink(displayLink:) at MapView.swift:741, plus the setCustomRasterSourceTileData calls that add the CustomRasterSource layers. The root cause sits in MapboxCoreMaps and the MtlGpuUploader thread, so a fix needs a reproducer and a Metal-level explanation of why the texture is nil. Done means a repro that no longer crashes, or a maintainer-confirmed diagnosis of the nil texture.
由索引模型根据 Issue 内容生成。
描述
Environment
- Maps SDK: 11.34.1 (MapboxCoreMaps 11.34.1, MapboxCommon 24.34.1), but also reproduced on 11.33.0 and 11.32.2
- iOS: 27.2
- Device: iPhone 18 Pro (AGX G19 GPU)
- Xcode: 27.2, debugger attached, Metal GPU Frame Capture enabled. Also reproduced in release build with no debugger attached.
Observed behavior and steps to reproduce
EXC_BAD_ACCESS (code=1, address=0x248) on the main thread in -[AGXG19FamilyBlitContext generateMipmapsForTexture:], called from MapboxCoreMaps during a normal frame. The texture passed to generateMipmapsForTexture: is nil. It happened ~300 ms after the style finished loading, with ~2.7 GB still available to the process, so it isn't an allocation failure under memory pressure.
Several CustomRasterSource raster layers (tileSize 256 × display scale, set via setCustomRasterSourceTileData) are added to our map after the style loads, and it seems to only happen when one of these layers are enabled.
Crashed thread
MapboxCoreMaps 11.34.1 (arm64)
UUID: 9FFE71C2-5754-37B7-993B-968869BF026C
Load address: 0x1078a8000
thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x248)
frame #0: AGXMetalG19P -[AGXG19FamilyBlitContext generateMipmapsForTexture:] + 104
frame #1: GPUToolsCapture -[CaptureMTLBlitCommandEncoder generateMipmapsForTexture:] + 116
frame #2: MapboxCoreMaps 0x107dd32e8 MapboxCoreMaps + 0x52b2e8
frame #3: MapboxCoreMaps 0x107e90e90 MapboxCoreMaps + 0x5e8e90
frame #4: MapboxCoreMaps 0x10803edf0 MapboxCoreMaps + 0x796df0
frame #5: MapboxCoreMaps 0x108085fd8 MapboxCoreMaps + 0x7ddfd8
frame #6: MapboxCoreMaps 0x10804ec34 MapboxCoreMaps + 0x7a6c34
frame #7: MapboxCoreMaps 0x10804473c MapboxCoreMaps + 0x79c73c
frame #8: MapboxCoreMaps 0x107c1fc18 MapboxCoreMaps + 0x377c18
frame #9: MapboxCoreMaps 0x107c12adc MapboxCoreMaps + 0x36aadc
frame #11: MapboxMaps MetalView.draw(_:) (MetalView.swift:75)
frame #13: MetalKit -[MTKView draw] + 148
frame #14: MapboxMaps MapView.updateFromDisplayLink(displayLink:) (MapView.swift:741)
Uploader thread at crash time
thread #37, name = 'com.mapbox.common.MtlGpuUploader'
frame #0: AGXMetalG19P AGX::AppleCompressionGen2::Compressor<…>::compressMacroblock(…) + 344
frame #1: AGXMetalG19P AGX::Texture<…>::processCompressedRegion2D<…>(…) + 1908
frame #2: AGXMetalG19P AGX::Texture<…>::writeRegionCommon(…) + 1672
frame #3: AGXMetalG19P -[AGXG19FamilyTexture replaceRegion:mipmapLevel:slice:withBytes:bytesPerRow:bytesPerImage:] + 96
frame #4: IOGPU -[IOGPUMetalTexture replaceRegion:mipmapLevel:withBytes:bytesPerRow:] + 56
- 主要语言
- Swift
- 星标
- 601
- 派生
- 198
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
mapbox/mapbox-maps-ios 的其他 Issue
-
auto-triaged bug :beetle: p2
难度 4/5 3-5 天 新手友好度 28/100
mapbox/mapbox-maps-ios#2461 ·
-
auto-triaged bug :beetle: p1
难度 4/5 3-5 天 新手友好度 18/100
mapbox/mapbox-maps-ios#2460 ·
-
auto-triaged bug :beetle: p2
难度 4/5 3-5 天 新手友好度 35/100
mapbox/mapbox-maps-ios#2459 ·
-
auto-triaged bug :beetle: p1
难度 4/5 3-5 天 新手友好度 38/100
mapbox/mapbox-maps-ios#2456 · 1 条评论 ·
-
auto-triaged bug :beetle: p1
难度 4/5 3-5 天 新手友好度 15/100
mapbox/mapbox-maps-ios#2455 · 1 条评论 ·
查看 mapbox/mapbox-maps-ios 的全部 Issue
相似的 Issue
-
area: build-and-ci S3: minor
难度 2/5 1-3 小时 新手友好度 72/100
manaflow-ai/cmux#65734 ·
维护者通常 1 天内回复
-
bug text-to-speech
难度 2/5 1-3 小时 新手友好度 76/100
FluidInference/FluidAudio#1201 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
OneBusAway/onebusaway-ios#2025 ·
维护者通常 1 天内回复
-
good first issue help wanted
难度 1/5 1 小时以内 新手友好度 95/100
erkamyaman/rust-anything#930 ·
维护者通常 1 天内回复
-
contributor: external iOS needs review sdk-58 severity: low
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复