EXC_BAD_ACCESS in generateMipmapsForTexture: nil texture during render while MtlGpuUploader is uploading

Aperta
#2,453 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
12/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
ios, swift

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

auto-triaged bug :beetle: p1

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

Lingua principale
Swift
Stelle
601
Fork
198
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di mapbox/mapbox-maps-ios

Tutte le issue di mapbox/mapbox-maps-ios

Issue simili

Altre issue su Swift

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.