sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

EXC_BAD_ACCESS > UIViewController > addBreadcrumb: > Attempted to dereference garbage pointer

Open raganw opened this issue 6 years ago • 2 comments

OS:

  • [ ] Windows
  • [X] MacOS
  • [ ] Linux

Platform:

  • [X] iOS
  • [ ] Android

SDK:

  • [X] @sentry/react-native (>= 1.0.0)
  • [ ] react-native-sentry (<= 0.43.2)

SDK version: 1.4.0

react-native version: 0.61.5

Are you using Expo?

  • [ ] Yes
  • [X] No

Are you using sentry.io or on-premise?

  • [X] sentry.io (SaaS)
  • [ ] on-premise

If you are using sentry.io, please post a link to your issue so we can take a look:

Link to issue

Configuration:

(@sentry/react-native)

Sentry.init({
  dsn: 'https://[email protected]/...'
  beforeBreadcrumb: function (breadcrumb: Breadcrumb): Breadcrumb | null {
    // discard chatty UI Lifecycle events (not very useful in react-native)
    if (breadcrumb.category === "ui.lifecycle") {
      return null;
    }

    return breadcrumb;
  },
});

I have following issue:

After upgrading to @sentry/react-native v1.4.0, we are experiencing a hard application crash when launching our application with the above Sentry.init. Removing the beforeBreadcrumb config allows the app to start without issue, however if we do not filter the breadcrumbs the Sentry reporting for application is not as useful. Additionally, running the application with a debugger (Chrome / React Native Debugger) the application does not crash with the beforeBreadcrumb config in place.

Stacktrace

OS Version: iOS 13.3 (18G4032)
Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: BUS_NOOP at 0x00007fff80618070
Crashed Thread: 0

Application Specific Information:
addBreadcrumb: >
Attempted to dereference garbage pointer 0x7fff80618070.

Thread 0 Crashed:
0   <unknown>                       0x7fff80618070      __CFAllocatorClass
1   Scanner                         0x10fd40b9d         +[SentrySDK addBreadcrumb:] (SentrySDK.m:161)
2   Scanner                         0x10fcebec8         -[SentryBreadcrumbTracker addEnabledCrumb] (SentryBreadcrumbTracker.m:92)
3   Scanner                         0x10fceb57b         -[SentryBreadcrumbTracker start] (SentryBreadcrumbTracker.m:18)
4   Scanner                         0x10fceab62         -[SentryAutoBreadcrumbTrackingIntegration enableAutomaticBreadcrumbTracking] (SentryAutoBreadcrumbTrackingIntegration.m:24)
5   Scanner                         0x10fceab0a         -[SentryAutoBreadcrumbTrackingIntegration installWithOptions:] (SentryAutoBreadcrumbTrackingIntegration.m:19)
6   Scanner                         0x10fd41329         +[SentrySDK installIntegrations] (SentrySDK.m:224)
7   Scanner                         0x10fd3fe4a         +[SentrySDK startWithOptionsObject:] (SentrySDK.m:83)
8   Scanner                         0x10f9a5d95         -[RNSentry startWithOptions:resolve:rejecter:] (RNSentry.m:59)
9   CoreFoundation                  0xfffe4c04220c      __invoking___
10  CoreFoundation                  0xfffe4c03f3af      -[NSInvocation invoke]
11  CoreFoundation                  0xfffe4c03f684      -[NSInvocation invokeWithTarget:]
12  Scanner                         0x10fa619d1         -[RCTModuleMethod invokeWithBridge:module:arguments:] (RCTModuleMethod.mm:569)
13  Scanner                         0x10fa65b06         facebook::react::invokeInner (RCTNativeModule.mm:108)
14  Scanner                         0x10fa65612         facebook::react::RCTNativeModule::invoke::lambda::operator() (RCTNativeModule.mm:73)
15  Scanner                         0x10fa65588         facebook::react::RCTNativeModule::invoke (RCTNativeModule.mm:65)
16  libdispatch.dylib               0xfffe824cc848      _dispatch_call_block_and_release
17  libdispatch.dylib               0xfffe824cd7b9      _dispatch_client_callout
18  libdispatch.dylib               0xfffe824d9c9b      _dispatch_main_queue_callback_4CF
19  CoreFoundation                  0xfffe4bf9e049      __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
20  CoreFoundation                  0xfffe4bf98ca9      __CFRunLoopRun
21  CoreFoundation                  0xfffe4bf98066      CFRunLoopRunSpecific
22  GraphicsServices                0xfffe606e0bb0      GSEventRunModal
23  UIKitCore                       0xfffe76714d4d      UIApplicationMain
24  Scanner                         0x10f7a629f         main (main.m:14)
25  libdyld.dylib                   0xfffe8d8c3c25      start

Steps to reproduce:

  • Upgrade from v1.3.9 to v1.4.0 of @sentry/react-native
  • Build and launch app on iOS
  • App immediately closes

Actual result:

Application closes immediately upon load of the compiled JS bundle

Expected result:

Application runs as normal

raganw avatar May 27 '20 22:05 raganw

In an effort to troubleshoot the issue, I replaced the beforeBreadcrumb with an integrations function and encountered an error identical to this one

raganw avatar May 27 '20 22:05 raganw

I have the same issue

gustperz avatar May 27 '20 22:05 gustperz