react / react/react-native

Getting Crash In Ios Device

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

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

Needs: Attention Needs: Repro Platform: iOS
主要言語
C++
スター
127k
フォーク
25.3k
平均マージ
1日 23時間
マージ済み PR(30日)
4

説明

Description

The app crashes on iOS in the React Native TurboModule thread (com.meta.react.turbomodulemanager.queue) while running on the Hermes JavaScript engine.

The crash occurs when a native TurboModule throws an Objective-C NSException, and React Native attempts to convert that exception into a JavaScript error. During this conversion, Hermes fails while dynamically adding a property to a JS object, leading to a fatal crash inside hermes::vm::HiddenClass::addProperty.

This indicates an issue in native-to-JS error bridging, likely caused by:

An uncaught NSException inside a TurboModule method

Invalid or unexpected data being set on a JS object from native code

Improper error handling in a custom or third-party TurboModule

Steps to reproduce

The app crashes randomly on the com.meta.react.turbomodulemanager.queue thread.

React Native Version

0.82.1

Affected Platforms

Runtime - iOS

Output of npx @react-native-community/cli info
System:
  OS: macOS 26.2
  CPU: (8) arm64 Apple M1
  Memory: 151.78 MB / 8.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 25.2.1
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.19
    path: /usr/local/bin/yarn
  npm:
    version: 11.6.2
    path: /usr/local/bin/npm
  Watchman:
    version: 2025.12.22.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/appinlay/.rvm/gems/ruby-3.2.2/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.2
      - iOS 26.2
      - macOS 26.2
      - tvOS 26.2
      - visionOS 26.2
      - watchOS 26.2
  Android SDK:
    API Levels:
      - "31"
      - "33"
      - "34"
      - "35"
      - "35"
      - "36"
      - "36"
      - "36"
    Build Tools:
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 33.0.1
      - 33.0.2
      - 34.0.0
      - 35.0.0
      - 35.0.0
      - 36.0.0
    System Images:
      - android-35 | Google APIs ARM 64 v8a
      - android-36 | Pre-Release 16 KB Page Size Google Play ARM 64 v8a
      - android-36 | Pre-Release 16 KB Page Size Google Play Intel x86_64 Atom
      - android-36 | Pre-Release 16 KB Page Size Google APIs ARM 64 v8a
      - android-36 | Pre-Release 16 KB Page Size Google APIs Intel x86_64 Atom
      - android-Baklava | Pre-Release 16 KB Page Size Google APIs ARM 64 v8a
    Android NDK: 22.1.7171670
IDEs:
  Android Studio: 2025.1 AI-251.26094.121.2513.14007798
  Xcode:
    version: 26.2/17C52
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.16
    path: /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/bin/javac
  Ruby:
    version: 3.2.2
    path: /Users/appinlay/.rvm/rubies/ruby-3.2.2/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.0
    wanted: 20.0.0
  react:
    installed: 19.1.1
    wanted: ^19.1.1
  react-native:
    installed: 0.82.1
    wanted: ^0.82.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
