getsentry / sentry-cocoa

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

Crash on monitorCachedData - Attempted to dereference null pointer SentryCrashCachedData.c:145 #3608

Open grzegorzkrukowski opened 8 months ago

grzegorzkrukowski commented 8 months ago

Platform

macOS

Environment

Production

Installed

Swift Package Manager

Version

8.19.0

Did it work on previous versions?

No response

Steps to Reproduce

We were not able to reproduce it in the development environment, but we are getting constant crash reports to Sentry about it.

Thread 1 (Crashed)
0   libsystem_kernel.dylib          0x315d0a808         __semwait_signal
1   libsystem_c.dylib               0x315ac3270         nanosleep
2   libsystem_c.dylib               0x315acc03c         sleep
3   Raycast                         0x2020ad2fc         monitorCachedData (SentryCrashCachedData.c:145)
4   libsystem_pthread.dylib         0x315d82f9c         _pthread_start

Thread 2 name: SentryCrash Exception Handler (Secondary)
0   libsystem_kernel.dylib          0x315d07214         mach_msg2_trap
1   libsystem_kernel.dylib          0x315d19b40         mach_msg2_internal
2   libsystem_kernel.dylib          0x315d0fe50         mach_msg_overwrite
3   libsystem_kernel.dylib          0x315d07594         mach_msg
4   Raycast                         0x2020a94c4         handleExceptions (SentryCrashMonitor_MachException.c:314)
5   libsystem_pthread.dylib         0x315d82f9c         _pthread_start

Thread 4 name: com.apple.NSEventThread
0   libsystem_kernel.dylib          0x315d07214         mach_msg2_trap
1   libsystem_kernel.dylib          0x315d19b40         mach_msg2_internal
2   libsystem_kernel.dylib          0x315d0fe50         mach_msg_overwrite
3   libsystem_kernel.dylib          0x315d07594         mach_msg
4   CoreFoundation                  0x315eca0e4         __CFRunLoopServiceMachPort
5   CoreFoundation                  0x315ec89a8         __CFRunLoopRun
6   CoreFoundation                  0x315ec7e98         CFRunLoopRunSpecific
7   AppKit                          0x31d0b1b58         _NSEventThread
8   libsystem_pthread.dylib         0x315d82f9c         _pthread_start

Thread 5 name: com.apple.CFStream.LegacyThread
0   libsystem_kernel.dylib          0x315d07214         mach_msg2_trap
1   libsystem_kernel.dylib          0x315d19b40         mach_msg2_internal
2   libsystem_kernel.dylib          0x315d0fe50         mach_msg_overwrite
3   libsystem_kernel.dylib          0x315d07594         mach_msg
4   CoreFoundation                  0x315eca0e4         __CFRunLoopServiceMachPort
5   CoreFoundation                  0x315ec89a8         __CFRunLoopRun
6   CoreFoundation                  0x315ec7e98         CFRunLoopRunSpecific
7   CoreFoundation                  0x315f3f1b4         _legacyStreamRunLoop_workThread
8   libsystem_pthread.dylib         0x315d82f9c         _pthread_start

Thread 6 name: com.apple.NSURLConnectionLoader
0   libsystem_kernel.dylib          0x315d07214         mach_msg2_trap
1   libsystem_kernel.dylib          0x315d19b40         mach_msg2_internal
2   libsystem_kernel.dylib          0x315d0fe50         mach_msg_overwrite
3   libsystem_kernel.dylib          0x315d07594         mach_msg
4   CoreFoundation                  0x315eca0e4         __CFRunLoopServiceMachPort
5   CoreFoundation                  0x315ec89a8         __CFRunLoopRun
6   CoreFoundation                  0x315ec7e98         CFRunLoopRunSpecific
7   CFNetwork                       0x3205d290c         estimatedPropertyListSize
8   Foundation                      0x31814accc         __NSThread__start__
9   libsystem_pthread.dylib         0x315d82f9c         _pthread_start

