-[__NSBlockVariable__ initialize]: unrecognized selector sent to instance

Since today I’m running into an obscure error which seems to be originating from the objc runtime:

2021-12-10 19:41:25.595556+0100 MyApp[5644:59952] -[__NSBlockVariable__ initialize]: unrecognized selector sent to instance 0x7fff80618088
2021-12-10 19:41:25.595787+0100 MyApp[5644:59952] [General] An uncaught exception was raised
2021-12-10 19:41:25.595867+0100 MyApp[5644:59952] [General] -[__NSBlockVariable__ initialize]: unrecognized selector sent to instance 0x7fff80618088
2021-12-10 19:41:25.600284+0100 MyApp[5644:59952] [General] (
	0   CoreFoundation                      0x00007fff204bb1db __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007fff201f4d92 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff2053dd0d -[NSObject(NSObject) __retain_OA] + 0
	3   CoreFoundation                      0x00007fff2042324b ___forwarding___ + 1448
	4   CoreFoundation                      0x00007fff20422c18 _CF_forwarding_prep_0 + 120
	5   libobjc.A.dylib                     0x00007fff201f7785 CALLING_SOME_+initialize_METHOD + 17
	6   libobjc.A.dylib                     0x00007fff201f811a initializeNonMetaClass + 736
	7   libobjc.A.dylib                     0x00007fff201f7e96 initializeNonMetaClass + 92
	8   libobjc.A.dylib                     0x00007fff201f9190 _ZL24initializeAndMaybeRelockP10objc_classP11objc_objectR8mutex_ttILb0EEb + 232
	9   libobjc.A.dylib                     0x00007fff201e8dc0 lookUpImpOrForward + 1126
	10  libobjc.A.dylib                     0x00007fff201e839b _objc_msgSend_uncached + 75
	11  HIToolbox                           0x00007fff288a9ec3 _ZN10WindowData34SetNSWindowSelectionMaterialBoundsE6CGRect + 9
	12  HIToolbox                           0x00007fff28754013 _ZN14HIBaseMenuView23RemoveSelectionBackdropEv + 57
	13  HIToolbox                           0x00007fff28671e47 _ZN14HIBaseMenuView23OwningWindowChangedSelfEP15OpaqueWindowPtrS1_ + 21
	14  HIToolbox                           0x00007fff28671e08 _ZN6HIView23SendOwningWindowChangedEjP15OpaqueWindowPtrS1_ + 250
	15  HIToolbox                           0x00007fff28671cc3 _ZN6HIView26NotifySubtreeWindowChangedEP15OpaqueWindowPtrS1_h + 83
	16  HIToolbox                           0x00007fff28671ce5 _ZN6HIView26NotifySubtreeWindowChangedEP15OpaqueWindowPtrS1_h + 117
	17  HIToolbox                           0x00007fff2866e658 _ZN10WindowData18FinishConstructionEjyjPK4RectPhjP15OpaqueWindowPtrP16OpaqueControlRef + 1286
	18  HIToolbox                           0x00007fff2866e124 _ZN10WindowData10InitializeEP14OpaqueEventRef + 398
	19  HIToolbox                           0x00007fff2866df53 _ZN14AppleWindowDef10InitializeEP14OpaqueEventRef + 21
	20  HIToolbox                           0x00007fff2865fe61 _ZN8HIObject24HandleClassHIObjectEventEP25OpaqueEventHandlerCallRefP14OpaqueEventRefPv + 461
	21  HIToolbox                           0x00007fff2865f631 _ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec + 1362
	22  HIToolbox                           0x00007fff2865ea53 _ZL30SendEventToEventTargetInternalP14OpaqueEventRefP20OpaqueEventTargetRefP14HandlerCallRec + 331
	23  HIToolbox                           0x00007fff2865e8fc SendEventToEventTargetWithOptions + 45
	24  HIToolbox                           0x00007fff28659bba _ZN8HIObject6CreateEPK10__CFStringP14OpaqueEventRefPPS_ + 246
	25  HIToolbox                           0x00007fff28659a91 HIObjectCreate + 90
	26  HIToolbox                           0x00007fff28669d9b _ZL15NewWindowCommonPP10WindowDatajyPK13WindowDefSpecPK4RectPKhhP15OpaqueWindowPtrPvjPtb + 1056
	27  HIToolbox                           0x00007fff2866989f _ZL23CreateNewWindowInternalPK13WindowDefSpecjyPK4RectPP15OpaqueWindowPtr + 192
	28  HIToolbox                           0x00007fff28669229 _ZL20HIWindowCreateCommonjyPK13WindowDefSpecPK6CGRectjPP15OpaqueWindowPtr + 166
	29  HIToolbox                           0x00007fff28668fd9 _ZN9MBWindows12CreateWindowE6CGRectj + 131
	30  HIToolbox                           0x00007fff28668e4f _ZN9MBWindows18GetWindowOnDisplayEjh + 183
	31  HIToolbox                           0x00007fff28668ca5 _ZN15MenuBarInstance15ForEachWindowDoEhU13block_pointerFbP15OpaqueWindowPtrjE + 183
	32  HIToolbox                           0x00007fff28668b9f _ZN15MenuBarInstance28SetBoundsAndUpdateResolutionEv + 103
	33  HIToolbox                           0x00007fff28668749 _ZN15MenuBarInstance4ShowE21MenuBarAnimationStylehhhh + 275
	34  HIToolbox                           0x00007fff2869e1d1 SetMenuBarObscured + 232
	35  HIToolbox                           0x00007fff2869de62 _ZN13HIApplication15HandleActivatedEP14OpaqueEventRefhP15OpaqueWindowPtrh + 164
	36  HIToolbox                           0x00007fff286983f9 _ZN13HIApplication13EventObserverEjP14OpaqueEventRefPv + 251
	37  HIToolbox                           0x00007fff2865ed7f _NotifyEventLoopObservers + 153
	38  HIToolbox                           0x00007fff28697e4d AcquireEventFromQueue + 522
	39  HIToolbox                           0x00007fff28686804 ReceiveNextEventCommon + 618
	40  HIToolbox                           0x00007fff28686583 _BlockUntilNextEventMatchingListInModeWithFilter + 70
	41  AppKit                              0x00007fff22c48172 _DPSNextEvent + 864
	42  AppKit                              0x00007fff22c46945 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1364
	43  AppKit                              0x00007fff22c38c69 -[NSApplication run] + 586
	44  MyApp                              0x000000010ca27269 _ZN4juce14MessageManager15runDispatchLoopEv + 153
	45  MyApp                              0x000000010ca2714f _ZN4juce19JUCEApplicationBase4mainEv + 399
	46  MyApp                              0x000000010ca26f5c _ZN4juce19JUCEApplicationBase4mainEiPPKc + 60
	47  MyApp                              0x000000010cbdf183 main + 51
	48  libdyld.dylib                       0x00007fff20364f3d start + 1
	49  ???                                 0x0000000000000001 0x0 + 1
)

