xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.46k stars 512 forks source link

NSDateComponents URL: unrecognized selector sent to instance #19289

Closed johnconners closed 11 months ago

johnconners commented 1 year ago

I recently ported my 9 year old macOS app from Xamarin.Mac to .NET 7. I've got a crash that looks like it's happening on a worker thread, rolled out logging for Runtime.MarshalObjectiveCException and got this error. Strange thing is I'm not using NSDateComponents directly in my code and the only place I deal with NSDate is via the (DateTime) cast of an NSDate (which I get from a PHAsset when getting photos from the Photos API) and via NSDateFormatter Parse() where I pass in a string and then again cast the result.

I can't see how I'd be passing URL to NSDateComponents or even how to figure out what's happening that causes the exception. Any idea as to what I should look at to diagnose the issue?

Steps to Reproduce

  1. Not sure, I'm catching this via Runtime.MarshalObjectiveCException in production, I cannot reproduce it locally

Expected Behavior

No error reported.

Actual Behavior

The error is reported.

Environment

Version information ``` Visual Studio Community 2022 for Mac Version 17.6.5 (build 417) Installation UUID: e35afd07-22d5-4ec4-b7b5-194c044cc040 Runtime .NET 7.0.3 (64-bit) Architecture: Arm64 Microsoft.macOS.Sdk 13.1.1007; git-rev-head:8afca776a0a96613dfb7200e0917bb57f9ed5583; git-branch:release/7.0.1xx-xcode14.2 NuGet Version: 6.4.0.117 .NET SDK (Arm64) SDK: /usr/local/share/dotnet/sdk/7.0.309/Sdks SDK Versions: 7.0.309 7.0.308 6.0.415 6.0.414 MSBuild SDKs: Not installed .NET Runtime (Arm64) Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 7.0.12 7.0.11 7.0.10 7.0.7 7.0.5 7.0.2 7.0.0 6.0.23 6.0.22 6.0.21 6.0.18 6.0.16 6.0.13 6.0.11 Updater Version: 11 Apple Developer Tools Xcode: 14.3 21812 Build: 14E222b Operating System Mac OS X 13.6.0 Darwin 22.6.0 Darwin Kernel Version 22.6.0 Fri Sep 15 13:41:28 PDT 2023 root:xnu-8796.141.3.700.8~1/RELEASE_ARM64_T6000 arm64 ```

Native error and stack trace

Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[NSDateComponents URL]: unrecognized selector sent to instance 0x60000075a190

0   CoreFoundation                      0x00007ff81c3fc12a __exceptionPreprocess   242
1   libobjc.A.dylib                     0x00007ff81bf220b7 objc_exception_throw   48
2   CoreFoundation                      0x00007ff81c497fdf -[NSObject(NSObject) __retain_OA]   0
3   CoreFoundation                      0x00007ff81c367749 ___forwarding___   1392
4   CoreFoundation                      0x00007ff81c367148 _CF_forwarding_prep_0   120
5   CFNetwork                           0x00007ff820c0f047 CFURLConnectionInvalidateConnectionCache   7161
6   BackgroundSwitcher                  0x000000010ee93759 xamarin_dyn_objc_msgSend   217
7   ???                                 0x0000000119e327b3 0x0   4729284531
8   ???                                 0x000000011aebc03b 0x0   4746625083
9   ???                                 0x000000011aebb910 0x0   4746623248
10  ???                                 0x000000011acc5f4a 0x0   4744568650
11  ???                                 0x000000011acc3f6b 0x0   4744560491
12  ???                                 0x000000011ae9efd3 0x0   4746506195
13  ???                                 0x000000011ae9e6be 0x0   4746503870
14  ???                                 0x000000011ae69692 0x0   4746286738
15  ???                                 0x000000011acbfaf0 0x0   4744542960
16  ???                                 0x000000011acbfa6f 0x0   4744542831
17  ???                                 0x000000011acbf913 0x0   4744542483
18  ???                                 0x000000011acbf853 0x0   4744542291
19  ???                                 0x000000011acab20e 0x0   4744458766
20  ???                                 0x000000011aca5c44 0x0   4744436804
21  ???                                 0x000000011ac960c8 0x0   4744372424
22  ???                                 0x000000011ac94cdf 0x0   4744367327
23  ???                                 0x000000011ae66e2f 0x0   4746276399
24  ???                                 0x000000011ae5cef2 0x0   4746235634
25  libcoreclr.dylib                    0x0000000110db2f79 CallDescrWorkerInternal   124
26  libcoreclr.dylib                    0x0000000110c041ff _Z18DispatchCallSimplePmjmj   223
27  libcoreclr.dylib                    0x0000000110c1a738 _ZN12ThreadNative20KickOffThread_WorkerEPv   136
28  libcoreclr.dylib                    0x0000000110bcfb38 _ZL31ManagedThreadBase_DispatchOuterP22ManagedThreadCallState   296
29  libcoreclr.dylib                    0x0000000110bd00a0 _ZN17ManagedThreadBase7KickOffEPFvPvES0_   32
30  libcoreclr.dylib                    0x0000000110c1a80a _ZN12ThreadNative13KickOffThreadEPv   170
31  libcoreclr.dylib                    0x0000000110add3c7 _ZN7CorUnix10CPalThread11ThreadEntryEPv   407
32  libsystem_pthread.dylib             0x00007ff81c2a91d3 _pthread_start   125
33  libsystem_pthread.dylib             0x00007ff81c2a4bd3 thread_start   15
johnconners commented 1 year ago

Additionally I'm seeing the Apple crash reporting logs with this callstack. In spite of being what looks like a CLR exception, I'm not able to catch them via AppDomain.CurrentDomain.UnhandledException, Runtime.MarshalManagedException or Runtime.MarshalObjectiveCException. And prior to the switch from Xamarin.Mac to .NET 7 I never had any crashes like this.

0   libsystem_kernel.dylib          0x00007ff81adb21e2 __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007ff81ade9ee6 pthread_kill + 263 (pthread.c:1670)
2   libsystem_c.dylib               0x00007ff81ad10b45 abort + 123 (abort.c:118)
3   libcoreclr.dylib                0x000000010b097462 PROCAbort + 50
4   libcoreclr.dylib                0x000000010b097390 PROCEndProcess(void*, unsigned int, int) + 320
5   libcoreclr.dylib                0x000000010b1facd3 EEPolicy::HandleFatalError(unsigned int, unsigned long, char16_t const*, _EXCEPTION_POINTERS*, char16_t const*, char16_t const*) + 371
6   libcoreclr.dylib                0x000000010b2caa61 ProcessCLRException + 1073
7   libcoreclr.dylib                0x000000010b2cfb32 UnwindManagedExceptionPass1(PAL_SEHException&, _CONTEXT*) + 354
8   libcoreclr.dylib                0x000000010b2cfe83 DispatchManagedException(PAL_SEHException&, bool) + 67
9   libcoreclr.dylib                0x000000010b2c99e2 HandleHardwareException(PAL_SEHException*) + 658
10  libcoreclr.dylib                0x000000010b06562b SEHProcessException(PAL_SEHException*) + 315
11  libcoreclr.dylib                0x000000010b09e5fb PAL_DispatchException + 139
12  libcoreclr.dylib                0x000000010b09e283 PAL_DispatchExceptionWrapper + 10
13  ???                             0x00000001151a5c1d 0x0 + 4649016349
14  ???                             0x00000001151a7022 0x0 + 4649021474
15  ???                             0x000000011562807a 0x0 + 4653744250
16  ???                             0x00000001156275e5 0x0 + 4653741541
17  ???                             0x000000011562562d 0x0 + 4653733421
18  ???                             0x000000011561c849 0x0 + 4653697097
19  ???                             0x0000000115624e7d 0x0 + 4653731453
20  ???                             0x0000000115179648 0x0 + 4648834632
21  ???                             0x000000011517953e 0x0 + 4648834366
22  ???                             0x000000011503f7cb 0x0 + 4647548875
23  ???                             0x000000011503f558 0x0 + 4647548248
24  ???                             0x000000011562feb2 0x0 + 4653776562
25  libcoreclr.dylib                0x000000010b371f79 CallDescrWorkerInternal + 124
26  libcoreclr.dylib                0x000000010b1c31ff DispatchCallSimple(unsigned long*, unsigned int, unsigned long, unsigned int) + 223
27  libcoreclr.dylib                0x000000010b1d9738 ThreadNative::KickOffThread_Worker(void*) + 136
28  libcoreclr.dylib                0x000000010b18eb38 ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 296
29  libcoreclr.dylib                0x000000010b18f0a0 ManagedThreadBase::KickOff(void (*)(void*), void*) + 32
30  libcoreclr.dylib                0x000000010b1d980a ThreadNative::KickOffThread(void*) + 170
31  libcoreclr.dylib                0x000000010b09c3c7 CorUnix::CPalThread::ThreadEntry(void*) + 407
32  libsystem_pthread.dylib         0x00007ff81adea1d3 _pthread_start + 125 (pthread.c:893)
33  libsystem_pthread.dylib         0x00007ff81ade5bd3 thread_start + 15 (:-1)

