Segmentation fault macOS high sierra


#1

since upgrading to high sierra, every project that uses GLFW seems to segfault.

I’m surprised not to find others with this problem

Path:                  /Users/USER/*/boing.app/Contents/MacOS/boing
Identifier:            ???
Version:               3.3 (???)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           boing [60020]
User ID:               501

Date/Time:             2018-06-01 13:24:51.714 +0100
OS Version:            Mac OS X 10.13.5 (17F70a)
Report Version:        12
Anonymous UUID:        681E5E0C-5B59-3CFB-C9D5-564F41208528


Time Awake Since Boot: 45000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [0]

VM Regions Near 0:
--> 
    __TEXT                 0000000108c85000-0000000108ccd000 [  288K] r-x/rwx SM=COW  l [/Users/oli/Dev/glfw/examples/boing.app/Contents/MacOS/boing]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libdispatch.dylib             	0x00007fff62c26d11 dispatch_release + 0
1   com.apple.AppKit              	0x00007fff38e7fb1f -[NSPersistentUIManager dealloc] + 63
2   com.apple.AppKit              	0x00007fff383ef706 -[NSPersistentUIManager init] + 520
3   com.apple.Foundation          	0x00007fff3cf41e34 _NSFaultInObject + 29
4   com.apple.HIToolbox           	0x00007fff3a135a1b _HIPersistentUICreatePersistentWindow + 69
5   com.apple.HIToolbox           	0x00007fff3a13591d WindowStateSetMenuBarState(unsigned int, double, void const*) + 43
6   com.apple.HIToolbox           	0x00007fff3a125cd5 MBWindows::CreateWindow(CGRect, unsigned int) + 337
7   com.apple.HIToolbox           	0x00007fff3a125a8d MBWindows::GetWindowOnDisplay(unsigned int, unsigned char) + 191
8   com.apple.HIToolbox           	0x00007fff3a125893 MenuBarInstance::ForEachWindowDo(unsigned char, bool (OpaqueWindowPtr*, unsigned int) block_pointer) + 167
9   com.apple.HIToolbox           	0x00007fff3a1255a5 MenuBarInstance::UpdateWindowBoundsAndResolution() + 163
10  com.apple.HIToolbox           	0x00007fff3a2b6320 MenuBarInstance::Show(MenuBarAnimationStyle, unsigned char, unsigned char, unsigned char, unsigned char) + 282
11  com.apple.HIToolbox           	0x00007fff3a125264 MenuBarInstance::UpdateAggregateUIMode(MenuBarAnimationStyle, unsigned char, unsigned char, unsigned char) + 828
12  com.apple.HIToolbox           	0x00007fff3a124e63 MenuBarInstance::ForEachMenuBarDo(void (MenuBarInstance*) block_pointer) + 47
13  com.apple.HIToolbox           	0x00007fff3a124df9 UpdateAllAggregateUIModes(MenuBarAnimationStyle, unsigned char) + 131
14  com.apple.HIToolbox           	0x00007fff3a124d50 SetSystemUIMode + 169
15  com.apple.AppKit              	0x00007fff383eac80 -[NSApplication finishLaunching] + 719
16  com.apple.AppKit              	0x00007fff383ea683 -[NSApplication run] + 250
17                                	0x0000000108ca1874 initializeAppKit + 436```

#2

Have you tried running any of the GLFW examples or GLFW tests to check if this is an issue with GLFW or application code?

Additionally it would be worth testing with GLFW 3.2.1 and if the problem persists and is found in example/test code try out the master branch before submitting an issue to GLFW. I can help with issue submission if you don’t have a Github account.

Edit: If you don’t have the tests/examples available you can build them when building GLFW from source as per the docs from this link.