With macOS 10.15 (19A471t), I'm seeing a fairly weird new crash that I have a hard time debugging.
This happens with loadNibNamed when passing an owner. Without an owner (my controller class), I can load the nib fine and show it. If I specify the owner though instead of nil, the calling thread seems to abruptly quit with no warning when debugging under Xcode.
Here's a snippet of what no longer works :
let bundle = Bundle.main
var topLevelObjects: NSArray? = NSArray()
bundle.loadNibNamed(NSNib.Name(nibName),
owner: preferencesWindowController,
topLevelObjects: &topLevelObjects)
return topLevelObjects! as [AnyObject]
I've checked that the owner is correctly initialized, it is. Also, no change reported in API https://developer.apple.com/documentation/foundation/bundle/1402909-loadnibnamed
When compiled and running (this is a screensaver), I get this crash log in console for that issue :
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Illegal instruction: 4
Termination Reason: Namespace SIGNAL, Code 0x4
Terminating Process: exc handler [6316]
Application Specific Information:
dyld3 mode
Crashing on exception: launch path not accessible
Application Specific Signatures:
Aerial
Application Specific Backtrace 1:
0 CoreFoundation 0x00007fff2e5d4c63 __exceptionPreprocess + 250
1 libobjc.A.dylib 0x00007fff63a9d06b objc_exception_throw + 48
2 Foundation 0x00007fff30be81a0 -[NSConcreteTask launchWithDictionary:error:] + 5073
3 Aerial 0x00000001104f1181 Aerial + 516481
4 Aerial 0x00000001104ee964 Aerial + 506212
5 Aerial 0x00000001104ecb5c Aerial + 498524
6 Aerial 0x00000001104a6e9d Aerial + 212637
7 Aerial 0x00000001104ab4db Aerial + 230619
8 AppKit 0x00007fff2b8a9ce5 -[NSIBObjectData nibInstantiateWithOwner:options:topLevelObjects:] + 1540
9 AppKit 0x00007fff2b8a7d17 loadNib + 401
10 AppKit 0x00007fff2b8a72ce +[NSBundle(NSNibLoading) _loadNibFile:nameTable:options:withZone:ownerBundle:] + 693
Anyone encoutering the same issue ? Any tip on how I could track it down further ?
Thanks !