Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash EXC_BAD_ACCESS on iOS with Sentry replay #4350

Open
xiniria opened this issue Dec 9, 2024 · 2 comments
Open

Crash EXC_BAD_ACCESS on iOS with Sentry replay #4350

xiniria opened this issue Dec 9, 2024 · 2 comments

Comments

@xiniria
Copy link

xiniria commented Dec 9, 2024

What React Native libraries do you use?

React Navigation, Expo Application Services (EAS)

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

6.3.0

How does your development environment look like?

System:
  OS: macOS 15.1.1
  CPU: (10) arm64 Apple M1 Max
  Memory: 1.04 GB / 64.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.10.0
    path: /private/tmp/xfs-9d705d66/node
  Yarn:
    version: 4.5.1
    path: /private/tmp/xfs-9d705d66/yarn
  npm:
    version: 10.2.3
    path: ~/.local/state/fnm_multishells/38113_1733743619755/bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/raphael/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.1
      - iOS 18.1
      - macOS 15.1
      - tvOS 18.1
      - visionOS 2.1
      - watchOS 11.1
  Android SDK: Not Found
IDEs:
  Android Studio: EAP AI-242.23726.103.2422.12630895 AI-242.23726.103.2422.12630895
  Xcode:
    version: 16.1/16B40
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /Users/raphael/.jenv/shims/javac
  Ruby:
    version: 3.2.1
    path: /Users/raphael/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.75.2
    wanted: 0.75.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Sentry.init()

Sentry.init({
    dsn: "https://...sentry.io/...",
    release: Application.nativeApplicationVersion ?? "Unknown",
    dist: Application.nativeBuildVersion ?? "Unknown",
    environment: appEnv.env,
    tracesSampleRate: 1.0,
    profilesSampleRate: 1.0,
    _experiments: {
      replaysSessionSampleRate: appEnv.sentryReplaysSessionSampleRate,
      replaysOnErrorSampleRate: appEnv.sentryReplaysOnErrorSampleRate,
    },
    integrations: [
      Sentry.hermesProfilingIntegration(),
      Sentry.reactNativeTracingIntegration(),
      Sentry.mobileReplayIntegration({
        maskAllText: appEnv.sentryMaskAllText,
        maskAllImages: appEnv.sentryMaskAllImage,
        maskAllVectors: appEnv.sentryMaskAllVectors,
      }),
    ],
  });

Steps to Reproduce

A bit specific, but this is what I've managed to learn:

  • I only reproduce the crash with a 2020 iPhone SE (2nd generation), running iOS 16.7.2
  • I only reproduce when pressing a button that opens a bottom sheet (we use @gorhom/bottom-sheet)
  • Thanks to Sentry, we get a pretty detailed log of the crash (see below), and I'm pretty sure it's Sentry-related because SentryViewPhotographer.image shows up in the stacktrace (but I could be wrong)

Expected Result

No crash

Actual Result

If you have access to it, here is the actual issue: https://urgo-medical.sentry.io/issues/6122170713/?alert_rule_id=15532000&alert_type=issue&notification_uuid=bf409987-5ef5-4442-b1a2-7f617f81e426&project=4508205799309312

Else, here is the detailed error : EXC_BAD_ACCESS

Exception 1, Code 1, Subcode 8 >
KERN_INVALID_ADDRESS at 0x8.

OS Version: iOS 16.7.2 (20H115)
Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: SEGV_NOOP at 0x0000000000000008
Crashed Thread: 7

Application Specific Information:
Exception 1, Code 1, Subcode 8 >
KERN_INVALID_ADDRESS at 0x8.

Thread 7 Crashed:
0   CoreGraphics                    0x31650ff4c         CGGStateClipToPath
1   CoreGraphics                    0x316307670         [inlined] <redacted>
2   CoreGraphics                    0x316307670         <redacted>
3   HealicoRNSTAGING                0x2052495f8         closure in SentryViewPhotographer.image
4   HealicoRNSTAGING                0x20524a7bc         [inlined] thunk for closure
5   HealicoRNSTAGING                0x20524a7bc         thunk for closure
6   HealicoRNSTAGING                0x204a532a0         thunk for closure
7   UIKitCore                       0x3170a5148         <redacted>
8   UIKitCore                       0x3170a4fdc         <redacted>
9   UIKitCore                       0x3170a4f08         <redacted>
10  HealicoRNSTAGING                0x205248d08         closure in SentryViewPhotographer.image (SentryViewPhotographer.swift:46)
11  HealicoRNSTAGING                0x20432986c         thunk for closure
12  HealicoRNSTAGING                0x2051bcc34         __53-[SentryDispatchQueueWrapper dispatchAsyncWithBlock:]_block_invoke (SentryDispatchQueueWrapper.m:32)
13  libdispatch.dylib               0x3217b6320         <redacted>
14  libdispatch.dylib               0x3217b7eac         <redacted>
15  libdispatch.dylib               0x3217bf534         <redacted>
16  libdispatch.dylib               0x3217c00a4         <redacted>
17  libdispatch.dylib               0x3217cacdc         <redacted>
18  libsystem_pthread.dylib         0x3d2aceddc         _pthread_wqthread