And below is a full crash log from Apple.

Full crash log ``` Process: BackgroundSwitcher [855] Path: /Applications/John's Background Switcher.app/Contents/MacOS/BackgroundSwitcher Identifier: com.johnconners.backgroundswitcher Version: 4.0.3 (2310161318) App Item ID: 907640277 App External ID: 860700698 Code Type: X86-64 (Native) Parent Process: launchd [1] User ID: 501 Date/Time: 2023-10-21 10:08:05.5210 +0200 OS Version: macOS 13.6 (22G120) Report Version: 12 Bridge OS Version: 3.0 (14Y910) Anonymous UUID: 5782110B-BBBC-49D6-D0B4-BCF48C8D9E18 Time Awake Since Boot: 3200 seconds System Integrity Protection: enabled Crashed Thread: 19 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6 Terminating Process: BackgroundSwitcher [855] Thread 0: 0 libsystem_kernel.dylib 0x00007ff81adab5a2 mach_msg2_trap + 10 1 libsystem_kernel.dylib 0x00007ff81adb971d mach_msg2_internal + 78 (mach_msg.c:201) 2 libsystem_kernel.dylib 0x00007ff81adb25d4 mach_msg_overwrite + 692 (mach_msg.c:0) 3 libsystem_kernel.dylib 0x00007ff81adab88a mach_msg + 19 (mach_msg.c:323) 4 CoreFoundation 0x00007ff81aec600f __CFRunLoopServiceMachPort + 145 (CFRunLoop.c:2622) 5 CoreFoundation 0x00007ff81aec4a90 __CFRunLoopRun + 1365 (CFRunLoop.c:3005) 6 CoreFoundation 0x00007ff81aec3ed1 CFRunLoopRunSpecific + 560 (CFRunLoop.c:3418) 7 HIToolbox 0x00007ff824944f3d RunCurrentEventLoopInMode + 292 (EventLoop.c:455) 8 HIToolbox 0x00007ff824944d4e ReceiveNextEventCommon + 657 (EventBlocking.c:384) 9 HIToolbox 0x00007ff824944aa8 _BlockUntilNextEventMatchingListInModeWithFilter + 64 (EventBlocking.c:171) 10 AppKit 0x00007ff81df6025c _DPSNextEvent + 858 (CGDPSReplacement.m:818) 11 AppKit 0x00007ff81df5f106 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1214 (appEventRouting.m:407) 12 AppKit 0x00007ff81df51788 -[NSApplication run] + 586 (NSApplication.m:3424) 13 AppKit 0x00007ff81df259a1 NSApplicationMain + 817 (NSApplication.m:9413) 14 ??? 0x00000001143f7cf2 0x0 + 4634672370 15 ??? 0x00000001143e0a45 0x0 + 4634577477 16 libcoreclr.dylib 0x000000010b371f79 CallDescrWorkerInternal + 124 17 libcoreclr.dylib 0x000000010b1c3862 MethodDescCallSite::CallTargetWorker(unsigned long const*, unsigned long*, int) + 1522 18 libcoreclr.dylib 0x000000010b0b518e RunMain(MethodDesc*, short, int*, PtrArray**) + 734 19 libcoreclr.dylib 0x000000010b0b54c5 Assembly::ExecuteMainMethod(PtrArray**, int) + 421 20 libcoreclr.dylib 0x000000010b0dfbdb CorHost2::ExecuteAssembly(unsigned int, char16_t const*, int, char16_t const**, unsigned int*) + 619 21 libcoreclr.dylib 0x000000010b0a1684 coreclr_execute_assembly + 196 22 BackgroundSwitcher 0x00000001096b114d mono_jit_exec + 93 23 BackgroundSwitcher 0x00000001096b1a8a xamarin_main + 570 24 BackgroundSwitcher 0x00000001096b2c54 main + 52 25 dyld 0x00007ff81aa9041f start + 1903 (dyldMain.cpp:1165) Thread 1: 0 libsystem_kernel.dylib 0x00007ff81adab5a2 mach_msg2_trap + 10 1 libsystem_kernel.dylib 0x00007ff81adb971d mach_msg2_internal + 78 (mach_msg.c:201) 2 libsystem_kernel.dylib 0x00007ff81adb25d4 mach_msg_overwrite + 692 (mach_msg.c:0) 3 libsystem_kernel.dylib 0x00007ff81adab88a mach_msg + 19 (mach_msg.c:323) 4 libcoreclr.dylib 0x000000010b09f528 MachMessage::Receive(unsigned int) + 72 5 libcoreclr.dylib 0x000000010b09e77e SEHExceptionThread(void*) + 110 6 libsystem_pthread.dylib 0x00007ff81adea1d3 _pthread_start + 125 (pthread.c:893) 7 libsystem_pthread.dylib 0x00007ff81ade5bd3 thread_start + 15 (:-1) Thread 2: 0 libsystem_kernel.dylib 0x00007ff81adb228e poll + 10 1 libcoreclr.dylib 0x000000010b0901ee CorUnix::CPalSynchronizationManager::ThreadPrepareForShutdown() + 30 2 libcoreclr.dylib 0x000000010b091e05 CorUnix::CPalSynchronizationManager::WorkerThread(void*) + 933 3 libcoreclr.dylib 0x000000010b09c3c7 CorUnix::CPalThread::ThreadEntry(void*) + 407 4 libsystem_pthread.dylib 0x00007ff81adea1d3 _pthread_start + 125 (pthread.c:893) 5 libsystem_pthread.dylib 0x00007ff81ade5bd3 thread_start + 15 (:-1) Thread 3: 0 libsystem_kernel.dylib 0x00007ff81adabd46 __open + 10 1 libsystem_kernel.dylib 0x00007ff81adb4b63 open + 204 (open-base.c:101) 2 libcoreclr.dylib 0x000000010b3ddd8f TwoWayPipe::WaitForConnection() + 31 3 libcoreclr.dylib 0x000000010b3d633d DbgTransportSession::TransportWorker() + 189 4 libcoreclr.dylib 0x000000010b3d4f29 DbgTransportSession::TransportWorkerStatic(void*) + 9 5 libcoreclr.dylib 0x000000010b09c3c7 CorUnix::CPalThread::ThreadEntry(void*) + 407 6 libsystem_pthread.dylib 0x00007ff81adea1d3 _pthread_start + 125 (pthread.c:893) 7 libsystem_pthread.dylib 0x00007ff81ade5bd3 thread_start + 15 (:-1) Thread 4: 0 libsystem_kernel.dylib 0x00007ff81adae0de __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007ff81adea758 _pthread_cond_wait + 1242 (pthread_cond.c:862) 2 libcoreclr.dylib 0x000000010b08fef2 CorUnix::CPalSynchronizationManager::ThreadNativeWait(CorUnix::_ThreadNativeWaitData*, unsigned int, CorUnix::ThreadWakeupReason*, unsigned int*) + 322 3 libcoreclr.dylib 0x000000010b08fb1a CorUnix::CPalSynchronizationManager::BlockThread(CorUnix::CPalThread*, unsigned int, bool, bool, CorUnix::ThreadWakeupReason*, unsigned int*) + 362 4 libcoreclr.dylib 0x000000010b094399 CorUnix::InternalWaitForMultipleObjectsEx(CorUnix::CPalThread*, unsigned int, void* const*, int, unsigned int, int, int) + 2153 5 libcoreclr.dylib 0x000000010b094632 WaitForMultipleObjectsEx + 82 6 libcoreclr.dylib 0x000000010b3d37d9 DebuggerRCThread::MainLoop() + 217 7 libcoreclr.dylib 0x000000010b3d36ac DebuggerRCThread::ThreadProc() + 220 8 libcoreclr.dylib 0x000000010b3d341d DebuggerRCThread::ThreadProcStatic(void*) + 29 9 libcoreclr.dylib 0x000000010b09c3c7 CorUnix::CPalThread::ThreadEntry(void*) + 407 10 libsystem_pthread.dylib 0x00007ff81adea1d3 _pthread_start + 125 (pthread.c:893) 11 libsystem_pthread.dylib 0x00007ff81ade5bd3 thread_start + 15 (:-1) Thread 5: 0 libsystem_kernel.dylib 0x00007ff81adae0de __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007ff81adea758 _pthread_cond_wait + 1242 (pthread_cond.c:862) 2 libcoreclr.dylib 0x000000010b08fed5 CorUnix::CPalSynchronizationManager::ThreadNativeWait(CorUnix::_ThreadNativeWaitData*, unsigned int, CorUnix::ThreadWakeupReason*, unsigned int*) + 293 3 libcoreclr.dylib 0x000000010b08fb1a CorUnix::CPalSynchronizationManager::BlockThread(CorUnix::CPalThread*, unsigned int, bool, bool, CorUnix::ThreadWakeupReason*, unsigned int*) + 362 4 libcoreclr.dylib 0x000000010b094399 CorUnix::InternalWaitForMultipleObjectsEx(CorUnix::CPalThread*, unsigned int, void* const*, int, unsigned int, int, int) + 2153 5 libcoreclr.dylib 0x000000010b09456d WaitForSingleObjectEx + 77 6 libcoreclr.dylib 0x000000010b29990f CLREventBase::WaitEx(unsigned int, WaitMode, PendingSync*) + 191 7 libcoreclr.dylib 0x000000010b20510f FinalizerThread::WaitForFinalizerEvent(CLREvent*) + 31 8 libcoreclr.dylib 0x000000010b2052f9 FinalizerThread::FinalizerThreadWorker(void*) + 217 9 libcoreclr.dylib 0x000000010b18eb38 ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 296 10 libcoreclr.dylib 0x000000010b18f100 ManagedThreadBase::FinalizerBase(void (*)(void*)) + 32 11 libcoreclr.dylib 0x000000010b205498 FinalizerThread::FinalizerThreadStart(void*) + 88 12 libcoreclr.dylib 0x000000010b09c3c7 CorUnix::CPalThread::ThreadEntry(void*) + 407 13 libsystem_pthread.dylib 0x00007ff81adea1d3 _pthread_start + 125 (pthread.c:893) 14 libsystem_pthread.dylib 0x00007ff81ade5bd3 thread_start + 15 (:-1) Thread 6: 0 libsystem_kernel.dylib 0x00007ff81adab5a2 mach_msg2_trap + 10 1 libsystem_kernel.dylib 0x00007ff81adb971d mach_msg2_internal + 78 (mach_msg.c:201) 2 libsystem_kernel.dylib 0x00007ff81adb25d4 mach_msg_overwrite + 692 (mach_msg.c:0) 3 libsystem_kernel.dylib 0x00007ff81adab88a mach_msg + 19 (mach_msg.c:323) 4 CoreFoundation 0x00007ff81aec600f __CFRunLoopServiceMachPort + 145 (CFRunLoop.c:2622) 5 CoreFoundation 0x00007ff81aec4a90 __CFRunLoopRun + 1365 (CFRunLoop.c:3005) 6 CoreFoundation 0x00007ff81aec3ed1 CFRunLoopRunSpecific + 560 (CFRunLoop.c:3418) 7 AppKit 0x00007ff81e0c03f5 _NSEventThread + 132 (NSEvent.m:5060) 8 libsystem_pthread.dylib 0x00007ff81adea1d3 _pthread_start + 125 (pthread.c:893) 9 libsystem_pthread.dylib 0x00007ff81ade5bd3 thread_start + 15 (:-1) Thread 7: 0 libsystem_kernel.dylib 0x00007ff81adabfce read + 10 1 libSystem.Native.dylib 0x0000000109874e2f SignalHandlerLoop + 47 2 libsystem_pthread.dylib 0x00007ff81adea1d3 _pthread_start + 125 (pthread.c:893) 3 libsystem_pthread.dylib 0x00007ff81ade5bd3 thread_start + 15 (:-1) Thread 8: 0 libsystem_kernel.dylib 0x00007ff81adae0de __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007ff81adea758 _pthread_cond_wait + 1242 (pthread_cond.c:862) 2 libcoreclr.dylib 0x000000010b08fef2 CorUnix::CPalSynchronizationManager::ThreadNativeWait(CorUnix::_ThreadNativeWaitData*, unsigned int, CorUnix::ThreadWakeupReason*, unsigned int*) + 322 3 libcoreclr.dylib 0x000000010b08fb1a CorUnix::CPalSynchronizationManager::BlockThread(CorUnix::CPalThread*, unsigned int, bool, bool, CorUnix::ThreadWakeupReason*, unsigned int*) + 362 4 libcoreclr.dylib 0x000000010b094399 CorUnix::InternalWaitForMultipleObjectsEx(CorUnix::CPalThread*, unsigned int, void* const*, int, unsigned int, int, int) + 2153 5 libcoreclr.dylib 0x000000010b094632 WaitForMultipleObjectsEx + 82 6 libcoreclr.dylib 0x000000010b18b5aa Thread::DoAppropriateWaitWorker(int, void**, int, unsigned int, WaitMode) + 730 7 libcoreclr.dylib 0x000000010b186a00 Thread::DoAppropriateWait(int, void**, int, unsigned int, WaitMode, PendingSync*) + 48 8 libcoreclr.dylib 0x000000010b1e7175 WaitHandleNative::CorWaitOneNative(void*, int) + 181 9 ??? 0x00000001155ebfad 0x0 + 4653498285 10 ??? 0x0000000114e7eb30 0x0 + 4645710640 11 ??? 0x0000000114e7c390 0x0 + 4645700496 12 ??? 0x0000000114e7c2eb 0x0 + 4645700331 13 ??? 0x0000000114e7c1e6 0x0 + 4645700070 14 libcoreclr.dylib 0x000000010b371f79 CallDescrWorkerInternal + 124 15 libcoreclr.dylib 0x000000010b1c31ff DispatchCallSimple(unsigned long*, unsigned int, unsigned long, unsigned int) + 223 16 libcoreclr.dylib 0x000000010b1d9738 ThreadNative::KickOffThread_Worker(void*) + 136 17 libcoreclr.dylib 0x000000010b18eb38 ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 296 18 libcoreclr.dylib 0x000000010b18f0a0 ManagedThreadBase::KickOff(void (*)(void*), void*) + 32 19 libcoreclr.dylib 0x000000010b1d980a ThreadNative::KickOffThread(void*) + 170 20 libcoreclr.dylib 0x000000010b09c3c7 CorUnix::CPalThread::ThreadEntry(void*) + 407 21 libsystem_pthread.dylib 0x00007ff81adea1d3 _pthread_start + 125 (pthread.c:893) 22 libsystem_pthread.dylib 0x00007ff81ade5bd3 thread_start + 15 (:-1) Thread 9: 0 libsystem_kernel.dylib 0x00007ff81adae0de __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007ff81adea758 _pthread_cond_wait + 1242 (pthread_cond.c:862) 2 libcoreclr.dylib 0x000000010b08fed5 CorUnix::CPalSynchronizationManager::ThreadNativeWait(CorUnix::_ThreadNativeWaitData*, unsigned int, CorUnix::ThreadWakeupReason*, unsigned int*) + 293 3 libcoreclr.dylib 0x000000010b08fb1a CorUnix::CPalSynchronizationManager::BlockThread(CorUnix::CPalThread*, unsigned int, bool, bool, CorUnix::ThreadWakeupReason*, unsigned int*) + 362 4 libcoreclr.dylib 0x000000010b094399 CorUnix::InternalWaitForMultipleObjectsEx(CorUnix::CPalThread*, unsigned int, void* const*, int, unsigned int, int, int) + 2153 5 libcoreclr.dylib 0x000000010b094632 WaitForMultipleObjectsEx + 82 6 libcoreclr.dylib 0x000000010b18b5aa Thread::DoAppropriateWaitWorker(int, void**, int, unsigned int, WaitMode) + 730 7 libcoreclr.dylib 0x000000010b186a00 Thread::DoAppropriateWait(int, void**, int, unsigned int, WaitMode, PendingSync*) + 48 8 libcoreclr.dylib 0x000000010b1e7175 WaitHandleNative::CorWaitOneNative(void*, int) + 181 9 ??? 0x00000001155ebfad 0x0 + 4653498285 10 ??? 0x0000000115046b77 0x0 + 4647578487 11 ??? 0x0000000114e7c390 0x0 + 4645700496 12 ??? 0x0000000114e7c2eb 0x0 + 4645700331 13 ??? 0x0000000114e7c1e6 0x0 + 4645700070 14 libcoreclr.dylib 0x000000010b371f79 CallDescrWorkerInternal + 124 15 libcoreclr.dylib 0x000000010b1c31ff DispatchCallSimple(unsigned long*, unsigned int, unsigned long, unsigned int) + 223 16 libcoreclr.dylib 0x000000010b1d9738 ThreadNative::KickOffThread_Worker(void*) + 136 17 libcoreclr.dylib 0x000000010b18eb38 ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 296 18 libcoreclr.dylib 0x000000010b18f0a0 ManagedThreadBase::KickOff(void (*)(void*), void*) + 32 19 libcoreclr.dylib 0x000000010b1d980a ThreadNative::KickOffThread(void*) + 170 20 libcoreclr.dylib 0x000000010b09c3c7 CorUnix::CPalThread::ThreadEntry(void*) + 407 21 libsystem_pthread.dylib 0x00007ff81adea1d3 _pthread_start + 125 (pthread.c:893) 22 libsystem_pthread.dylib 0x00007ff81ade5bd3 thread_start + 15 (:-1) Thread 10: 0 libsystem_kernel.dylib 0x00007ff81adae0de __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007ff81adea758 _pthread_cond_wait + 1242 (pthread_cond.c:862) 2 libcoreclr.dylib 0x000000010b08fed5 CorUnix::CPalSynchronizationManager::ThreadNativeWait(CorUnix::_ThreadNativeWaitData*, unsigned int, CorUnix::ThreadWakeupReason*, unsigned int*) + 293 3 libcoreclr.dylib 0x000000010b08fb1a CorUnix::CPalSynchronizationManager::BlockThread(CorUnix::CPalThread*, unsigned int, bool, bool, CorUnix::ThreadWakeupReason*, unsigned int*) + 362 4 libcoreclr.dylib 0x000000010b094a2d SleepEx + 141 5 libcoreclr.dylib 0x000000010b18cb07 Thread::UserSleep(int) + 263 6 libcoreclr.dylib 0x000000010b1db0ba ThreadNative::Sleep(int) + 154 7 ??? 0x00000001151b977a 0x0 + 4649097082 8 ??? 0x000000011503d734 0x0 + 4647540532 9 ??? 0x000000011503d0cd 0x0 + 4647538893 10 ??? 0x0000000114e82890 0x0 + 4645726352 11 ??? 0x0000000114e8200b 0x0 + 4645724171 12 ??? 0x000000011564dfc6 0x0 + 4653899718 13 ??? 0x00000001155e9abe 0x0 + 4653488830 14 ??? 0x00000001155ba1d4 0x0 + 4653294036 15 ??? 0x00000001155e9898 0x0 + 4653488280 16 ??? 0x00000001155bdeff 0x0 + 4653309695 17 ??? 0x0000000115655b8f 0x0 + 4653931407 18 ??? 0x000000011562feb2 0x0 + 4653776562 19 libcoreclr.dylib 0x000000010b371f79 CallDescrWorkerInternal + 124 20 libcoreclr.dylib 0x000000010b1c31ff DispatchCallSimple(unsigned long*, unsigned int, unsigned long, unsigned int) + 223 21 libcoreclr.dylib 0x000000010b1d9738 ThreadNative::KickOffThread_Worker(void*) + 136 22 libcoreclr.dylib 0x000000010b18eb38 ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 296 23 libcoreclr.dylib 0x000000010b18f0a0 ManagedThreadBase::KickOff(void (*)(void*), void*) + 32 24 libcoreclr.dylib 0x000000010b1d980a ThreadNative::KickOffThread(void*) + 170 25 libcoreclr.dylib 0x000000010b09c3c7 CorUnix::CPalThread::ThreadEntry(void*) + 407 26 libsystem_pthread.dylib 0x00007ff81adea1d3 _pthread_start + 125 (pthread.c:893) 27 libsystem_pthread.dylib 0x00007ff81ade5bd3 thread_start + 15 (:-1) Thread 11: 0 libsystem_kernel.dylib 0x00007ff81adae0de __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007ff81adea758 _pthread_cond_wait + 1242 (pthread_cond.c:862) 2 libcoreclr.dylib 0x000000010b08fed5 CorUnix::CPalSynchronizationManager::ThreadNativeWait(CorUnix::_ThreadNativeWaitData*, unsigned int, CorUnix::ThreadWakeupReason*, unsigned int*) + 293 3 libcoreclr.dylib 0x000000010b08fb1a CorUnix::CPalSynchronizationManager::BlockThread(CorUnix::CPalThread*, unsigned int, bool, bool, CorUnix::ThreadWakeupReason*, unsigned int*) + 362 4 libcoreclr.dylib 0x000000010b094399 CorUnix::InternalWaitForMultipleObjectsEx(CorUnix::CPalThread*, unsigned int, void* const*, int, unsigned int, int, int) + 2153 5 libcoreclr.dylib 0x000000010b094518 PAL_WaitForSingleObjectPrioritized + 72 6 libcoreclr.dylib 0x000000010b1e7383 WaitHandle_CorWaitOnePrioritizedNative + 67 7 ??? 0x0000000114eaaed0 0x0 + 4645891792 8 ??? 0x00000001155c7a48 0x0 + 4653349448 9 ??? 0x00000001155c78f6 0x0 + 4653349110 10 ??? 0x00000001155bd82d 0x0 + 4653307949 11 ??? 0x0000000115655c50 0x0 + 4653931600 12 ??? 0x000000011562feb2 0x0 + 4653776562 13 libcoreclr.dylib 0x000000010b371f79 CallDescrWorkerInternal + 124 14 libcoreclr.dylib 0x000000010b1c31ff DispatchCallSimple(unsigned long*, unsigned int, unsigned long, unsigned int) + 223 15 libcoreclr.dylib 0x000000010b1d9738 ThreadNative::KickOffThread_Worker(void*) + 136 16 libcoreclr.dylib 0x000000010b18eb38 ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 296 17 libcoreclr.dylib 0x000000010b18f0a0 ManagedThreadBase::KickOff(void (*)(void*), void*) + 32 18 libcoreclr.dylib 0x000000010b1d980a ThreadNative::KickOffThread(void*) + 170 19 libcoreclr.dylib 0x000000010b09c3c7 CorUnix::CPalThread::ThreadEntry(void*) + 407 20 libsystem_pthread.dylib 0x00007ff81adea1d3 _pthread_start + 125 (pthread.c:893) 21 libsystem_pthread.dylib 0x00007ff81ade5bd3 thread_start + 15 (:-1) Thread 12: 0 libsystem_kernel.dylib 0x00007ff81adae0de __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007ff81adea758 _pthread_cond_wait + 1242 (pthread_cond.c:862) 2 libcoreclr.dylib 0x000000010b08fed5 CorUnix::CPalSynchronizationManager::ThreadNativeWait(CorUnix::_ThreadNativeWaitData*, unsigned int, CorUnix::ThreadWakeupReason*, unsigned int*) + 293 3 libcoreclr.dylib 0x000000010b08fb1a CorUnix::CPalSynchronizationManager::BlockThread(CorUnix::CPalThread*, unsigned int, bool, bool, CorUnix::ThreadWakeupReason*, unsigned int*) + 362 4 libcoreclr.dylib 0x000000010b094399 CorUnix::InternalWaitForMultipleObjectsEx(CorUnix::CPalThread*, unsigned int, void* const*, int, unsigned int, int, int) + 2153 5 libcoreclr.dylib 0x000000010b094518 PAL_WaitForSingleObjectPrioritized + 72 6 libcoreclr.dylib 0x000000010b1e7383 WaitHandle_CorWaitOnePrioritizedNative + 67 7 ??? 0x0000000114eaaed0 0x0 + 4645891792 8 ??? 0x00000001155c7a48 0x0 + 4653349448 9 ??? 0x00000001155c78f6 0x0 + 4653349110 10 ??? 0x00000001155bd82d 0x0 + 4653307949 11 ??? 0x0000000115655c50 0x0 + 4653931600 12 ??? 0x000000011562feb2 0x0 + 4653776562 13 libcoreclr.dylib 0x000000010b371f79 CallDescrWorkerInternal + 124 14 libcoreclr.dylib 0x000000010b1c31ff DispatchCallSimple(unsigned long*, unsigned int, unsigned long, unsigned int) + 223 15 libcoreclr.dylib 0x000000010b1d9738 ThreadNative::KickOffThread_Worker(void*) + 136 16 libcoreclr.dylib 0x000000010b18eb38 ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 296 17 libcoreclr.dylib 0x000000010b18f0a0 ManagedThreadBase::KickOff(void (*)(void*), void*) + 32 18 libcoreclr.dylib 0x000000010b1d980a ThreadNative::KickOffThread(void*) + 170 19 libcoreclr.dylib 0x000000010b09c3c7 CorUnix::CPalThread::ThreadEntry(void*) + 407 20 libsystem_pthread.dylib 0x00007ff81adea1d3 _pthread_start + 125 (pthread.c:893) 21 libsystem_pthread.dylib 0x00007ff81ade5bd3 thread_start + 15 (:-1) Thread 13: 0 libsystem_kernel.dylib 0x00007ff81adae0de __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007ff81adea758 _pthread_cond_wait + 1242 (pthread_cond.c:862) 2 libcoreclr.dylib 0x000000010b08fed5 CorUnix::CPalSynchronizationManager::ThreadNativeWait(CorUnix::_ThreadNativeWaitData*, unsigned int, CorUnix::ThreadWakeupReason*, unsigned int*) + 293 3 libcoreclr.dylib 0x000000010b08fb1a CorUnix::CPalSynchronizationManager::BlockThread(CorUnix::CPalThread*, unsigned int, bool, bool, CorUnix::ThreadWakeupReason*, unsigned int*) + 362 4 libcoreclr.dylib 0x000000010b094399 CorUnix::InternalWaitForMultipleObjectsEx(CorUnix::CPalThread*, unsigned int, void* const*, int, unsigned int, int, int) + 2153 5 libcoreclr.dylib 0x000000010b094518 PAL_WaitForSingleObjectPrioritized + 72 6 libcoreclr.dylib 0x000000010b1e7383 WaitHandle_CorWaitOnePrioritizedNative + 67 7 ??? 0x0000000114eaaed0 0x0 + 4645891792 8 ??? 0x00000001155c7a48 0x0 + 4653349448 9 ??? 0x00000001155c78f6 0x0 + 4653349110 10 ??? 0x00000001155bd82d 0x0 + 4653307949 11 ??? 0x0000000115655c50 0x0 + 4653931600 12 ??? 0x000000011562feb2 0x0 + 4653776562 13 libcoreclr.dylib 0x000000010b371f79 CallDescrWorkerInternal + 124 14 libcoreclr.dylib 0x000000010b1c31ff DispatchCallSimple(unsigned long*, unsigned int, unsigned long, unsigned int) + 223 15 libcoreclr.dylib 0x000000010b1d9738 ThreadNative::KickOffThread_Worker(void*) + 136 16 libcoreclr.dylib 0x000000010b18eb38 ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 296 17 libcoreclr.dylib 0x000000010b18f0a0 ManagedThreadBase::KickOff(void (*)(void*), void*) + 32 18 libcoreclr.dylib 0x000000010b1d980a ThreadNative::KickOffThread(void*) + 170 19 libcoreclr.dylib 0x000000010b09c3c7 CorUnix::CPalThread::ThreadEntry(void*) + 407 20 libsystem_pthread.dylib 0x00007ff81adea1d3 _pthread_start + 125 (pthread.c:893) 21 libsystem_pthread.dylib 0x00007ff81ade5bd3 thread_start + 15 (:-1) Thread 14: 0 libsystem_kernel.dylib 0x00007ff81adae0de __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007ff81adea758 _pthread_cond_wait + 1242 (pthread_cond.c:862) 2 libcoreclr.dylib 0x000000010b08fed5 CorUnix::CPalSynchronizationManager::ThreadNativeWait(CorUnix::_ThreadNativeWaitData*, unsigned int, CorUnix::ThreadWakeupReason*, unsigned int*) + 293 3 libcoreclr.dylib 0x000000010b08fb1a CorUnix::CPalSynchronizationManager::BlockThread(CorUnix::CPalThread*, unsigned int, bool, bool, CorUnix::ThreadWakeupReason*, unsigned int*) + 362 4 libcoreclr.dylib 0x000000010b094399 CorUnix::InternalWaitForMultipleObjectsEx(CorUnix::CPalThread*, unsigned int, void* const*, int, unsigned int, int, int) + 2153 5 libcoreclr.dylib 0x000000010b09456d WaitForSingleObjectEx + 77 6 libcoreclr.dylib 0x000000010b29990f CLREventBase::WaitEx(unsigned int, WaitMode, PendingSync*) + 191 7 libcoreclr.dylib 0x000000010b36088a WKS::gc_heap::bgc_thread_function() + 218 8 libcoreclr.dylib 0x000000010b208864 (anonymous namespace)::CreateSuspendableThread(void (*)(void*), void*, char16_t const*)::$_0::__invoke(void*) + 116 9 libcoreclr.dylib 0x000000010b09c3c7 CorUnix::CPalThread::ThreadEntry(void*) + 407 10 libsystem_pthread.dylib 0x00007ff81adea1d3 _pthread_start + 125 (pthread.c:893) 11 libsystem_pthread.dylib 0x00007ff81ade5bd3 thread_start + 15 (:-1) Thread 15: 0 libsystem_kernel.dylib 0x00007ff81adae0de __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007ff81adea758 _pthread_cond_wait + 1242 (pthread_cond.c:862) 2 libcoreclr.dylib 0x000000010b08fed5 CorUnix::CPalSynchronizationManager::ThreadNativeWait(CorUnix::_ThreadNativeWaitData*, unsigned int, CorUnix::ThreadWakeupReason*, unsigned int*) + 293 3 libcoreclr.dylib 0x000000010b08fb1a CorUnix::CPalSynchronizationManager::BlockThread(CorUnix::CPalThread*, unsigned int, bool, bool, CorUnix::ThreadWakeupReason*, unsigned int*) + 362 4 libcoreclr.dylib 0x000000010b094399 CorUnix::InternalWaitForMultipleObjectsEx(CorUnix::CPalThread*, unsigned int, void* const*, int, unsigned int, int, int) + 2153 5 libcoreclr.dylib 0x000000010b094518 PAL_WaitForSingleObjectPrioritized + 72 6 libcoreclr.dylib 0x000000010b1e7383 WaitHandle_CorWaitOnePrioritizedNative + 67 7 ??? 0x0000000114eaaed0 0x0 + 4645891792 8 ??? 0x00000001155c7a48 0x0 + 4653349448 9 ??? 0x00000001155c78f6 0x0 + 4653349110 10 ??? 0x00000001155bd82d 0x0 + 4653307949 11 ??? 0x0000000115655c50 0x0 + 4653931600 12 ??? 0x000000011562feb2 0x0 + 4653776562 13 libcoreclr.dylib 0x000000010b371f79 CallDescrWorkerInternal + 124 14 libcoreclr.dylib 0x000000010b1c31ff DispatchCallSimple(unsigned long*, unsigned int, unsigned long, unsigned int) + 223 15 libcoreclr.dylib 0x000000010b1d9738 ThreadNative::KickOffThread_Worker(void*) + 136 16 libcoreclr.dylib 0x000000010b18eb38 ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 296 17 libcoreclr.dylib 0x000000010b18f0a0 ManagedThreadBase::KickOff(void (*)(void*), void*) + 32 18 libcoreclr.dylib 0x000000010b1d980a ThreadNative::KickOffThread(void*) + 170 19 libcoreclr.dylib 0x000000010b09c3c7 CorUnix::CPalThread::ThreadEntry(void*) + 407 20 libsystem_pthread.dylib 0x00007ff81adea1d3 _pthread_start + 125 (pthread.c:893) 21 libsystem_pthread.dylib 0x00007ff81ade5bd3 thread_start + 15 (:-1) Thread 16: 0 libsystem_pthread.dylib 0x00007ff81ade5bb0 start_wqthread + 0 Thread 17: 0 libsystem_pthread.dylib 0x00007ff81ade5bb0 start_wqthread + 0 Thread 18: 0 libsystem_pthread.dylib 0x00007ff81ade5bb0 start_wqthread + 0 Thread 19 Crashed: 0 libsystem_kernel.dylib 0x00007ff81adb21e2 __pthread_kill + 10 1 libsystem_pthread.dylib 0x00007ff81ade9ee6 pthread_kill + 263 (pthread.c:1670) 2 libsystem_c.dylib 0x00007ff81ad10b45 abort + 123 (abort.c:118) 3 libcoreclr.dylib 0x000000010b097462 PROCAbort + 50 4 libcoreclr.dylib 0x000000010b097390 PROCEndProcess(void*, unsigned int, int) + 320 5 libcoreclr.dylib 0x000000010b1facd3 EEPolicy::HandleFatalError(unsigned int, unsigned long, char16_t const*, _EXCEPTION_POINTERS*, char16_t const*, char16_t const*) + 371 6 libcoreclr.dylib 0x000000010b2caa61 ProcessCLRException + 1073 7 libcoreclr.dylib 0x000000010b2cfb32 UnwindManagedExceptionPass1(PAL_SEHException&, _CONTEXT*) + 354 8 libcoreclr.dylib 0x000000010b2cfe83 DispatchManagedException(PAL_SEHException&, bool) + 67 9 libcoreclr.dylib 0x000000010b2c99e2 HandleHardwareException(PAL_SEHException*) + 658 10 libcoreclr.dylib 0x000000010b06562b SEHProcessException(PAL_SEHException*) + 315 11 libcoreclr.dylib 0x000000010b09e5fb PAL_DispatchException + 139 12 libcoreclr.dylib 0x000000010b09e283 PAL_DispatchExceptionWrapper + 10 13 ??? 0x00000001151a5c1d 0x0 + 4649016349 14 ??? 0x00000001151a7022 0x0 + 4649021474 15 ??? 0x000000011562807a 0x0 + 4653744250 16 ??? 0x00000001156275e5 0x0 + 4653741541 17 ??? 0x000000011562562d 0x0 + 4653733421 18 ??? 0x000000011561c849 0x0 + 4653697097 19 ??? 0x0000000115624e7d 0x0 + 4653731453 20 ??? 0x0000000115179648 0x0 + 4648834632 21 ??? 0x000000011517953e 0x0 + 4648834366 22 ??? 0x000000011503f7cb 0x0 + 4647548875 23 ??? 0x000000011503f558 0x0 + 4647548248 24 ??? 0x000000011562feb2 0x0 + 4653776562 25 libcoreclr.dylib 0x000000010b371f79 CallDescrWorkerInternal + 124 26 libcoreclr.dylib 0x000000010b1c31ff DispatchCallSimple(unsigned long*, unsigned int, unsigned long, unsigned int) + 223 27 libcoreclr.dylib 0x000000010b1d9738 ThreadNative::KickOffThread_Worker(void*) + 136 28 libcoreclr.dylib 0x000000010b18eb38 ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 296 29 libcoreclr.dylib 0x000000010b18f0a0 ManagedThreadBase::KickOff(void (*)(void*), void*) + 32 30 libcoreclr.dylib 0x000000010b1d980a ThreadNative::KickOffThread(void*) + 170 31 libcoreclr.dylib 0x000000010b09c3c7 CorUnix::CPalThread::ThreadEntry(void*) + 407 32 libsystem_pthread.dylib 0x00007ff81adea1d3 _pthread_start + 125 (pthread.c:893) 33 libsystem_pthread.dylib 0x00007ff81ade5bd3 thread_start + 15 (:-1) Thread 20: 0 libsystem_pthread.dylib 0x00007ff81ade5bb0 start_wqthread + 0 Thread 21: 0 libsystem_kernel.dylib 0x00007ff81adae0de __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007ff81adea758 _pthread_cond_wait + 1242 (pthread_cond.c:862) 2 libcoreclr.dylib 0x000000010b08fed5 CorUnix::CPalSynchronizationManager::ThreadNativeWait(CorUnix::_ThreadNativeWaitData*, unsigned int, CorUnix::ThreadWakeupReason*, unsigned int*) + 293 3 libcoreclr.dylib 0x000000010b08fb1a CorUnix::CPalSynchronizationManager::BlockThread(CorUnix::CPalThread*, unsigned int, bool, bool, CorUnix::ThreadWakeupReason*, unsigned int*) + 362 4 libcoreclr.dylib 0x000000010b094a2d SleepEx + 141 5 libcoreclr.dylib 0x000000010b191bfa TieredCompilationManager::BackgroundWorkerStart() + 186 6 libcoreclr.dylib 0x000000010b191a78 TieredCompilationManager::BackgroundWorkerBootstrapper1(void*) + 88 7 libcoreclr.dylib 0x000000010b18eb38 ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 296 8 libcoreclr.dylib 0x000000010b18f0a0 ManagedThreadBase::KickOff(void (*)(void*), void*) + 32 9 libcoreclr.dylib 0x000000010b1919b0 TieredCompilationManager::BackgroundWorkerBootstrapper0(void*) + 32 10 libcoreclr.dylib 0x000000010b09c3c7 CorUnix::CPalThread::ThreadEntry(void*) + 407 11 libsystem_pthread.dylib 0x00007ff81adea1d3 _pthread_start + 125 (pthread.c:893) 12 libsystem_pthread.dylib 0x00007ff81ade5bd3 thread_start + 15 (:-1) Thread 19 crashed with X86 Thread State (64-bit): rax: 0x0000000000000000 rbx: 0x000070000bcc8000 rcx: 0x000070000bcc4fb8 rdx: 0x0000000000000000 rdi: 0x0000000000006aab rsi: 0x0000000000000006 rbp: 0x000070000bcc4fe0 rsp: 0x000070000bcc4fb8 r8: 0x000000000000bfdd r9: 0xffffffff00000000 r10: 0x0000000000000000 r11: 0x0000000000000246 r12: 0x0000000000006aab r13: 0x000000010b2caa38 r14: 0x0000000000000006 r15: 0x0000000000000016 rip: 0x00007ff81adb21e2 rfl: 0x0000000000000246 Binary Images: 0x1096a0000 - 0x1096e3fff BackgroundSwitcher (x86_64) <69865A25-D474-377C-BB52-AC17CFD02638> /Applications/John's Background Switcher.app/Contents/MacOS/BackgroundSwitcher 0x1097f5000 - 0x1097fcfff libSystem.Security.Cryptography.Native.Apple.dylib (x86_64) /Applications/John's Background Switcher.app/Contents/MonoBundle/libSystem.Security.Cryptography.Native.Apple.dylib 0x10981b000 - 0x10981efff libSystem.Net.Security.Native.dylib (x86_64) <877D64B1-4B9E-358F-9CAC-99A2086C2674> /Applications/John's Background Switcher.app/Contents/MonoBundle/libSystem.Net.Security.Native.dylib 0x109844000 - 0x109857fff libSystem.Globalization.Native.dylib (x86_64) <580DF7A1-03D7-39E8-8D72-D19584048ABB> /Applications/John's Background Switcher.app/Contents/MonoBundle/libSystem.Globalization.Native.dylib 0x109868000 - 0x109877fff libSystem.Native.dylib (x86_64) /Applications/John's Background Switcher.app/Contents/MonoBundle/libSystem.Native.dylib 0x109888000 - 0x1098d3fff libhostfxr.dylib (x86_64) <60BD4BDE-A704-3E32-BBE3-64671030B6CF> /Applications/John's Background Switcher.app/Contents/MonoBundle/libhostfxr.dylib 0x109905000 - 0x109924fff libSystem.Security.Cryptography.Native.OpenSsl.dylib (x86_64) <897E4F93-BA1A-35EE-B8F2-CF28F60C8081> /Applications/John's Background Switcher.app/Contents/MonoBundle/libSystem.Security.Cryptography.Native.OpenSsl.dylib 0x109941000 - 0x1099e0fff libclrgc.dylib (x86_64) <879AC410-2F34-322D-B2D2-F0316E814111> /Applications/John's Background Switcher.app/Contents/MonoBundle/libclrgc.dylib 0x109a2a000 - 0x109b09fff libSystem.IO.Compression.Native.dylib (x86_64) <6464C80F-5EB0-3716-9B48-C38CEF2CD546> /Applications/John's Background Switcher.app/Contents/MonoBundle/libSystem.IO.Compression.Native.dylib 0x109bed000 - 0x109c2cfff libhostpolicy.dylib (x86_64) <0FF238E7-83DF-3B3C-A74B-1218396DDF9F> /Applications/John's Background Switcher.app/Contents/MonoBundle/libhostpolicy.dylib 0x109c55000 - 0x109e28fff libmscordaccore.dylib (x86_64) /Applications/John's Background Switcher.app/Contents/MonoBundle/libmscordaccore.dylib 0x10a065000 - 0x10a29cfff libclrjit.dylib (x86_64) <06BC23C5-0BA2-3E06-B68F-DF9E4AC0045F> /Applications/John's Background Switcher.app/Contents/MonoBundle/libclrjit.dylib 0x10a6db000 - 0x10a812fff libmscordbi.dylib (x86_64) <9CF8EEBC-7719-3FA8-85AE-A4AE8F09373F> /Applications/John's Background Switcher.app/Contents/MonoBundle/libmscordbi.dylib 0x10b058000 - 0x10b55ffff libcoreclr.dylib (x86_64) <14D07C41-17E3-399A-B9D2-8965305FB3CC> /Applications/John's Background Switcher.app/Contents/MonoBundle/libcoreclr.dylib 0x10d4eb000 - 0x10d502fff csparser (x86_64) <0E1B6C05-C1CD-3EAF-9857-4787D790F22A> /System/Library/Frameworks/Security.framework/Versions/A/PlugIns/csparser.bundle/Contents/MacOS/csparser 0x10d521000 - 0x10d528fff libjbshelper.dylib (x86_64) <7048D44D-3BE6-37BF-AAC6-266DA1875A4C> /Applications/John's Background Switcher.app/Contents/MonoBundle/libjbshelper.dylib 0x10ed8a000 - 0x10ed99fff libobjc-trampolines.dylib (x86_64h) <5EAF78F9-49D0-30E2-A516-D53697B7344A> /usr/lib/libobjc-trampolines.dylib 0x1128f6000 - 0x1128f9fff AppleIntelKBLGraphicsVAME (x86_64) <704147C5-B7B7-339A-976C-DE41C22652BB> /System/Library/Extensions/AppleIntelKBLGraphicsVAME.bundle/Contents/MacOS/AppleIntelKBLGraphicsVAME 0x1b2fd2000 - 0x1b4881fff AppleIntelKBLGraphicsVADriver (x86_64) <19553C19-1533-35D1-8B55-558ABA6744EE> /System/Library/Extensions/AppleIntelKBLGraphicsVADriver.bundle/Contents/MacOS/AppleIntelKBLGraphicsVADriver 0x7ff81aa8a000 - 0x7ff81ab225ef dyld (x86_64) <3DF96F32-B9C9-3566-A6B7-4DAEBC6D6563> /usr/lib/dyld 0x7ff81ac91000 - 0x7ff81ad18ff7 libsystem_c.dylib (x86_64) /usr/lib/system/libsystem_c.dylib 0x7ff81adaa000 - 0x7ff81ade3fff libsystem_kernel.dylib (x86_64) <45E634EF-1767-336E-AFE5-8C0D4146ABCF> /usr/lib/system/libsystem_kernel.dylib 0x7ff81ade4000 - 0x7ff81adeffff libsystem_pthread.dylib (x86_64) <3A3FA85C-F1FE-336C-BF68-924FC947ADE3> /usr/lib/system/libsystem_pthread.dylib 0x7ff81ae49000 - 0x7ff81b2e5fef CoreFoundation (x86_64h) <2476C521-A5F5-39EF-893E-E351A15F79BB> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 0x7ff81df22000 - 0x7ff81ef29fff AppKit (x86_64) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 0x7ff824916000 - 0x7ff824c0dff9 HIToolbox (x86_64) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox External Modification Summary: Calls made by other processes targeting this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by all processes on this machine: task_for_pid: 0 thread_create: 0 thread_set_state: 0 ```
rolfbjarne commented 1 year ago
  1. Not sure, I'm catching this via Runtime.MarshalObjectiveCException in production, I cannot reproduce it locally