This happens when I bring my MyApps window to front, after which the UI freezes.

It might be related to updating JUCE to 6.1.3, but I’m not sure.

Has anybody seen this (or something similar) before?

How do I debug this thing?

Thanks

And another one came up:

2021-12-10 21:14:38.482968+0100 MyApp[72881:297985] +[NSObject allocWithZone:]: unrecognized selector sent to instance 0x7fff80618088
2021-12-10 21:14:38.485502+0100 MyApp[72881:297985] [General] +[NSObject allocWithZone:]: unrecognized selector sent to instance 0x7fff80618088
2021-12-10 21:14:38.498456+0100 MyApp[72881:297985] [General] (
	0   CoreFoundation                      0x00007fff204bb1db __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007fff201f4d92 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff2053dd0d -[NSObject(NSObject) __retain_OA] + 0
	3   CoreFoundation                      0x00007fff2042324b ___forwarding___ + 1448
	4   CoreFoundation                      0x00007fff20422c18 _CF_forwarding_prep_0 + 120
	5   AppKit                              0x00007fff22d9a13d addW + 88
	6   AppKit                              0x00007fff22d92a36 -[NSWindow _reallyDoOrderWindowAboveOrBelow:relativeTo:findKey:forCounter:force:isModal:] + 1998
	7   AppKit                              0x00007fff22d91f10 -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 135
	8   AppKit                              0x00007fff22d90f07 -[NSWindow _doOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 289
	9   AppKit                              0x00007fff22d90d84 -[NSWindow orderWindow:relativeTo:] + 155
	10  AppKit                              0x00007fff22d849cd -[NSWindow makeKeyAndOrderFront:] + 60
	11  MyApp                              0x000000010664e44d _ZN4juce19NSViewComponentPeer7toFrontEb + 989
	12  MyApp                              0x00000001063c7e7d _ZN4juce9Component7toFrontEb + 285
	13  MyApp                              0x00000001063d64fe _ZN4juce9Component17internalMouseDownENS_16MouseInputSourceENS_5PointIfEENS_4TimeEfffff + 1006
	14  MyApp                              0x0000000106539a1b _ZN4juce24MouseInputSourceInternal13sendMouseDownERNS_9ComponentENS_5PointIfEENS_4TimeE + 395
	15  MyApp                              0x0000000106537d4d _ZN4juce24MouseInputSourceInternal10setButtonsENS_5PointIfEENS_4TimeENS_12ModifierKeysE + 1117
	16  MyApp                              0x00000001063dfe71 _ZN4juce24MouseInputSourceInternal11handleEventERNS_13ComponentPeerENS_5PointIfEENS_4TimeENS_12ModifierKeysEffNS_10PenDetailsE + 1265
	17  MyApp                              0x00000001063df94f _ZN4juce16MouseInputSource11handleEventERNS_13ComponentPeerENS_5PointIfEExNS_12ModifierKeysEffRKNS_10PenDetailsE + 415
	18  MyApp                              0x0000000106502d84 _ZN4juce13ComponentPeer16handleMouseEventENS_16MouseInputSource15InputSourceTypeENS_5PointIfEENS_12ModifierKeysEffxNS_10PenDetailsEi + 436
	19  MyApp                              0x000000010663301e _ZN4juce19NSViewComponentPeer14sendMouseEventEP7NSEvent + 302
	20  MyApp                              0x000000010663d070 _ZN4juce19NSViewComponentPeer17redirectMouseDownEP7NSEvent + 208
	21  MyApp                              0x0000000106632d29 _ZN4juce15JuceNSViewClass11callOnOwnerIMNS_19NSViewComponentPeerEFvP7NSEventEJRS4_EEEvP11objc_objectOT_DpOT0_ + 281
	22  MyApp                              0x000000010662fcdb _ZN4juce15JuceNSViewClass14asyncMouseDownEP11objc_objectP13objc_selectorP7NSEvent + 123
	23  MyApp                              0x000000010662b828 _ZN4juce15JuceNSViewClass9mouseDownEP11objc_objectP13objc_selectorP7NSEvent + 88
	24  AppKit                              0x00007fff22e62e5e -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 4961
	25  AppKit                              0x00007fff22dd2648 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 2594
	26  AppKit                              0x00007fff22dd1a06 -[NSWindow(NSEventRouting) sendEvent:] + 347
	27  AppKit                              0x00007fff22dcfe14 -[NSApplication(NSEvent) sendEvent:] + 352
	28  AppKit                              0x00007fff230a8be1 -[NSApplication _handleEvent:] + 65
	29  AppKit                              0x00007fff22c38c8e -[NSApplication run] + 623
	30  MyApp                              0x00000001069d1bae _ZN4juce14MessageManager15runDispatchLoopEv + 206
	31  MyApp                              0x00000001069d19f7 _ZN4juce19JUCEApplicationBase4mainEv + 455
	32  MyApp                              0x00000001069d1773 _ZN4juce19JUCEApplicationBase4mainEiPPKc + 131
	33  MyApp                              0x00000001070995e7 main + 87
	34  libdyld.dylib                       0x00007fff20364f3d start + 1
	35  ???                                 0x0000000000000001 0x0 + 1
)