react / react/react-native

EXC_BAD_ACCESS in production after upgrading to 0.79.6

Đang mở
#53,774 39 bình luận 20 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Needs: Attention Needs: Repro
Ngôn ngữ chính
C++
Star
127k
Fork
25.3k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
4

Mô tả

Description

We have got a lot a bunch of unhandled errors in sentry and some users are experiencing crashes after enabling new architecture and moving to RN 0.79.6:

https://lendo.sentry.io/share/issue/15101300672940039f9334b6a3dbd6cf/

Exception 1, Code 1, Subcode 2014344570531660876 >
KERN_INVALID_ADDRESS at 0x1bf463b6e5c6c44c.

Hermes engine in Podfile.lock is also updated to the latest version and it's locked to 0.79.6.

It's happening for 9 users since 2 weeks ago that we released.

Steps to reproduce

This is very hard to reproduce. I am not sure what has happened.

React Native Version

0.79.6

Affected Platforms

Runtime - iOS

Output of npx @react-native-community/cli info
info Fetching system and libraries information...
System:
  OS: macOS 15.6.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 134.56 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.18.0
    path: ~/.nvm/versions/node/v22.18.0/bin/node
  Yarn:
    version: 1.22.19
    path: ~/.nvm/versions/node/v22.18.0/bin/yarn
  npm:
    version: 10.9.3
    path: ~/.nvm/versions/node/v22.18.0/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.16.1
    path: /Users/xxxx/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.5
      - iOS 18.5
      - macOS 15.5
      - tvOS 18.5
      - visionOS 2.5
      - watchOS 11.5
  Android SDK:
    API Levels:
      - "28"
      - "29"
      - "30"
      - "31"
      - "33"
      - "34"
      - "35"
      - "36"
    Build Tools:
      - 28.0.3
      - 29.0.2
      - 30.0.3
      - 33.0.1
      - 34.0.0
      - 35.0.0
      - 36.0.0
    System Images:
      - android-33-ext4 | Google Play ARM 64 v8a
      - android-34-ext12 | Google Play ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.3 AI-243.26053.27.2432.13536105
  Xcode:
    version: 16.4/16F6
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 3.2.2
    path: /Users/xxxx/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 18.0.0
    wanted: 18.0.0
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.79.6
    wanted: 0.79.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

info React Native v0.81.4 is now available (your project is running on v0.79.6).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.81.4
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.79.6&to=0.81.4
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".
Stacktrace or Logs
OS Version: iOS 18.6.2 (22G100)
Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: SEGV_NOOP at 0x1bf463b6e5c6c44c
Crashed Thread: 8

Application Specific Information:
Exception 1, Code 1, Subcode 2014344570531660876 >
KERN_INVALID_ADDRESS at 0x1bf463b6e5c6c44c.

Thread 8 Crashed:
0   KreddyMobile                    0x2039cd910         [inlined] facebook::react::Scheduler::uiManagerDidFinishTransaction::lambda::operator() (Scheduler.cpp:266)
1   KreddyMobile                    0x2039cd910         [inlined] std::__1::__invoke[abi:ne180100]<T> (invoke.h:344)
2   KreddyMobile                    0x2039cd910         [inlined] std::__1::__invoke_void_return_wrapper<T>::__call[abi:ne180100]<T> (invoke.h:419)
3   KreddyMobile                    0x2039cd910         [inlined] std::__1::__function::__alloc_func<T>::operator()[abi:ne180100] (function.h:169)
4   KreddyMobile                    0x2039cd910         std::__1::__function::__func<T>::operator() (function.h:311)
5   KreddyMobile                    0x203a77f5c         facebook::react::RuntimeScheduler_Modern::runEventLoopTick (RuntimeScheduler_Modern.cpp:340)
6   KreddyMobile                    0x203a77c30         facebook::react::RuntimeScheduler_Modern::runEventLoop (RuntimeScheduler_Modern.cpp:271)
7   KreddyMobile                    0x203a488cc         [inlined] std::__1::__function::__value_func<T>::operator()[abi:ne180100] (function.h:428)
8   KreddyMobile                    0x203a488cc         [inlined] std::__1::function<T>::operator() (function.h:981)
9   KreddyMobile                    0x203a488cc         [inlined] const::lambda::operator() (ReactInstance.cpp:83)
10  KreddyMobile                    0x203a488cc         [inlined] std::__1::__invoke[abi:ne180100]<T> (invoke.h:344)
11  KreddyMobile                    0x203a488cc         [inlined] std::__1::__invoke_void_return_wrapper<T>::__call[abi:ne180100]<T> (invoke.h:419)
12  KreddyMobile                    0x203a488cc         [inlined] std::__1::__function::__alloc_func<T>::operator()[abi:ne180100] (function.h:169)
13  KreddyMobile                    0x203a488cc         std::__1::__function::__func<T>::operator() (function.h:311)
14  KreddyMobile                    0x2038edbe8         [inlined] std::__1::__function::__value_func<T>::operator()[abi:ne180100] (function.h:428)
15  KreddyMobile                    0x2038edbe8         [inlined] std::__1::function<T>::operator() (function.h:981)
16  KreddyMobile                    0x2038edbe8         facebook::react::tryAndReturnError (RCTCxxUtils.mm:73)
17  KreddyMobile                    0x2038fc084         facebook::react::RCTMessageThread::tryFunc (RCTMessageThread.mm:68)
18  KreddyMobile                    0x2038fbe88         [inlined] std::__1::__function::__value_func<T>::operator()[abi:ne180100] (function.h:428)
19  KreddyMobile                    0x2038fbe88         [inlined] std::__1::function<T>::operator() (function.h:981)
20  KreddyMobile                    0x2038fbe88         facebook::react::RCTMessageThread::runAsync (RCTMessageThread.mm:44)
21  CoreFoundation                  0x31f0a884c         __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
22  CoreFoundation                  0x31f04b024         __CFRunLoopDoBlocks
23  CoreFoundation                  0x31f04c524         __CFRunLoopRun
24  CoreFoundation                  0x31f04dad8         CFRunLoopRunSpecific
25  KreddyMobile                    0x203a445a4         +[RCTJSThreadManager runRunLoop] (RCTJSThreadManager.mm:102)
26  Foundation                      0x31c9a3800         __NSThread__start__
27  libsystem_pthread.dylib         0x4339ab340         _pthread_start
MANDATORY Reproducer

N/A

Screenshots and Videos

No response

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với Scheduler.cpp quanh dòng 266, sau đó lần theo lời gọi qua RuntimeScheduler_Modern.cpp, ReactInstance.cpp và RCTMessageThread.mm như được hiển thị trong stack trace. So sánh thiết lập kiến trúc mới của iOS và Hermes cho 0.79.6 với các báo cáo crash. Hoàn tất khi xác định được nguyên nhân của EXC_BAD_ACCESS và xác minh fix theo đường dẫn crash này.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
ios, react-native
Lĩnh vực
mobile-dev
Loại issue
Lỗi
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.