EXC_BAD_ACCESS on com.mapbox.common.location.clmonitor at launch since MapboxCommon 24.34 (CLMonitor region monitoring)

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
ios, swift

Direzione di ricerca

Start by tracing LocationService creation of the device location provider and MBXCLDeviceLocationProvider’s restoreCLMonitorTelemetryRegion path described in the issue. Check how the CLMonitor request and its queue are managed, including whether telemetry-disabled launches still initialize the provider. Done means identifying and fixing the launch crash and related provider or CoreLocation crashes, with a reproducible regression check; the issue does not name test files.

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)
  • iOS: 26.5.2 through 27.3, all iPhone models
  • Xcode: 27.2
  • Release builds from the App Store, no debugger attached

Observed behavior

Since moving from Maps 11.29.1 to 11.34.1 this is our top crash. It hits about 0.11% of daily active users every day. It's EXC_BAD_ACCESS in objc_release while libdispatch releases a block on the com.mapbox.common.location.clmonitor queue. 93% of events happen in the first second of the session. We haven't reproduced it locally.

Crashed thread

MapboxCommon 24.34.1 (arm64)

Crashed: com.mapbox.common.location.clmonitor
0  libobjc.A.dylib         objc_release_x8 + 16
1  libsystem_blocks.dylib  <deduplicated_symbol> + 68
2  libsystem_blocks.dylib  HelperBase<GenericInline>::destroyBlock(Block_layout*, bool, unsigned char*) + 116
3  libsystem_blocks.dylib  _call_dispose_helpers_excp + 72
4  libsystem_blocks.dylib  _Block_release + 236
5  libdispatch.dylib       _dispatch_client_callout + 16
6  libdispatch.dylib       _dispatch_lane_serial_drain + 740
7  libdispatch.dylib       _dispatch_lane_invoke + 392
8  libdispatch.dylib       _dispatch_root_queue_drain_deferred_wlh + 284
9  libdispatch.dylib       _dispatch_workloop_worker_thread + 720
10 libsystem_pthread.dylib _pthread_wqthread + 292
11 libsystem_pthread.dylib start_wqthread + 8

We also see two smaller crash groups in the same code on 24.34.1:

  • SIGABRT "pointer being freed was not allocated" inside LocationService::getDeviceLocationProvider, which looks like a race creating the provider.
  • EXC_BAD_ACCESS in CoreLocation client code called from MBXCLDeviceLocationProvider blocks.

What we found in the 24.34.1 binary

While doing our investigation into the issue, I had Claude do some analysis on Mapbox to help us determine if pinning to an older version would help. Thought I'd pass along it's findings, specifically the apple dev forum posting possibly of interest here:

  • -[MBXCLDeviceLocationProvider init] calls restoreCLMonitorTelemetryRegion on iOS 17+. That dispatches onto MBXSharedCLMonitor's queue, which calls +[CLMonitor requestMonitorWithConfiguration:completion:] for MapboxCommonRegionMonitor with that same queue.
  • The provider is created by LocationService when the telemetry location provider asks for a device location provider. The init path doesn't check telemetryCollectionDisabled, so turning telemetry off doesn't avoid it.
  • The block that crashes is disposed through HelperBase<GenericInline>. Every block we found in MapboxCommon has its own copy/dispose helpers, so the crashing block probably belongs to CoreLocation's CLMonitor setup and runs on Mapbox's queue. That matches the unresolved Apple Developer Forums report of CLMonitor crashing when it's requested early in launch: https://developer.apple.com/forums/thread/771001
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.