dyerc / Doughnut

Podcast client (podcatcher) for Mac
https://doughnutapp.com
GNU General Public License v3.0
210 stars 20 forks source link

Crash out of nowhere #120

Open woj-tek opened 1 year ago

woj-tek commented 1 year ago

Steps to Reproduce:

  1. I hit cmd+r to refresh the feeds and in a moment Doughnut crashed

Crash Report:

https://gist.github.com/woj-tek/92a6aaefe72add54ac75a79603106a23

Crash Report ``` Incident Identifier: 54DCF2D4-5FC1-407D-942B-89BD74A235E9 Hardware Model: MacBookPro18,1 Process: Doughnut [55224] Path: /Applications/Doughnut.app/Contents/MacOS/Doughnut Identifier: com.cdyer.doughnut Version: 2.0.1 (1666453501) Code Type: ARM-64 Parent Process: launchd [1] Date/Time: 2023-04-24 12:43:54 +0000 OS Version: Mac OS X 13.3.1 (22E261) Report Version: 104 Exception Type: SIGTRAP Exception Codes: #0 at 0x1a6a53d88 Crashed Thread: 5 Thread 0: 0 libswiftCore.dylib 0x00000001b589beb4 swift_retain + 64 1 Doughnut 0x0000000104c3a5d8 _mh_execute_header + 58840 2 Doughnut 0x0000000104c8494c _mh_execute_header + 362828 3 Doughnut 0x0000000104c7f570 _mh_execute_header + 341360 4 libdispatch.dylib 0x00000001a665e874 _dispatch_call_block_and_release + 32 5 libdispatch.dylib 0x00000001a6660400 _dispatch_client_callout + 20 6 libdispatch.dylib 0x00000001a666ebf8 _dispatch_main_queue_drain + 928 7 libdispatch.dylib 0x00000001a666e848 _dispatch_main_queue_callback_4CF + 44 8 CoreFoundation 0x00000001a692fc88 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 9 CoreFoundation 0x00000001a68ed4a8 __CFRunLoopRun + 1992 10 CoreFoundation 0x00000001a68ec58c CFRunLoopRunSpecific + 612 11 HIToolbox 0x00000001b0121df4 RunCurrentEventLoopInMode + 292 12 HIToolbox 0x00000001b0121c30 ReceiveNextEventCommon + 648 13 HIToolbox 0x00000001b0121988 _BlockUntilNextEventMatchingListInModeWithFilter + 76 14 AppKit 0x00000001a9b0bf58 _DPSNextEvent + 636 15 AppKit 0x00000001a9b0b0f4 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716 16 AppKit 0x00000001a9aff558 -[NSApplication run] + 464 17 AppKit 0x00000001a9ad69a8 NSApplicationMain + 880 18 Doughnut 0x0000000104c2f630 _mh_execute_header + 13872 19 ??? 0x00000001a64b7f28 0x0 + 0 Thread 1: 0 libsystem_kernel.dylib 0x00000001a67cff14 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x00000001a67d8b78 mach_msg_overwrite + 604 2 libsystem_kernel.dylib 0x00000001a67d0290 mach_msg + 24 3 QuartzCore 0x00000001ade0be20 _ZN2CA6Render6Server13server_threadEPv + 564 4 QuartzCore 0x00000001ade0bbdc _ZL10thread_funPv + 32 5 libsystem_pthread.dylib 0x00000001a680ffa8 _pthread_start + 148 6 libsystem_pthread.dylib 0x00000001a680ada0 thread_start + 8 Thread 2: 0 libsystem_kernel.dylib 0x00000001a67cff14 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x00000001a67d8b78 mach_msg_overwrite + 604 2 libsystem_kernel.dylib 0x00000001a67d0290 mach_msg + 24 3 CoreFoundation 0x00000001a68ee8b8 __CFRunLoopServiceMachPort + 160 4 CoreFoundation 0x00000001a68ed198 __CFRunLoopRun + 1208 5 CoreFoundation 0x00000001a68ec58c CFRunLoopRunSpecific + 612 6 AppKit 0x00000001a9c36508 _NSEventThread + 172 7 libsystem_pthread.dylib 0x00000001a680ffa8 _pthread_start + 148 8 libsystem_pthread.dylib 0x00000001a680ada0 thread_start + 8 Thread 3: 0 libsystem_kernel.dylib 0x00000001a67cff14 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x00000001a67d8b78 mach_msg_overwrite + 604 2 libsystem_kernel.dylib 0x00000001a67d0290 mach_msg + 24 3 CoreFoundation 0x00000001a68ee8b8 __CFRunLoopServiceMachPort + 160 4 CoreFoundation 0x00000001a68ed198 __CFRunLoopRun + 1208 5 CoreFoundation 0x00000001a68ec58c CFRunLoopRunSpecific + 612 6 CFNetwork 0x00000001ab2c7dd8 _CFURLStorageSessionDisableCache + 40092 7 Foundation 0x00000001a785e63c __NSThread__start__ + 716 8 libsystem_pthread.dylib 0x00000001a680ffa8 _pthread_start + 148 9 libsystem_pthread.dylib 0x00000001a680ada0 thread_start + 8 Thread 4: 0 libsystem_kernel.dylib 0x00000001a67cfe90 semaphore_wait_trap + 8 1 libdispatch.dylib 0x00000001a6661050 _dispatch_semaphore_wait_slow + 132 2 CFNetwork 0x00000001ab1921dc CFURLConnectionSendSynchronousRequest + 356 3 CFNetwork 0x00000001ab1bff48 CFURLConnectionInvalidateConnectionCache + 8836 4 Foundation 0x00000001a782ca9c -[NSData(NSData) initWithContentsOfURL:options:maxLength:error:] + 240 5 Doughnut 0x0000000104c62cf4 _mh_execute_header + 224500 6 Doughnut 0x0000000104cbdbd8 _ZN7plcrash3PL_5async35plcrash_async_dwarf_expression_evalIyxEE15plcrash_error_tP21plcrash_async_mobjectjPK26plcrash_async_thread_statePK23plcrash_async_byteorderyxyPT_mSD_ + 107444 7 Doughnut 0x0000000104c6080c _mh_execute_header + 215052 8 Doughnut 0x0000000104c84640 _mh_execute_header + 362048 9 Doughnut 0x0000000104c7f570 _mh_execute_header + 341360 10 libdispatch.dylib 0x00000001a665e874 _dispatch_call_block_and_release + 32 11 libdispatch.dylib 0x00000001a6660400 _dispatch_client_callout + 20 12 libdispatch.dylib 0x00000001a6667a88 _dispatch_lane_serial_drain + 668 13 libdispatch.dylib 0x00000001a66685f8 _dispatch_lane_invoke + 384 14 libdispatch.dylib 0x00000001a6673244 _dispatch_workloop_worker_thread + 648 15 libsystem_pthread.dylib 0x00000001a680c074 _pthread_wqthread + 288 16 libsystem_pthread.dylib 0x00000001a680ad94 start_wqthread + 8 Thread 5 Crashed: 0 CoreFoundation 0x00000001a6a53d88 _CFRelease.cold.3 + 84 1 CoreFoundation 0x00000001a69c2a3c _CFRelease + 488 2 Doughnut 0x0000000104c6b93c _mh_execute_header + 260412 3 Doughnut 0x0000000104c60420 _mh_execute_header + 214048 4 Doughnut 0x0000000104c609a8 _mh_execute_header + 215464 5 Doughnut 0x0000000104c84640 _mh_execute_header + 362048 6 Doughnut 0x0000000104c7f570 _mh_execute_header + 341360 7 libdispatch.dylib 0x00000001a665e874 _dispatch_call_block_and_release + 32 8 libdispatch.dylib 0x00000001a6660400 _dispatch_client_callout + 20 9 libdispatch.dylib 0x00000001a6667a88 _dispatch_lane_serial_drain + 668 10 libdispatch.dylib 0x00000001a66685f8 _dispatch_lane_invoke + 384 11 libdispatch.dylib 0x00000001a6673244 _dispatch_workloop_worker_thread + 648 12 libsystem_pthread.dylib 0x00000001a680c074 _pthread_wqthread + 288 13 libsystem_pthread.dylib 0x00000001a680ad94 start_wqthread + 8 Thread 6: 0 libsystem_kernel.dylib 0x00000001a67d1bc8 __workq_kernreturn + 8 1 libsystem_pthread.dylib 0x00000001a680ad94 start_wqthread + 8 Thread 7: 0 libsystem_kernel.dylib 0x00000001a67d1bc8 __workq_kernreturn + 8 1 libsystem_pthread.dylib 0x00000001a680ad94 start_wqthread + 8 Thread 8: 0 libsystem_kernel.dylib 0x00000001a67d3710 __psynch_cvwait + 8 1 JavaScriptCore 0x00000001c0d5aa90 scavenger_thread_main + 1620 2 libsystem_pthread.dylib 0x00000001a680ffa8 _pthread_start + 148 3 libsystem_pthread.dylib 0x00000001a680ada0 thread_start + 8 Thread 9: 0 libsystem_pthread.dylib 0x00000001a680ad8c start_wqthread + 0 Thread 10: 0 libsystem_kernel.dylib 0x00000001a67d1bc8 __workq_kernreturn + 8 1 libsystem_pthread.dylib 0x00000001a680ad94 start_wqthread + 8 Thread 11: 0 libsystem_kernel.dylib 0x00000001a67d1bc8 __workq_kernreturn + 8 1 libsystem_pthread.dylib 0x00000001a680ad94 start_wqthread + 8 Thread 12: 0 libsystem_pthread.dylib 0x00000001a680ad8c start_wqthread + 0 Thread 13: 0 libsystem_kernel.dylib 0x00000001a67dd114 __guarded_open_dprotected_np + 8 1 libsqlite3.dylib 0x00000001ac94cbe4 robust_open2 + 304 2 libsqlite3.dylib 0x00000001ac8b5764 unixOpen + 2040 3 libsqlite3.dylib 0x00000001ac8febe8 pager_write + 836 4 libsqlite3.dylib 0x00000001ac965c1c btreeOverwriteContent + 376 5 libsqlite3.dylib 0x00000001ac965960 btreeOverwriteCell + 548 6 libsqlite3.dylib 0x00000001ac8e7808 sqlite3VdbeExec + 29000 7 libsqlite3.dylib 0x00000001ac8df25c sqlite3_step + 988 8 Doughnut 0x0000000104d1d718 _ZN7plcrash3PL_5async35plcrash_async_dwarf_expression_evalIyxEE15plcrash_error_tP21plcrash_async_mobjectjPK26plcrash_async_thread_statePK23plcrash_async_byteorderyxyPT_mSD_ + 499444 9 Doughnut 0x0000000104d3f9a8 _ZN7plcrash3PL_5async35plcrash_async_dwarf_expression_evalIyxEE15plcrash_error_tP21plcrash_async_mobjectjPK26plcrash_async_thread_statePK23plcrash_async_byteorderyxyPT_mSD_ + 639364 10 Doughnut 0x0000000104e698fc _ZN7plcrash3PL_5async35plcrash_async_dwarf_expression_evalIyxEE15plcrash_error_tP21plcrash_async_mobjectjPK26plcrash_async_thread_statePK23plcrash_async_byteorderyxyPT_mSD_ + 1859800 11 Doughnut 0x0000000104ddb04c _ZN7plcrash3PL_5async35plcrash_async_dwarf_expression_evalIyxEE15plcrash_error_tP21plcrash_async_mobjectjPK26plcrash_async_thread_statePK23plcrash_async_byteorderyxyPT_mSD_ + 1275944 12 Doughnut 0x0000000104ddb214 _ZN7plcrash3PL_5async35plcrash_async_dwarf_expression_evalIyxEE15plcrash_error_tP21plcrash_async_mobjectjPK26plcrash_async_thread_statePK23plcrash_async_byteorderyxyPT_mSD_ + 1276400 13 Doughnut 0x0000000104c862d8 _mh_execute_header + 369368 14 Doughnut 0x0000000104c86a6c _mh_execute_header + 371308 15 Doughnut 0x0000000104d78368 _ZN7plcrash3PL_5async35plcrash_async_dwarf_expression_evalIyxEE15plcrash_error_tP21plcrash_async_mobjectjPK26plcrash_async_thread_statePK23plcrash_async_byteorderyxyPT_mSD_ + 871236 16 Doughnut 0x0000000104d7b7b8 _ZN7plcrash3PL_5async35plcrash_async_dwarf_expression_evalIyxEE15plcrash_error_tP21plcrash_async_mobjectjPK26plcrash_async_thread_statePK23plcrash_async_byteorderyxyPT_mSD_ + 884628 17 Doughnut 0x0000000104d7b774 _ZN7plcrash3PL_5async35plcrash_async_dwarf_expression_evalIyxEE15plcrash_error_tP21plcrash_async_mobjectjPK26plcrash_async_thread_statePK23plcrash_async_byteorderyxyPT_mSD_ + 884560 18 Doughnut 0x0000000104d1fb60 _ZN7plcrash3PL_5async35plcrash_async_dwarf_expression_evalIyxEE15plcrash_error_tP21plcrash_async_mobjectjPK26plcrash_async_thread_statePK23plcrash_async_byteorderyxyPT_mSD_ + 508732 19 Doughnut 0x0000000104d781e8 _ZN7plcrash3PL_5async35plcrash_async_dwarf_expression_evalIyxEE15plcrash_error_tP21plcrash_async_mobjectjPK26plcrash_async_thread_statePK23plcrash_async_byteorderyxyPT_mSD_ + 870852 20 Doughnut 0x0000000104e13d5c _ZN7plcrash3PL_5async35plcrash_async_dwarf_expression_evalIyxEE15plcrash_error_tP21plcrash_async_mobjectjPK26plcrash_async_thread_statePK23plcrash_async_byteorderyxyPT_mSD_ + 1508664 21 Doughnut 0x0000000104c7f570 _mh_execute_header + 341360 22 libdispatch.dylib 0x00000001a665e874 _dispatch_call_block_and_release + 32 23 libdispatch.dylib 0x00000001a6660400 _dispatch_client_callout + 20 24 libdispatch.dylib 0x00000001a6667a88 _dispatch_lane_serial_drain + 668 25 libdispatch.dylib 0x00000001a66685f8 _dispatch_lane_invoke + 384 26 libdispatch.dylib 0x00000001a6673244 _dispatch_workloop_worker_thread + 648 27 libsystem_pthread.dylib 0x00000001a680c074 _pthread_wqthread + 288 28 libsystem_pthread.dylib 0x00000001a680ad94 start_wqthread + 8 Thread 14: 0 libsystem_kernel.dylib 0x00000001a67d1bc8 __workq_kernreturn + 8 1 libsystem_pthread.dylib 0x00000001a680ad94 start_wqthread + 8 Thread 15: 0 libsystem_kernel.dylib 0x00000001a67d1bc8 __workq_kernreturn + 8 1 libsystem_pthread.dylib 0x00000001a680ad94 start_wqthread + 8 Thread 16: 0 libsystem_kernel.dylib 0x00000001a67d1bc8 __workq_kernreturn + 8 1 libsystem_pthread.dylib 0x00000001a680ad94 start_wqthread + 8 Thread 5 crashed with ARM-64 Thread State: pc: 0x00000001a6a53d88 fp: 0x000000016b48a0c0 sp: 0x000000016b48a090 x0: 0x0000000000000042 x1: 0x00000001a6bfd3c2 x2: 0x0000000000000000 x3: 0x000000016b48a11a x4: 0x00000001a6720a6f x5: 0x000000016b48a090 x6: 0x0000000000000029 x7: 0x0000000000000000 x8: 0x000000020218d000 x9: 0xa197dedf3cbf00c7 x10: 0x0000000000000200 x11: 0x000000016b489c00 x12: 0x0000000000000008 x13: 0x000000016408de80 x14: 0x0100000201c8c5b1 x15: 0x0000000201c8c5b0 x16: 0x00000001a6631c44 x17: 0x00000002067997d8 x18: 0x0000000000000000 x19: 0x000000016b48a0d8 x20: 0x0000000000000007 x21: 0x4000600007a93c60 x22: 0x0000000202b42c50 x23: 0x000000000060078c x24: 0x000000016b48a240 x25: 0x000000016b48a230 x26: 0x4000600001bc2400 x27: 0x4000600003b5b930 x28: 0x0000000000000010 lr: 0x00000001a6a53d80 cpsr: 0x0000000060001000 Binary Images: 0x104c2c000 - 0x104f13fff +Doughnut arm64 /Applications/Doughnut.app/Contents/MacOS/Doughnut 0x105194000 - 0x1051dbfff Sparkle arm64 /Applications/Doughnut.app/Contents/Frameworks/Sparkle.framework/Versions/A/Sparkle 0x10facc000 - 0x10fad7fff libobjc-trampolines.dylib arm64e <80f14f3dd0993693a8e0eb9a526b1790> /usr/lib/libobjc-trampolines.dylib 0x12af64000 - 0x12afcffff AppleMetalOpenGLRenderer arm64e <7651840df2683deaab6e979cd46d3b2b> /System/Library/Extensions/AppleMetalOpenGLRenderer.bundle/Contents/MacOS/AppleMetalOpenGLRenderer 0x12ea04000 - 0x12f027fff AudioCodecs arm64e <4a2ec8d82cba38d988058f82c8cca42a> /System/Library/Components/AudioCodecs.component/Contents/MacOS/AudioCodecs 0x1a646c000 - 0x1a64b1f3f libobjc.A.dylib arm64e <25a3d3ea8a9e3a8fbecc0199e4ed6f94> /usr/lib/libobjc.A.dylib 0x1a6541000 - 0x1a6545ffc libsystem_blocks.dylib arm64e <13a186a4d10233cd8318f25095f1b8d9> /usr/lib/system/libsystem_blocks.dylib 0x1a6546000 - 0x1a6589fff libxpc.dylib arm64e /usr/lib/system/libxpc.dylib 0x1a658a000 - 0x1a65a4fff libsystem_trace.dylib arm64e <84e13796ae2431e0be7a81c759aadcaf> /usr/lib/system/libsystem_trace.dylib 0x1a65a5000 - 0x1a662ffff libcorecrypto.dylib arm64e /usr/lib/system/libcorecrypto.dylib 0x1a6630000 - 0x1a665bffb libsystem_malloc.dylib arm64e <1232a551508f3e67a9431b8344b2140a> /usr/lib/system/libsystem_malloc.dylib 0x1a665c000 - 0x1a66a3fff libdispatch.dylib arm64e <8e87dc0ea5703933b37d5e05ad516206> /usr/lib/system/libdispatch.dylib 0x1a66a4000 - 0x1a66a6ffb libsystem_featureflags.dylib arm64e <3f3f5f35a8c937a893657bad8aaf3e5f> /usr/lib/system/libsystem_featureflags.dylib 0x1a66a7000 - 0x1a6725ff7 libsystem_c.dylib arm64e <9277aff73cc330d099b7c62680da95cf> /usr/lib/system/libsystem_c.dylib 0x1a6726000 - 0x1a67b2ff7 libc++.1.dylib arm64e <79cab92f5e0331e7b2bdfeafdfd2bbde> /usr/lib/libc++.1.dylib 0x1a67b3000 - 0x1a67cefff libc++abi.dylib arm64e /usr/lib/libc++abi.dylib 0x1a67cf000 - 0x1a6808fe7 libsystem_kernel.dylib arm64e <7acbd9bcd056310e858d81b116cf6d28> /usr/lib/system/libsystem_kernel.dylib … ```
GetToSet commented 1 year ago
Thread 5 Crashed:
0   CoreFoundation                      0x00000001a6a53d88 _CFRelease.cold.3 + 84
1   CoreFoundation                      0x00000001a69c2a3c _CFRelease + 488
2   Doughnut                            0x0000000104c6b93c Episode.parse(feedItem:) (in Doughnut) (Episode.swift:183)
3   Doughnut                            0x0000000104c60420 Podcast.parse(feed:) (in Doughnut) (Podcast.swift:270)
4   Doughnut                            0x0000000104c609a8 Podcast.fetch() (in Doughnut) (Podcast.swift:296)
5   Doughnut                            0x0000000104c84640 closure #1 in Library.reload(podcast:onQueue:) (in Doughnut) (Library.swift:396)
6   Doughnut                            0x0000000104c7f570 thunk for @escaping @callee_guaranteed () -> () (in Doughnut) (<compiler-generated>:0)
7   libdispatch.dylib                   0x00000001a665e874 _dispatch_call_block_and_release + 32
8   libdispatch.dylib                   0x00000001a6660400 _dispatch_client_callout + 20
9   libdispatch.dylib                   0x00000001a6667a88 _dispatch_lane_serial_drain + 668
10  libdispatch.dylib                   0x00000001a66685f8 _dispatch_lane_invoke + 384
11  libdispatch.dylib                   0x00000001a6673244 _dispatch_workloop_worker_thread + 648
12  libsystem_pthread.dylib             0x00000001a680c074 _pthread_wqthread + 288
13  libsystem_pthread.dylib             0x00000001a680ad94 start_wqthread + 8