Can you capture Environmen.StackTrace in the Runtime.MarshalObjectiveCException event handler and see if that shows something useful?

johnconners commented 1 year ago

Thanks @rolfbjarne I'll push out an update to do that. Might take a while to get the result as so far I've only had one crash reported back!

rolfbjarne commented 1 year ago

Thanks @rolfbjarne I'll push out an update to do that. Might take a while to get the result as so far I've only had one crash reported back!

OK, I'll mark this as need-info until then.

johnconners commented 11 months ago

Hi @rolfbjarne, so I finally got another crash. I suspect it's related to their web connection as the apple crash reporter indicates more errors than I'm getting (my crash handling can only send back a log if there's a web connection at the time of the crash currently). Interestingly this time the error was:

[__NSSingleObjectArrayI URL]: unrecognized selector sent to instance 0x600000891810

Anyway, Environment.Stacktrace is below. I've got a ConcurrentBag\<Switcher> and am calling AsParallel().ForAll() on that list and calling the GetPhotos() method from each Switcher instance, I see it's in fact running concurrently but it's failing when making a web request to Google. It's on my list to swap out NSUrlConnection functionality for HttpClient now I'm on .NET 7, so I'm wondering if this callstack looks like an issue with NSUrlConnection.SendSynchronousRequest() or my use of AsParallel().ForAll() (which I'll note is an approach I've used for many years on Windows and Xamarin.Mac) or both. I'm only seeing this crash on Intel Macs from Xcode, haven't seen a single one on Apple silicon. May be a coincidence though.

Does anything jump out at you as amiss?

at System.Environment.get_StackTrace()
at BackgroundSwitcher.MainClass.<>c.
b__0_2(Object sender, MarshalObjectiveCExceptionEventArgs args)
at ObjCRuntime.Runtime.OnMarshalObjectiveCException(IntPtr, SByte)
at ObjCRuntime.Runtime.on_marshal_objectivec_exception(IntPtr, SByte, IntPtr*)
at ObjCRuntime.Messaging.NativeHandle_objc_msgSend_NativeHandle_NativeHandle_NativeHandle(IntPtr, IntPtr, NativeHandle, NativeHandle, NativeHandle)
at ObjCRuntime.Messaging.NativeHandle_objc_msgSend_NativeHandle_NativeHandle_NativeHandle(IntPtr, IntPtr, NativeHandle, NativeHandle, NativeHandle)
at Foundation.NSUrlConnection.SendSynchronousRequest(NSUrlRequest, NSUrlResponse& , NSError& )
at BackgroundSwitcher.WebConnection2.MakeRequest(String url, RequestHeaderModDelegate request_modifier, Nullable`1 timeout, Boolean protocol_errors_ok)
at BackgroundSwitcher.Google.GetResponseRaw(String url, JsonObject json)
at BackgroundSwitcher.Google.GetResponse(NameValueCollection parameters, JsonObject json)
at BackgroundSwitcher.Google.GetPhotosFromAlbum(String albumId)
at BackgroundSwitcher.GoogleSwitcher.GetPhotos()
at BackgroundSwitcher.SwitchEngine.<>c__DisplayClass5_0.b__1(SwitcherBase switcher)
at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput&, Int32&)
at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
at System.Linq.Parallel.SpoolingTaskBase.Work()
at System.Linq.Parallel.QueryTask.BaseWork(Object)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext, ContextCallback, Object)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task&, Thread )
at System.Threading.Tasks.ThreadPoolTaskScheduler.TryExecuteTaskInline(Task, Boolean)
at System.Threading.Tasks.TaskScheduler.TryRunInline(Task, Boolean)
at System.Threading.Tasks.Task.InternalRunSynchronously(TaskScheduler, Boolean)
at System.Linq.Parallel.QueryTask.RunSynchronously(TaskScheduler)
at System.Linq.Parallel.SpoolingTask.<>c__DisplayClass2_0`2.b__0()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext, ContextCallback, Object)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task&, Thread )
at System.Threading.Tasks.ThreadPoolTaskScheduler.TryExecuteTaskInline(Task, Boolean)
at System.Threading.Tasks.TaskScheduler.TryRunInline(Task, Boolean)
at System.Threading.Tasks.Task.InternalRunSynchronously(TaskScheduler, Boolean)
at System.Linq.Parallel.SpoolingTask.SpoolForAll[TInputOutput,TIgnoreKey](QueryTaskGroupState, PartitionedStream`2, TaskScheduler)
at System.Linq.Parallel.MergeExecutor`1.Execute[TKey](PartitionedStream`2, Boolean, ParallelMergeOptions, TaskScheduler, Boolean, CancellationState, Int32)
at System.Linq.Parallel.PartitionedStreamMerger`1.Receive[TKey](PartitionedStream`2)
at System.Linq.Parallel.ForAllOperator`1.WrapPartitionedStream[TKey](PartitionedStream`2, IPartitionedStreamRecipient`1, Boolean, QuerySettings)
at System.Linq.Parallel.UnaryQueryOperator`2.UnaryQueryOperatorResults.ChildResultsRecipient.Receive[TKey](PartitionedStream`2)
at System.Linq.Parallel.ScanQueryOperator`1.ScanEnumerableQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient`1)
at System.Linq.Parallel.UnaryQueryOperator`2.UnaryQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient`1)
at System.Linq.Parallel.QueryOperator`1.GetOpenedEnumerator(Nullable`1, Boolean, Boolean, QuerySettings)
at System.Linq.Parallel.ForAllOperator`1.RunSynchronously()
at BackgroundSwitcher.SwitchEngine.NextImage(Object sender, DoWorkEventArgs e)
at BackgroundSwitcher.SwitchEngine.PerformAction(Object sender, DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object)
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread, ExecutionContext, ContextCallback, Object)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task&, Thread )
at System.Threading.ThreadPoolWorkQueue.DispatchItemWithAutoreleasePool(Object, Thread)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
at System.Threading.Thread.StartCallback()
rolfbjarne commented 11 months ago

That comes from here:

https://github.com/xamarin/xamarin-macios/blob/5c1f372e8102815998a1443eaeba8667ce1880a9/src/Foundation/NSUrlConnection.cs#L30-L39

but that's weird, because the selector isn't URL, it's sendSynchronousRequest:returningResponse:error::

https://github.com/xamarin/xamarin-macios/blob/5c1f372e8102815998a1443eaeba8667ce1880a9/src/Foundation/NSUrlConnection.cs#L18C67-L18C114

I'm guessing this is because the URL selector is called in Apple's code somewhere, it's not something we're doing directly. I saw a few issues with our SendSynchronousRequest implementation, so I created a PR (#19458).

Also note that Apple's deprecated it: https://developer.apple.com/documentation/foundation/nsurlconnection/1411393-sendsynchronousrequest?language=objc

johnconners commented 11 months ago

Ah I hadn't noticed sendSynchronousRequest was deprecated, I'll make the switch to HttpClient and see if that clears things up. Thanks for the info! :)