Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[iOS] Stack overflow in _UIHostingView._hitTest with keyboard open on a page (8.0.2 and 9.0.4, New Architecture)

オープン
#1,144 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
活発
技術スタック
ios, react-native, swift
領域
mobile

調査の方向性

まず、影響を受ける物理 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's PressableScale), 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

  • PagerView with scrollEnabled={false} (pages are switched only via ref.setPage), 14 pages, all mounted (onboarding flow inside a react-native-screens native stack).
  • One page contains a TextInput with autoFocus inside KeyboardAwareScrollView from 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 PagerView with a plain ScrollView-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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

callstack/react-native-pager-view のほかの issue

callstack/react-native-pager-view の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。