Thread 0:
0   libswiftCore.dylib                  0x00000001b589beb4 swift_retain + 64
1   Doughnut                            0x0000000104c3a5d8 PodcastViewController.reload(forChangedPodcasts:) (in Doughnut) (PodcastViewController.swift:156)
2   Doughnut                            0x0000000104c8494c closure #1 in closure #1 in Library.reload(podcast:onQueue:) (in Doughnut) (<compiler-generated>:0)
3   Doughnut                            0x0000000104c7f570 thunk for @escaping @callee_guaranteed () -> () (in Doughnut) (<compiler-generated>:0)
4   libdispatch.dylib                   0x00000001a665e874 _dispatch_call_block_and_release + 32
5   libdispatch.dylib                   0x00000001a6660400 _dispatch_client_callout + 20
6   libdispatch.dylib                   0x00000001a666ebf8 _dispatch_main_queue_drain + 928
7   libdispatch.dylib                   0x00000001a666e848 _dispatch_main_queue_callback_4CF + 44
8   CoreFoundation                      0x00000001a692fc88 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
9   CoreFoundation                      0x00000001a68ed4a8 __CFRunLoopRun + 1992
10  CoreFoundation                      0x00000001a68ec58c CFRunLoopRunSpecific + 612
11  HIToolbox                           0x00000001b0121df4 RunCurrentEventLoopInMode + 292
12  HIToolbox                           0x00000001b0121c30 ReceiveNextEventCommon + 648
13  HIToolbox                           0x00000001b0121988 _BlockUntilNextEventMatchingListInModeWithFilter + 76
14  AppKit                              0x00000001a9b0bf58 _DPSNextEvent + 636
15  AppKit                              0x00000001a9b0b0f4 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
16  AppKit                              0x00000001a9aff558 -[NSApplication run] + 464
17  AppKit                              0x00000001a9ad69a8 NSApplicationMain + 880
18  Doughnut                            0x0000000104c2f630 _mh_execute_header + 13872
19  ???                                 0x00000001a64b7f28 0x0 + 0

Interesting crash hrere, I'll have a closer look at that tomorrow.

GetToSet commented 1 year ago

I believe the crash is caused by mutating the Podcast instance in the worker thread while it's being accessed from the UI. I'll see how to fix that.