getsentry / sentry-cocoa

The official Sentry SDK for iOS, tvOS, macOS, watchOS.
https://sentry.io/for/cocoa/
MIT License
797 stars 315 forks source link

EXC_BAD_ACCESS in setField(SentryScopeSyncC.c:27) in Widget #3226

Open lsnunn opened 1 year ago

lsnunn commented 1 year ago

Platform

iOS

Installed

CocoaPods

Version

8.8.0 and 8.3.2

Steps to Reproduce

Not sure. Crash appears to be originating within Sentry SDK when it adds an automatic breadcrumb. We tried updating from 8.3.2 to 8.8.0 to fix it but we are still getting the issue.

Expected Result

Normal app usage

Actual Result

Stack Trace

OS Version: iOS 16.6 (20G75) Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: SEGV_NOOP at 0x0000000141e4c000 Crashed Thread: 18

Application Specific Information: ":"error","timestamp":"2023-08-14T09:57:45.913Z","type":"http"} > 4T09:57:45.913Z","type":"http"} > KERN_INVALID_ADDRESS at 0x141e4c000.

Thread 18 Crashed: 0 Sentry 0x10483d4b0 setField (SentryScopeSyncC.c:27) 1 Sentry 0x10483d4ac setField (SentryScopeSyncC.c:27) 2 Sentry 0x10483d548 sentrycrash_scopesync_addBreadcrumb (SentryScopeSyncC.c:86) 3 Sentry 0x10480be5c -[SentryCrashScopeObserver addSerializedBreadcrumb:] (SentryCrashScopeObserver.m:95) 4 Sentry 0x10483aee8 -[SentryScope addBreadcrumb:] (SentryScope.m:142) 5 Sentry 0x1048200fc -[SentryHub addBreadcrumb:] (SentryHub.m:528) 6 Sentry 0x10483f4f0 +[SentrySDK addBreadcrumb:] (SentrySDK.m:325) 7 Sentry 0x104828bb8 -[SentryNetworkTracker addBreadcrumbForSessionTask:] (SentryNetworkTracker.m:432) 8 Sentry 0x104827a94 -[SentryNetworkTracker urlSessionTask:setState:] (SentryNetworkTracker.m:267) 9 Sentry 0x104829394 __57+[SentryNetworkTrackingIntegration swizzleURLSessionTask]_block_invoke_2.27 (SentryNetworkTrackingIntegration.m:72) 10 CFNetwork 0x33a9a26a8 _CFNetworkErrorGetLocalizedRecoverySuggestion 11 CFNetwork 0x33a99e1d4 CFHTTPCookieCopyDomain 12 CFNetwork 0x33a9d4830 _CFNetworkCopyATSContext 13 CFNetwork 0x33a9adae8 CFURLRequestSetURL 14 CFNetwork 0x33a99e7cc CFHTTPCookieCopyDomain 15 CFNetwork 0x33a9adae8 CFURLRequestSetURL 16 CFNetwork 0x33a9add20 CFURLRequestSetURL 17 CFNetwork 0x33a9cf018 CFURLRequestSetShouldStartSynchronously 18 CFNetwork 0x33a9b97a0 CFURLRequestCopyHTTPRequestBodyStream 19 libdispatch.dylib 0x34731efc0 _dispatch_block_async_invoke2 20 libdispatch.dylib 0x34730fea8 _dispatch_client_callout 21 libdispatch.dylib 0x347317530 _dispatch_lane_serial_drain 22 libdispatch.dylib 0x3473180d4 _dispatch_lane_invoke 23 libdispatch.dylib 0x347322cd8 _dispatch_workloop_worker_thread 24 libsystem_pthread.dylib 0x3f85e6dd8 _pthread_wqthread

Lots of OS Versions

image

Are you willing to submit a PR?

probably not

brustolin commented 1 year ago

Hello @lsnunn, thanks for reaching out. Can you replicate this, or are you simply encountering it randomly in your crash reports?

lsnunn commented 1 year ago

We can't replicate it. In the Sentry Issue there are no in-app frames or breadcrumbs showing an action in the app. Also it is occurring in an iOS Widget. It appears to happen in the Sentry SDK right after breadcrumb tracking starts. image

brustolin commented 1 year ago

Ok, this is for the widget then? Good to know. And only in the widget does this error occurs?

lsnunn commented 1 year ago

Yea only in the widget

brustolin commented 1 year ago

Thanks for all the information! We'll investigate this.