[iOS] Stack overflow in _UIHostingView._hitTest with keyboard open on a page (8.0.2 and 9.0.4, New Architecture)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia riproducendo la sequenza fornita di PagerView e tastiera su un dispositivo iOS fisico interessato, quindi esamina il trace di hit-test di Sentry. Confronta il percorso di hosting di SwiftUI con il pager basato su ScrollView e rivedi RNGestureHandlerButton.mm alle righe 75, 121 e 270. Il lavoro è completato quando è stato stabilito se il livello di hosting v8/v9 causa la ricorsione e viene documentato un fix o una mitigazione testata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
On iOS the app crashes with EXC_BAD_ACCESS / stack overflow inside _UIHostingView._hitTest while a page of PagerView has the software keyboard open (or has just dismissed it). The main thread shows ~70 consecutive _UIHostingView._hitTest frames (the trace is trimmed to 100 frames, so the real depth is larger) before it reaches the React Native hit-test path and runs out of stack.
It happens with 8.0.2 and with 9.0.4 (same stack), so none of the 8.0.3–9.0.4 changes (page wrapper as UIViewControllerRepresentable, ignoresSafeArea, hosting-controller reparenting in 9.0.2, setPage fix in 9.0.4) address it. 6.x (UIKit UIPageViewController) never crashed here.
Over the last 30 days: 27 crashes from 17 distinct users, roughly every fourth user who reached that page. Users relaunch and crash again on the same page (up to 3 times in 3 minutes). Not reproducible in the simulator so far, only on devices.
Environment
- react-native-pager-view 9.0.4 (also 8.0.2), Expo SDK 57, React Native 0.86.2, React 19.2.3, New Architecture (Fabric) enabled, Hermes
- react-native-gesture-handler 2.32.x (buttons come from
pressto'sPressableScale), react-native-keyboard-controller 1.21.9, react-native-screens 4.26, react-native-reanimated 4.5.1, react-native-safe-area-context 5.7 - iOS deployment target 16.4; crashes seen on iOS 26.1 – 26.6.1 (24 events) and iOS 18.7.7 / 18.7.8 (3 events)
- Devices: iPhone 14 Pro … iPhone 18 (iPhone14,2, 15,2, 15,3, 16,1, 16,2, 17,2, 17,3, 18,1, 18,2), iPad15,3 and iPad15,7 running the iPhone build
- App Store builds, production, breadcrumbs show
RNSScreen→UIHostingController<PagerView>→IntrospectionAnchorPlatformViewController/IntrospectionPlatformViewController
Setup that crashes
PagerViewwithscrollEnabled={false}(pages are switched only viaref.setPage), 14 pages, all mounted (onboarding flow inside areact-native-screensnative stack).- One page contains a
TextInputwithautoFocusinsideKeyboardAwareScrollViewfrom react-native-keyboard-controller, plus a few RNGH-backed buttons (pressto→RNGestureHandlerButton). - Sequence from breadcrumbs: page appears → keyboard shows (
UIKeyboardDidShowNotification) → user types → taps a button → keyboard hides → taps the primary button → crash ~2 s later. Other events crash while the keyboard is still up.
Crash (thread 0, from Sentry, oldest frame first)
_UIHostingView._hitTest ← repeated ~70 times (trimmed)
…
_UIHostingView._hitTest
ViewResponder.hitTest
ViewResponder.hitTest
MultiViewResponder.containsGlobalPoints
UIViewResponder.containsGlobalPoints
PlatformViewResponderBase.containsGlobalPoints
UIViewResponder.platformViewHitTest
-[UIView(Geometry) hitTest:withEvent:]
-[__NSSingleObjectArrayI enumerateObjectsWithOptions:usingBlock:]
__38-[UIView hitTest:withEvent:]_block_invoke
-[UIView(Geometry) _hitTest:withEvent:windowServerHitTestWindow:]
-[UIView(Geometry) hitTest:withEvent:]
-[__NSSingleObjectArrayI enumerateObjectsWithOptions:usingBlock:]
__38-[UIView hitTest:withEvent:]_block_invoke
-[UIView(Geometry) _hitTest:withEvent:windowServerHitTestWindow:]
-[RCTViewComponentView hitTest:withEvent:]
-[RCTViewComponentView betterHitTest:withEvent:]
-[RCTViewComponentView hitTest:withEvent:]
-[RCTViewComponentView betterHitTest:withEvent:]
-[RNGestureHandlerButtonComponentView hitTest:withEvent:] (RNGestureHandlerButtonComponentView.mm:270)
-[RNGestureHandlerButton hitTest:withEvent:] (RNGestureHandlerButton.mm:121)
-[RNGestureHandlerButton shouldHandleTouch:] (RNGestureHandlerButton.mm:75)
+[NSPredicate predicateWithFormat:]
+[NSPredicate predicateWithFormat:arguments:]
_qfqp2_performParsing
_qfqp2lex
strdup ← EXC_BAD_ACCESS, "Stack overflow in (null)"
Sentry title: EXC_BAD_ACCESS: isEnabled > Stack overflow in (null), mechanism mach, handled: no. Older 8.0.2 events (same stack) were symbolicated to facebook::react::concreteComponentDescriptorConstructor<T> as culprit, which is just where the stack ran out.
What we tried
- 8.0.2 → 9.0.4: no change.
- Replacing
PagerViewwith a plainScrollView-based pager (pagingEnabled,scrollEnabled={false},scrollTo) removes the crash entirely, which points at the SwiftUI hosting layer rather than at our page content.
Question
Is the SwiftUI TabView/hosting-view hit-test recursion with the keyboard open a known issue for v8/v9? Happy to provide full Sentry events (all threads) or test a build with extra logging on the affected devices.
- Lingua principale
- TypeScript
- Stelle
- 3.4k
- Fork
- 485
- Merge medio
- 2g 12h
- PR unite (30g)
- 24
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 callstack/react-native-pager-view
-
iOS: PagerScrollDelegate proxies to itself and overflows the stack when the weak originalDelegate diesForse già presa @lvlrSajjad l’ha presa 35 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
callstack/react-native-pager-view#1146 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
callstack/react-native-pager-view#1141 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
callstack/react-native-pager-view#1099 · 8 commenti · 3 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
callstack/react-native-pager-view#1081 · 1 commento · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
[iOS 15] Tab indicator does not update when switching pages after SwiftUI migration (v8)Forse già presa @d-mato l’ha presa 4 giorni fa. Apertaios
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
callstack/react-native-pager-view#1080 · 2 commenti · 3 reazioni ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di callstack/react-native-pager-view
Issue simili
-
bug priority: P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
wayfinder:task
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
bug customer-reported data-plane question Service Attention Storage
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
Azure/azure-rest-api-specs#47397 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Claude thinking budget can shrink capped Haiku responses to 2,048 tokensForse già presa @DavyMassoneto l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
diegosouzapw/OmniRoute#17109 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
paperclipai/paperclip#16785 ·
I maintainer di solito rispondono entro 1 giorno