Thread 0
0   QuartzCore                      0x3158ba058         <redacted>
1   QuartzCore                      0x31591e744         <redacted>
2   QuartzCore                      0x315875648         <redacted>
3   QuartzCore                      0x3158b7e2c         <redacted>
4   QuartzCore                      0x315883270         <redacted>
5   QuartzCore                      0x315892f64         <redacted>
6   CoreFoundation                  0x312e8bce4         <redacted>
7   CoreFoundation                  0x312ea90d8         <redacted>
8   CoreFoundation                  0x312eaadc8         <redacted>
9   CoreFoundation                  0x312e8c5e8         <redacted>
10  CoreFoundation                  0x312e9137c         CFRunLoopRunSpecific
11  GraphicsServices                0x38995d35c         GSEventRunModal
12  UIKitCore                       0x31728cf58         <redacted>
13  UIKitCore                       0x31728cbbc         UIApplicationMain
14  HealicoRNSTAGING                0x2041d0410         main (main.m:7)
15  <unknown>                       0x1ab3acdec         <redacted>

Thread 1
0   libsystem_kernel.dylib          0x390db11ac         __workq_kernreturn
1   libsystem_pthread.dylib         0x3d2acee28         _pthread_wqthread

Thread 2
0   libsystem_kernel.dylib          0x390db11ac         __workq_kernreturn
1   libsystem_pthread.dylib         0x3d2acee28         _pthread_wqthread

Thread 3
0   libsystem_kernel.dylib          0x390db11ac         __workq_kernreturn
1   libsystem_pthread.dylib         0x3d2acee28         _pthread_wqthread

Thread 4 name: com.apple.uikit.eventfetch-thread
0   libsystem_kernel.dylib          0x390db0ca4         mach_msg2_trap
1   libsystem_kernel.dylib          0x390dc3b74         mach_msg2_internal
2   libsystem_kernel.dylib          0x390dc3e4c         mach_msg_overwrite
3   libsystem_kernel.dylib          0x390db11e8         mach_msg
4   CoreFoundation                  0x312e8afb4         <redacted>
5   CoreFoundation                  0x312e8c1e0         <redacted>
6   CoreFoundation                  0x312e9137c         CFRunLoopRunSpecific
7   Foundation                      0x3073cff74         <redacted>
8   Foundation                      0x3073cfe5c         <redacted>
9   UIKitCore                       0x3173bfcc8         <redacted>
10  Foundation                      0x3073e94e4         <redacted>
11  libsystem_pthread.dylib         0x3d2acf6b8         _pthread_start

Thread 5
0   libsystem_kernel.dylib          0x390db11ac         __workq_kernreturn
1   libsystem_pthread.dylib         0x3d2acee28         _pthread_wqthread

Thread 6 name: com.google.firebase.crashlytics.MachExceptionServer
0   libsystem_kernel.dylib          0x390db0ca4         mach_msg2_trap
1   libsystem_kernel.dylib          0x390dc3b74         mach_msg2_internal
2   libsystem_kernel.dylib          0x390dc3e4c         mach_msg_overwrite
3   libsystem_kernel.dylib          0x390db11e8         mach_msg
4   HealicoRNSTAGING                0x204ba265c         [inlined] FIRCLSMachExceptionReadMessage (FIRCLSMachException.c:192)
5   HealicoRNSTAGING                0x204ba265c         FIRCLSMachExceptionServer (FIRCLSMachException.c:168)
6   libsystem_pthread.dylib         0x3d2acf6b8         _pthread_start

