Skip to content

Instantly share code, notes, and snippets.

#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
int main(int argc, const char * argv[])
{
[NSWindow windowNumbersWithOptions:0];
return 0;
}
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x00007fff8dcc2358 in spin_lock$VARIANT$mp ()
(gdb) bt
#0 0x00007fff8dcc2358 in spin_lock$VARIANT$mp ()
#1 0x00007fff8a102e99 in _CGSConnectionByID ()
#2 0x00007fff8a15b7e9 in CGSGetWorkspaceWindowCountWithOptionsAndTags ()
#3 0x00007fff913b17fe in +[NSWindow windowNumbersWithOptions:] ()
#4 0x0000000100000e7f in main ()