MapboxCoreMaps 11.32.0+ crashes with EXC_BAD_INSTRUCTION on A10 and older devices (unguarded LSE ldadd in Highway aligned allocator)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 15/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- build-system, mobile
Direzione di ricerca
The faulting instruction is an unguarded LSE ldadd inside Highway's AllocateAlignedBytes in vendor/highway/.../aligned_allocator.cc, shipped in the iOS arm64 slice of MapboxCoreMaps. Start with the iOS arm64 build settings for Highway and check whether -moutline-atomics or an armv8-a target is applied there. Done means the iOS device slice has no LSE-only atomics, and the app runs on an A10 device under iPadOS 18.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Environment
- Xcode version: 26.4, 27.2
- iOS version: iPadOS 18.7.11 (22H384)
- Devices affected: Apple A10 and older (ARMv8.0, no LSE). Reproduced on an iPad (7th generation, 2019, A10 Fusion). A11 and newer are fine.
- Maps SDK Version: 11.32.x, 11.33.x, 11.34.x and 11.35.0-rc.1 are affected. 11.31.1 is fine. Crash below is from
11.33.1. We use them through @rnmapbox/maps 10.3.17, with both CocoaPods and SPM.
Observed behavior and steps to reproduce
- Build an app (Release) against MapboxMaps 11.32.0 or later.
- Run it on an A10 device.
- Display a map.
- The app crashes with
EXC_BAD_INSTRUCTION (SIGILL)on a Mapbox worker thread while the main thread is rendering the map (MapboxMaps → MetalKit → MapboxCoreMaps → AGXMetalA10).
The exception subcode in the crash report (4163436808 = 0xF8290008) is the faulting instruction itself: ldadd x9, x8, [x0], an ARMv8.1 LSE atomic add, with x9 = 1 (an atomic increment). Disassembling in lldb at the faulting PC confirms the trap is inside Highway's AllocateAlignedBytes (vendor/highway/.../aligned_allocator.cc).
Symbolication points the top frames at StyleManager::isStyleLoadingFinished, mbgl::emptyWorldview and mapbox::common::platform::processTask. MapboxCoreMaps ships without dSYMs, though, so those names are just the nearest exported symbols.
Crash report (redacted, idle threads omitted)
OS Version: iOS 18.7.11 (22H384)
Report Version: 104
OS Version: iOS 18.7.11 (22H384)
Report Version: 104
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: ILL_NOOP at 0x000000010569f004
Crashed Thread: 29
Application Specific Information:
Exception 2, Code 1, Subcode 4163436808
Thread 29 Crashed:
0 MapboxCoreMaps 0x10569f004 0x105688000 + 4385796100
1 MapboxCoreMaps 0x1059505b0 0x105688000 + 4388619696
2 MapboxCoreMaps 0x1060967c8 0x105688000 + 4396246984
3 MapboxCommon 0x10505afe8 0x104ea0000 + 4379226088
4 libdispatch.dylib 0x32c79382c 0x32c738000 + 7020107820
5 libdispatch.dylib 0x32c794a64 0x32c738000 + 7020112484
6 libdispatch.dylib 0x32c73e308 0x32c738000 + 7019758344
7 libdispatch.dylib 0x32c73daec 0x32c738000 + 7019756268
8 libdispatch.dylib 0x32c74a17c 0x32c738000 + 7019807100
9 libdispatch.dylib 0x32c74a900 0x32c738000 + 7019809024
10 libsystem_pthread.dylib 0x3dae209d0 0x3dae20000 + 8482974160
Thread 0
0 libsystem_kernel.dylib 0x3b4bacbf4 0x3b4bac000 + 8162921460
1 IOKit 0x32ddcef3c 0x32ddce000 + 7031578428
2 IOKit 0x32ddcf200 0x32ddce000 + 7031579136
3 IOGPU 0x441139aec 0x441136000 + 9340242668
4 IOGPU 0x441138f98 0x441136000 + 9340239768
5 IOGPU 0x441139484 0x441136000 + 9340241028
6 AGXMetalA10 0x4832ef5c4 0x4832ea000 + 9894790596
7 AGXMetalA10 0x4832ef3f4 0x4832ea000 + 9894790132
8 AGXMetalA10 0x4832ef3c0 0x4832ea000 + 9894790080
9 AGXMetalA10 0x4832eef30 0x4832ea000 + 9894788912
10 AGXMetalA10 0x483333820 0x4832ea000 + 9895069728
11 MapboxCoreMaps 0x105b95388 0x105688000 + 4390998920
12 MapboxCoreMaps 0x105ba0a64 0x105688000 + 4391045732
13 MapboxCoreMaps 0x105c5ffc4 0x105688000 + 4391829444
14 MapboxCoreMaps 0x1060bd8b4 0x105688000 + 4396406964
15 MapboxCoreMaps 0x105e070dc 0x105688000 + 4393562332
16 MapboxCoreMaps 0x105e4e40c 0x105688000 + 4393853964
17 MapboxCoreMaps 0x105e16ff0 0x105688000 + 4393627632
18 MapboxCoreMaps 0x105e0ca40 0x105688000 + 4393585216
19 MapboxCoreMaps 0x1059f04fc 0x105688000 + 4389274876
20 MapboxCoreMaps 0x1059e33c0 0x105688000 + 4389221312
21 MapboxMaps 0x1066efcd4 0x106570000 + 4402904276
22 MapboxMaps 0x1066efcd4 0x106570000 + 4402904276
23 MetalKit 0x43455363c 0x43454e000 + 9233344060
24 MapboxMaps 0x1066dee08 0x106570000 + 4402834952
25 MapboxMaps 0x1066df588 0x106570000 + 4402836872
26 MapboxMaps 0x10663d390 0x106570000 + 4402172816
27 MapboxMaps 0x10663d390 0x106570000 + 4402172816
28 QuartzCore 0x320c61714 0x320c52000 + 6921807636
29 QuartzCore 0x320c61320 0x320c52000 + 6921806624
30 QuartzCore 0x320c618b0 0x320c52000 + 6921808048
31 UIKitCore 0x322519214 0x322510000 + 6934753812
32 UIKitCore 0x322518848 0x322510000 + 6934751304
33 UIKitCore 0x322513ebc 0x322510000 + 6934732476
34 CoreFoundation 0x31d713b94 0x31d704000 + 6893861780
...
43 App 0x202e9d9d8 0x202ccc000 + 4343847384
46 dyld 0x367495968 0x367460000 + 7513389416
Thread 27
0 MapboxCoreMaps 0x105b4ccf4 0x105688000 + 4390702324
1 MapboxCoreMaps 0x105b489b4 0x105688000 + 4390685108
2 MapboxCoreMaps 0x105b37cf4 0x105688000 + 4390616308
3 MapboxCoreMaps 0x1060ce870 0x105688000 + 4396476528
4 MapboxCoreMaps 0x1060cd358 0x105688000 + 4396471128
5 MapboxCoreMaps 0x1060cdac0 0x105688000 + 4396473024
6 MapboxCommon 0x1050c0e54 0x104ea0000 + 4379643476
7 MapboxCommon 0x10505afe8 0x104ea0000 + 4379226088
8 libdispatch.dylib 0x32c79382c 0x32c738000 + 7020107820
...
14 libsystem_pthread.dylib 0x3dae209d0 0x3dae20000 + 8482974160
(other threads idle, omitted)
Thread 29 crashed with ARM Thread State (64-bit):
x0: 0x00000000000001b0 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x00000003015e3a00
x4: 0x0000000000000000 x5: 0x00000000dc20a09f x6: 0xffffffff42270b8d x7: 0x0000000000000000
x8: 0x00000001064bf150 x9: 0x0000000000000001 x10: 0x000000000000006c x11: 0x0000000302faf3e0
x12: 0x00000000000007fd x13: 0x00000003022f61f8 x14: 0x00000000dc40a8e8 x15: 0x00000000dc20a09f
x16: 0x0000000000000000 x17: 0x00000000000000e8 x18: 0x0000000000000000 x19: 0x00000000000001b0
x20: 0x00000003015e3a00 x21: 0x00000000000001b0 x22: 0x00000003022f6180 x23: 0x000000000000006c
x24: 0x00000003015e39c0 x25: 0x00000003015e39c0 x26: 0x00000003015e39c0 x27: 0x0000000302faf42c
Binary Images:
0x202ccc000 - 0x2045e7fff App arm64 <redacted> <redacted>/App.app/App
0x104ea0000 - 0x1055a3fff MapboxCommon arm64 <1f0a2490a2f63f6cb5e70f9085be1516> <redacted>/App.app/Frameworks/MapboxCommon.framework/MapboxCommon
0x105688000 - 0x10645bfff MapboxCoreMaps arm64 <570ed0ab77e53a4980c3d376c9f9854c> <redacted>/App.app/Frameworks/MapboxCoreMaps.framework/MapboxCoreMaps
0x106570000 - 0x1068e3fff MapboxMaps arm64 <2eff174ac49b3f238cf7534f968a92c3> <redacted>/App.app/Frameworks/MapboxMaps.framework/MapboxMaps
0x32c738000 - 0x32c7b619f libdispatch.dylib arm64 <164c031dbfe33165a1281036168aea62> /usr/lib/system/libdispatch.dylib
0x43454e000 - 0x43456963f MetalKit arm64 <c8cf106997723e5a9415b434b416a852> /System/Library/Frameworks/MetalKit.framework/MetalKit
0x4832ea000 - 0x48348fc5f AGXMetalA10 arm64 <1e373aa01ed63e0ab36225610c862847> /System/Library/Extensions/AGXMetalA10.bundle/AGXMetalA10
Expected behavior
No crash. The iPad 7th generation (A10) runs iPadOS 18, and 11.31.1 runs on it without problems.
Notes / preliminary analysis
Since 11.32.0, MapboxCoreMaps includes Google Highway. In the iOS arm64 slice, Highway's aligned allocator compiles to an ARMv8.1 LSE atomic (ldadd) with no runtime check that the CPU supports it. A10 and older chips are ARMv8.0 and don't have LSE, so the instruction traps.
We checked the iOS device slices of each release:
| Version | Highway present | Unguarded ldadd |
|---|---|---|
| 11.23.1, 11.28.0, 11.31.0, 11.31.1 | No | No |
| 11.32.x, 11.33.x, 11.34.x, 11.35.0-rc.1 | Yes | 1 |
The CocoaPods and SPM builds use the same xcframework-dynamic.zip, so they're equally affected.
Android isn't affected. In 11.34.1's libmapbox-maps.so, all 6 ldadd sites use outline atomics (a runtime LSE check with an LL/SC fallback), and there's no Highway.
Suggested fix: build Highway (or at least aligned_allocator.cc) for the iOS arm64 slice targeting plain armv8-a, or with -moutline-atomics, so it runs on ARMv8.0.
Workaround: pin MapboxMaps to 11.31.1 on iOS, at the cost of later fixes.
Additional links and references
- Highway aligned allocator: https://github.com/google/highway/blob/master/hwy/aligned_allocator.cc
- Lingua principale
- Swift
- Stelle
- 601
- Fork
- 198
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di mapbox/mapbox-maps-ios
-
auto-triaged bug :beetle: p2
Difficoltà 4/5 3-5 giorni Idoneità per principianti 28/100
mapbox/mapbox-maps-ios#2461 ·
-
auto-triaged bug :beetle: p1
Difficoltà 4/5 3-5 giorni Idoneità per principianti 18/100
mapbox/mapbox-maps-ios#2460 ·
-
auto-triaged bug :beetle: p2
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
mapbox/mapbox-maps-ios#2459 ·
-
auto-triaged bug :beetle: p1
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
mapbox/mapbox-maps-ios#2456 · 1 commento ·
-
auto-triaged bug :beetle: p1
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
mapbox/mapbox-maps-ios#2453 · 1 commento ·
Tutte le issue di mapbox/mapbox-maps-ios
Issue simili
-
good first issue help wanted
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
erkamyaman/rust-anything#930 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
SwiftOldDriver/iOS-Weekly#5528 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
compiler-explorer/compiler-explorer#9710 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
altstoreio/AltStore#1887 ·
I maintainer di solito rispondono entro 3 giorni
-
bug source:tester
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
alexandrereol/ethmensa#56 ·
I maintainer di solito rispondono entro 1 giorno