Thread 7
0   libsystem_kernel.dylib          0x315d07214         mach_msg2_trap
1   libsystem_kernel.dylib          0x315d19b40         mach_msg2_internal
2   libsystem_kernel.dylib          0x315d0fe50         mach_msg_overwrite
3   libsystem_kernel.dylib          0x315d07594         mach_msg
4   libxpc.dylib                    0x3157b97ec         _xpc_pipe_mach_msg
5   libxpc.dylib                    0x31579ed24         _xpc_send_serializer
6   libxpc.dylib                    0x3157a4440         _xpc_pipe_simpleroutine
7   libsystem_trace.dylib           0x31582d340         ___os_activity_stream_reflect_block_invoke
8   libdispatch.dylib               0x315a243e4         _dispatch_client_callout
9   libdispatch.dylib               0x315a27e7c         _dispatch_block_invoke_direct
10  libdispatch.dylib               0x315a27d4c         dispatch_block_perform
11  libsystem_trace.dylib           0x31582cd7c         _os_activity_stream_reflect
12  libsystem_trace.dylib           0x31583373c         _os_log_impl_stream
13  libsystem_trace.dylib           0x315824a14         _os_log_impl_flatten_and_send
14  libsystem_trace.dylib           0x315822c28         _os_log
15  libsystem_trace.dylib           0x315822b78         _os_log_impl
16  Network                         0x324914aa8         nw_endpoint_flow_receive_report
17  Network                         0x32444c100         nw_endpoint_handler_report
18  Network                         0x32445cc10         nw_endpoint_handler_start
19  Network                         0x324913fe8         nw_endpoint_flow_start_child
20  Network                         0x32490fa6c         nw_endpoint_flow_setup_protocols
21  Network                         0x32492b268         -[NWConcrete_nw_endpoint_flow startWithHandler:]
22  Network                         0x3244538bc         nw_endpoint_handler_path_change
23  Network                         0x32445ce78         nw_endpoint_handler_start
24  Network                         0x3243af88c         __nw_connection_start_block_invoke
25  Network                         0x3243af258         nw_connection_start
26  CFNetwork                       0x3204c07cc         CFURLDownloadCancel
27  CFNetwork                       0x3204b8988         CFURLDownloadCancel
28  CFNetwork                       0x3204b995c         CFURLDownloadCancel
29  CFNetwork                       0x320508b74         _CFNetworkErrorGetLocalizedDescription
30  CFNetwork                       0x3204b855c         CFURLDownloadCancel
31  CFNetwork                       0x3203990d0         CFURLRequestGetMainDocumentURL
32  CFNetwork                       0x320508048         _CFNetworkErrorGetLocalizedDescription
33  CFNetwork                       0x3205081e4         _CFNetworkErrorGetLocalizedDescription
34  libdispatch.dylib               0x315a2274c         _dispatch_call_block_and_release
35  libdispatch.dylib               0x315a243e4         _dispatch_client_callout
36  libdispatch.dylib               0x315a2ba10         _dispatch_lane_serial_drain
37  libdispatch.dylib               0x315a2c574         _dispatch_lane_invoke
38  libdispatch.dylib               0x315a2d894         _dispatch_workloop_invoke
39  libdispatch.dylib               0x315a372cc         _dispatch_root_queue_drain_deferred_wlh
40  libdispatch.dylib               0x315a36b40         _dispatch_workloop_worker_thread
41  libsystem_pthread.dylib         0x315d7f014         _pthread_wqthread

Expected Result

Not crashing

Actual Result

Crash

Are you willing to submit a PR?

No response

brustolin commented 8 months ago

Thanks @grzegorzkrukowski for reporting this. We'll investigate it.

philipphofmann commented 8 months ago

I see a couple of occurrences in our internal SDK crashes project.

grzegorzkrukowski commented 6 months ago

Is there any update on this one ? it keeps happening in our Application on the latest version still

kahest commented 6 months ago

Hey @grzegorzkrukowski, no update as yet, this is hard to reproduce without further information. Please let us know if you have/receive any more context.

For our reference, there are some similar but not identical issues reported on KSCrash