Thread 7 Crashed:
0   CoreGraphics                    0x31650ff4c         CGGStateClipToPath
1   CoreGraphics                    0x316307670         [inlined] <redacted>
2   CoreGraphics                    0x316307670         <redacted>
3   HealicoRNSTAGING                0x2052495f8         closure in SentryViewPhotographer.image
4   HealicoRNSTAGING                0x20524a7bc         [inlined] thunk for closure
5   HealicoRNSTAGING                0x20524a7bc         thunk for closure
6   HealicoRNSTAGING                0x204a532a0         thunk for closure
7   UIKitCore                       0x3170a5148         <redacted>
8   UIKitCore                       0x3170a4fdc         <redacted>
9   UIKitCore                       0x3170a4f08         <redacted>
10  HealicoRNSTAGING                0x205248d08         closure in SentryViewPhotographer.image (SentryViewPhotographer.swift:46)
11  HealicoRNSTAGING                0x20432986c         thunk for closure
12  HealicoRNSTAGING                0x2051bcc34         __53-[SentryDispatchQueueWrapper dispatchAsyncWithBlock:]_block_invoke (SentryDispatchQueueWrapper.m:32)
13  libdispatch.dylib               0x3217b6320         <redacted>
14  libdispatch.dylib               0x3217b7eac         <redacted>
15  libdispatch.dylib               0x3217bf534         <redacted>
16  libdispatch.dylib               0x3217c00a4         <redacted>
17  libdispatch.dylib               0x3217cacdc         <redacted>
18  libsystem_pthread.dylib         0x3d2aceddc         _pthread_wqthread

Thread 8
0   libsystem_kernel.dylib          0x390db1164         __semwait_signal
1   libsystem_c.dylib               0x3218478a0         nanosleep
2   libsystem_c.dylib               0x321858b1c         sleep
3   HealicoRNSTAGING                0x20519b9e8         monitorCachedData (SentryCrashCachedData.c:146)
4   libsystem_pthread.dylib         0x3d2acf6b8         _pthread_start

Thread 9 name: SentryCrash Exception Handler (Secondary)
0   libsystem_kernel.dylib          0x390db0ca4         mach_msg2_trap
1   libsystem_kernel.dylib          0x390dc3b74         mach_msg2_internal
2   libsystem_kernel.dylib          0x390dc3e4c         mach_msg_overwrite
3   libsystem_kernel.dylib          0x390db11e8         mach_msg
4   HealicoRNSTAGING                0x2051a6348         handleExceptions (SentryCrashMonitor_MachException.c:313)
5   libsystem_pthread.dylib         0x3d2acf6b8         _pthread_start

Thread 11 name: io.sentry.app-hang-tracker
0   libsystem_kernel.dylib          0x390db1164         __semwait_signal
1   libsystem_c.dylib               0x3218478a0         nanosleep
2   Foundation                      0x30744076c         <redacted>
3   HealicoRNSTAGING                0x20518634c         -[SentryANRTrackerV1 detectANRs] (SentryANRTrackerV1.m:105)
4   Foundation                      0x3073e94e4         <redacted>
5   libsystem_pthread.dylib         0x3d2acf6b8         _pthread_start

Thread 12
0   libsystem_kernel.dylib          0x390db11ac         __workq_kernreturn
1   libsystem_pthread.dylib         0x3d2acee28         _pthread_wqthread

Thread 13
0   libsystem_kernel.dylib          0x390db11ac         __workq_kernreturn
1   libsystem_pthread.dylib         0x3d2acee28         _pthread_wqthread

Thread 14 name: com.apple.NSURLConnectionLoader
0   libsystem_kernel.dylib          0x390db0ca4         mach_msg2_trap
1   libsystem_kernel.dylib          0x390dc3b74         mach_msg2_internal
2   libsystem_kernel.dylib          0x390dc3e4c         mach_msg_overwrite
3   libsystem_kernel.dylib          0x390db11e8         mach_msg
4   CoreFoundation                  0x312e8afb4         <redacted>
5   CoreFoundation                  0x312e8c1e0         <redacted>
6   CoreFoundation                  0x312e9137c         CFRunLoopRunSpecific
7   CFNetwork                       0x31508e6f0         _CFURLStorageSessionDisableCache
8   Foundation                      0x3073e94e4         <redacted>
9   libsystem_pthread.dylib         0x3d2acf6b8         _pthread_start

Thread 15
0   libsystem_kernel.dylib          0x390db11ac         __workq_kernreturn
1   libsystem_pthread.dylib         0x3d2acee28         _pthread_wqthread

