[iOS] Stack overflow in _UIHostingView._hitTest with keyboard open on a page (8.0.2 and 9.0.4, New Architecture)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
調査の方向性
まず、影響を受ける物理 iOS デバイスで、提供された PagerView とキーボードのシーケンスを再現し、その後 Sentry の hit-test trace を調査します。SwiftUI のホスティングパスと、単純な ScrollView ベースの pager を比較し、RNGestureHandlerButton.mm の 75、121、270 行目を確認します。v8/v9 ホスティングレイヤーが再帰を引き起こしているかどうかを明らかにし、テスト済みの修正または緩和策を文書化できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 3.4k
- フォーク
- 485
- 平均マージ
- 2日 12時間
- マージ済み PR(30日)
- 24
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
callstack/react-native-pager-view のほかの issue
-
iOS: PagerScrollDelegate proxies to itself and overflows the stack when the weak originalDelegate dies対応中かも @lvlrSajjad が 35 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
callstack/react-native-pager-view#1146 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
callstack/react-native-pager-view#1141 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
callstack/react-native-pager-view#1099 · コメント 8 件 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
callstack/react-native-pager-view#1081 · コメント 1 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[iOS 15] Tab indicator does not update when switching pages after SwiftUI migration (v8)対応中かも @d-mato が 4 日前に担当しました。 オープンios
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
callstack/react-native-pager-view#1080 · コメント 2 件 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
callstack/react-native-pager-view の issue をすべて見る
似ている issue
-
bug priority: P2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
wayfinder:task
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
bug customer-reported data-plane question Service Attention Storage
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
Azure/azure-rest-api-specs#47397 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Claude thinking budget can shrink capped Haiku responses to 2,048 tokens対応中かも @DavyMassoneto が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
diegosouzapw/OmniRoute#17109 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
paperclipai/paperclip#16785 ·
メンテナーはふだん 1 日以内に返信