Stacktrace or Logs
Crashed: com.meta.react.turbomodulemanager.queue
0  hermesvm                       0x40fa4 hermes::vm::JSObject::allocateNewSlotStorage(hermes::vm::Handle<hermes::vm::JSObject>, hermes::vm::Runtime&, unsigned int, hermes::vm::Handle<hermes::vm::HermesValue>) + 488
1  hermesvm                       0x4107c hermes::vm::JSObject::allocateNewSlotStorage(hermes::vm::Handle<hermes::vm::JSObject>, hermes::vm::Runtime&, unsigned int, hermes::vm::Handle<hermes::vm::HermesValue>) + 704
2  hermesvm                       0x46514 hermes::vm::JSObject::addOwnPropertyImpl(hermes::vm::Handle<hermes::vm::JSObject>, hermes::vm::Runtime&, hermes::vm::SymbolID, hermes::vm::PropertyFlags, hermes::vm::Handle<hermes::vm::HermesValue>) + 224
3  hermesvm                       0x24558 hermes::vm::Callable::defineNameLengthAndPrototype(hermes::vm::Handle<hermes::vm::Callable>, hermes::vm::Runtime&, hermes::vm::SymbolID, unsigned int, hermes::vm::Handle<hermes::vm::JSObject>, hermes::vm::Callable::WritablePrototype, bool) + 188
4  hermesvm                       0x42d18 hermes::vm::JSObject::getNamedDescriptorUnsafe(hermes::vm::Handle<hermes::vm::JSObject>, hermes::vm::Runtime&, hermes::vm::SymbolID, hermes::vm::PropertyFlags, hermes::vm::NamedPropertyDescriptor&) + 452
5  hermesvm                       0x3f73c hermes::vm::JSError::recordStackTrace(hermes::vm::Handle<hermes::vm::JSError>, hermes::vm::Runtime&, bool, hermes::vm::CodeBlock*, hermes::inst::Inst const*) + 2124
6  hermesvm                       0x93cc8 hermes::vm::constructErrorObject(hermes::vm::Runtime&, hermes::vm::NativeArgs, hermes::vm::Handle<hermes::vm::HermesValue>, hermes::vm::Handle<hermes::vm::HermesValue>, hermes::vm::Handle<hermes::vm::JSObject>) + 160
7  hermesvm                       0x92ac0 hermes::vm::ErrorConstructor(void*, hermes::vm::Runtime&, hermes::vm::NativeArgs) + 124
8  hermesvm                       0x25e78 hermes::vm::NativeFunction::_nativeCall(hermes::vm::NativeFunction*, hermes::vm::Runtime&) + 140
9  hermesvm                       0xa4e4 facebook::hermes::(anonymous namespace)::HermesRuntimeImpl::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) + 300
10 myapp                        0x3e3f48 facebook::react::TurboModuleConvertUtils::createJSRuntimeError(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) + 313 (jsi-inl.h:313)
11 myapp                        0x3e0ad0 facebook::react::TurboModuleConvertUtils::convertNSExceptionToJSError(facebook::jsi::Runtime&, NSException*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) + 230 (RCTTurboModule.mm:230)
12 myapp                        0x3e1364 invocation function for block in facebook::react::ObjCTurboModule::performVoidMethodInvocation(facebook::jsi::Runtime&, char const*, NSInvocation*, NSMutableArray*) + 473 (RCTTurboModule.mm:473)
13 myapp                        0x3e6418 std::__1::__function::__func<facebook::react::ObjCTurboModule::performVoidMethodInvocation(facebook::jsi::Runtime&, char const*, NSInvocation*, NSMutableArray*)::$_1, std::__1::allocator<facebook::react::ObjCTurboModule::performVoidMethodInvocation(facebook::jsi::Runtime&, char const*, NSInvocation*, NSMutableArray*)::$_1>, void ()>::operator()() + 180 (TraceSection.h:180)
14 libdispatch.dylib              0x1adc _dispatch_call_block_and_release + 32
15 libdispatch.dylib              0x1b7fc _dispatch_client_callout + 16
16 libdispatch.dylib              0xa468 _dispatch_lane_serial_drain + 740
17 libdispatch.dylib              0xaf44 _dispatch_lane_invoke + 388
18 libdispatch.dylib              0x153ec _dispatch_root_queue_drain_deferred_wlh + 292
19 libdispatch.dylib              0x14ce4 _dispatch_workloop_worker_thread + 692
20 libsystem_pthread.dylib        0x13b8 _pthread_wqthread + 292
21 libsystem_pthread.dylib        0x8c0 start_wqthread + 8
MANDATORY Reproducer

The app crashes randomly on the com.meta.react.turbomodulemanager.queue thread.

Screenshots and Videos

No response

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

まず RCTTurboModule.mm の convertNSExceptionToJSError と createJSRuntimeError から始め、次にスタックトレースに示されている失敗している Hermes Error の構築を追跡します。現在、この issue にはランダムなクラッシュレポートしかないため、最初に iOS 0.82.1 で再現可能な TurboModule NSException のケースを確立してください。ネイティブエラーから JavaScript エラーへの変換中に reproducer がクラッシュしなくなれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp, objective-c, react-native
領域
mobile
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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