Thread 16
0   libsystem_kernel.dylib          0x390db11ac         __workq_kernreturn
1   libsystem_pthread.dylib         0x3d2acee28         _pthread_wqthread

Thread 17
0   libsystem_kernel.dylib          0x390db11ac         __workq_kernreturn
1   libsystem_pthread.dylib         0x3d2acee28         _pthread_wqthread

Thread 18
0   libsystem_kernel.dylib          0x390db0ca4         mach_msg2_trap
1   libsystem_kernel.dylib          0x390dc3b74         mach_msg2_internal
2   libsystem_kernel.dylib          0x390dc3e4c         mach_msg_overwrite
3   libsystem_kernel.dylib          0x390db11e8         mach_msg
4   CoreFoundation                  0x312e8afb4         <redacted>
5   CoreFoundation                  0x312e8c1e0         <redacted>
6   CoreFoundation                  0x312e9137c         CFRunLoopRunSpecific
7   HealicoRNSTAGING                0x204fea9ac         +[RCTCxxBridge runRunLoop] (RCTCxxBridge.mm:328)
8   Foundation                      0x3073e94e4         <redacted>
9   libsystem_pthread.dylib         0x3d2acf6b8         _pthread_start

Thread 19
0   libsystem_kernel.dylib          0x390db1578         __psynch_cvwait
1   libsystem_pthread.dylib         0x3d2ad6078         <redacted>
2   libc++.1.dylib                  0x32fabaef8         std::__1::condition_variable::wait
3   hermes                          0x1073b8f20         hermes::vm::HadesGC::Executor::worker
4   hermes                          0x1073b8e88         std::__1::__thread_proxy[abi:v160006]<T>
5   libsystem_pthread.dylib         0x3d2acf6b8         _pthread_start

Thread 20
0   libsystem_kernel.dylib          0x390db1578         __psynch_cvwait
1   libsystem_pthread.dylib         0x3d2ad6078         <redacted>
2   libc++.1.dylib                  0x32fabaef8         std::__1::condition_variable::wait
3   hermes                          0x1073b8f20         hermes::vm::HadesGC::Executor::worker
4   hermes                          0x1073b8e88         std::__1::__thread_proxy[abi:v160006]<T>
5   libsystem_pthread.dylib         0x3d2acf6b8         _pthread_start

Thread 7 crashed with ARM Thread State (64-bit):
    x0: 0x00000002812994c0   x1: 0x0000000283ff2180   x2: 0x0000000000000001   x3: 0x000000028129b2e5
    x4: 0x0000000000000005   x5: 0x00000000000032e0   x6: 0x0000000000000004   x7: 0x406da00000000000
    x8: 0x0000000000000000   x9: 0x0000000043545854  x10: 0x0000000400008880  x11: 0x0000000282541f88
   x12: 0x0000000300008880  x13: 0x0000000118908f30  x14: 0x01000001e27cb2e1  x15: 0x00000001e27cb2e0
   x16: 0x000000000000f974  x17: 0x000000000000f974  x18: 0x0000000000000000  x19: 0x00000002812994c0
   x20: 0x0000000283ff2180  x21: 0x0000000000000001  x22: 0x0000000105af6000  x23: 0x0000000000000000
   x24: 0x0000000283ff2300  x25: 0x3ff0000000000000  x26: 0x406da00000000000  x27: 0x0000000000000001
   x28: 0x0000000000000003   fp: 0x000000016c2c63e0   lr: 0x41283e818d87d670   sp: 0x000000016c2c63c0
    pc: 0x000000018da85f4c cpsr: 0x0000000080000000



EOF
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Dec 9, 2024
@github-project-automation github-project-automation bot moved this to Needs Discussion in Mobile & Cross Platform SDK Dec 9, 2024
@xiniria xiniria changed the title Crash EXC_BAD_ACCESS on iOS Crash EXC_BAD_ACCESS on iOS with Sentry replay Dec 9, 2024
@ignaciosantise
Copy link

ignaciosantise commented Dec 9, 2024

+1 happening on RN 0.74.3 and Sentry 6.4.0, without the new architecture enabled

@kahest
Copy link
Member

kahest commented Dec 11, 2024

Thanks for the report - this is most likely a duplicate of getsentry/sentry-cocoa#4558 but we'll keep it open here to track progress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Product Owner
Status: Needs Discussion
Development

No branches or pull requests

3 participants