Anybody have any experience with this menubar crash?

I have a user reporting this on 10.13 and I can reproduce it, but I can’t figure out what’s causing it. According to the trace, there’s very little of my code being hit, so I’m having trouble even coming up with ideas where to look. None of the app windows appear, and clicking anything in the menubar causes the crash.

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.xojo.XojoFramework        	0x00000001095a8eb3 CurrentMenuBar() + 46
1   com.xojo.XojoFramework        	0x00000001095a7b38 EnableMenus(unsigned char, Window*, RunMenuItem*) + 154
2   com.xojo.XojoFramework        	0x0000000109409d00 CocoaMenu::_MenuNeedsUpdate(NSMenu*) + 202
3   com.xojo.XojoFramework        	0x000000010940a170 0x10933d000 + 840048
4   com.apple.AppKit              	0x00007fff476ad429 -[NSMenu _populateFromDelegateWithEventRef:] + 332
5   com.apple.AppKit              	0x00007fff476a9e0e -[NSMenu _populateWithEventRef:] + 81
6   com.apple.AppKit              	0x00007fff476ac65c -[NSCarbonMenuImpl _carbonPopulateEvent:handlerCallRef:] + 477
7   com.apple.AppKit              	0x00007fff476ac3ff NSSLMMenuEventHandler + 1231
8   com.apple.HIToolbox           	0x00007fff4925b904 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1541
9   com.apple.HIToolbox           	0x00007fff4925ac4d SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 374
10  com.apple.HIToolbox           	0x00007fff4925aac3 SendEventToEventTargetWithOptions + 45
11  com.apple.HIToolbox           	0x00007fff492a0652 SendMenuPopulate(MenuData*, OpaqueEventTargetRef*, unsigned int, double, unsigned int, OpaqueEventRef*, unsigned char, unsigned char*) + 319
12  com.apple.HIToolbox           	0x00007fff492c96da SendMenuOpening(MenuSelectData*, MenuData*, double, unsigned int, unsigned int, __CFDictionary*, unsigned char, unsigned char*) + 288
13  com.apple.HIToolbox           	0x00007fff492e32c0 DrawTheMenu(MenuSelectData*, __CFArray**, unsigned char, unsigned char*) + 281
14  com.apple.HIToolbox           	0x00007fff492e30a5 MenuChanged(MenuSelectData*, unsigned char, unsigned char) + 519
15  com.apple.HIToolbox           	0x00007fff493fe25b TrackMenuCommon(MenuSelectData&, unsigned char*, SelectionData*, MenuResult*, MenuResult*) + 1137
16  com.apple.HIToolbox           	0x00007fff492e2a9e MenuSelectCore(MenuData*, Point, double, unsigned int, OpaqueMenuRef**, unsigned short*) + 423
17  com.apple.HIToolbox           	0x00007fff492e2866 _HandleMenuSelection2 + 472
18  com.apple.AppKit              	0x00007fff4769dacf _NSHandleCarbonMenuEvent + 244
19  com.apple.AppKit              	0x00007fff478f7dde _DPSEventHandledByCarbon + 54
20  com.apple.AppKit              	0x00007fff47cc95e2 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 914
21  com.xojo.XojoFramework        	0x00000001094284ae 0x10933d000 + 963758
22  com.apple.AppKit              	0x00007fff47528885 -[NSApplication run] + 764
23  com.xojo.XojoFramework        	0x00000001095a79c6 RuntimeRun + 41
24  com.thezaz.beacon             	0x00000001067e0623 REALbasic._RuntimeRun + 19
25  com.thezaz.beacon             	0x000000010882d5de _Main + 846
26  com.thezaz.beacon             	0x000000010881d453 main + 19
27  libdyld.dylib                 	0x00007fff71e78015 start + 1

I think it’s this one for reasons I can’t share here. feedback://showreport?report_id=63495

Oh boy, this is a nasty one. Try this in a Window.Open on 10.13 or ealier:

Self.BackgroundColor = New ColorGroup(&cFFFFFF00, &c00000000)
Self.HasBackgroundColor = True
MessageBox("It worked")

The app won’t crash immediately and even seems fully usable, but you’ll never get that message box. Something goes wrong in the stack and your code just stops. How the app eventually crashes becomes effectively random.

Good thing this case is marked as fixed. So just a heads up for anybody else using color groups.

After making certain I’m never using dual color ColorGroups on older systems, the behavior has not changed. So it must be something else. I could really use some suggestions here.

Do you have the whole crash report? Specifically the stuff above what you’ve posted?

Yeah, here’s the most of it, truncated because the forum doesn’t want it all. I’ll add that this works in the beta that can’t be discussed here, so it’s something you guys have fixed. But I have to find a workaround for this now, not in a few months when the update ships.

Process:               Beacon.debug [3550]
Path:                  /Users/USER/Documents/*/Beacon.debug.app/Contents/MacOS/Beacon.debug
Identifier:            com.thezaz.beacon
Version:               1.5.0.3 (1.5.0.3.3)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Beacon.debug [3550]
User ID:               501

Date/Time:             2021-02-26 08:35:10.969 -0500
OS Version:            Mac OS X 10.13.6 (17G66)
Report Version:        12
Anonymous UUID:        947B00BC-1590-B2AE-EAE7-3C1C0594058D


Time Awake Since Boot: 22000 seconds

System Integrity Protection: enabled

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

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       EXC_I386_GPFLT
Exception Note:        EXC_CORPSE_NOTIFY

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

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.xojo.XojoFramework        	0x0000000111d49eb3 CurrentMenuBar() + 46
1   com.xojo.XojoFramework        	0x0000000111d48b38 EnableMenus(unsigned char, Window*, RunMenuItem*) + 154
2   com.xojo.XojoFramework        	0x0000000111baad00 CocoaMenu::_MenuNeedsUpdate(NSMenu*) + 202
3   com.xojo.XojoFramework        	0x0000000111bab170 0x111ade000 + 840048
4   com.apple.AppKit              	0x00007fff476ad429 -[NSMenu _populateFromDelegateWithEventRef:] + 332
5   com.apple.AppKit              	0x00007fff476a9e0e -[NSMenu _populateWithEventRef:] + 81
6   com.apple.AppKit              	0x00007fff476ac65c -[NSCarbonMenuImpl _carbonPopulateEvent:handlerCallRef:] + 477
7   com.apple.AppKit              	0x00007fff476ac3ff NSSLMMenuEventHandler + 1231
8   com.apple.HIToolbox           	0x00007fff4925b904 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1541
9   com.apple.HIToolbox           	0x00007fff4925ac4d SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 374
10  com.apple.HIToolbox           	0x00007fff4925aac3 SendEventToEventTargetWithOptions + 45
11  com.apple.HIToolbox           	0x00007fff492a0652 SendMenuPopulate(MenuData*, OpaqueEventTargetRef*, unsigned int, double, unsigned int, OpaqueEventRef*, unsigned char, unsigned char*) + 319
12  com.apple.HIToolbox           	0x00007fff492c96da SendMenuOpening(MenuSelectData*, MenuData*, double, unsigned int, unsigned int, __CFDictionary*, unsigned char, unsigned char*) + 288
13  com.apple.HIToolbox           	0x00007fff492e32c0 DrawTheMenu(MenuSelectData*, __CFArray**, unsigned char, unsigned char*) + 281
14  com.apple.HIToolbox           	0x00007fff492e30a5 MenuChanged(MenuSelectData*, unsigned char, unsigned char) + 519
15  com.apple.HIToolbox           	0x00007fff493fe25b TrackMenuCommon(MenuSelectData&, unsigned char*, SelectionData*, MenuResult*, MenuResult*) + 1137
16  com.apple.HIToolbox           	0x00007fff492e2a9e MenuSelectCore(MenuData*, Point, double, unsigned int, OpaqueMenuRef**, unsigned short*) + 423
17  com.apple.HIToolbox           	0x00007fff492e2866 _HandleMenuSelection2 + 472
18  com.apple.AppKit              	0x00007fff4769dacf _NSHandleCarbonMenuEvent + 244
19  com.apple.AppKit              	0x00007fff478f7dde _DPSEventHandledByCarbon + 54
20  com.apple.AppKit              	0x00007fff47cc95e2 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 914
21  com.xojo.XojoFramework        	0x0000000111bc94ae 0x111ade000 + 963758
22  com.apple.AppKit              	0x00007fff47528885 -[NSApplication run] + 764
23  com.xojo.XojoFramework        	0x0000000111d489c6 RuntimeRun + 41
24  com.thezaz.beacon             	0x000000010ef84b93 REALbasic._RuntimeRun + 19
25  com.thezaz.beacon             	0x0000000110fd156e _Main + 846
26  com.thezaz.beacon             	0x0000000110fc13e3 main + 19
27  libdyld.dylib                 	0x00007fff71e78015 start + 1

Thread 1:: com.apple.NSEventThread
0   libsystem_kernel.dylib        	0x00007fff71fbf20a mach_msg_trap + 10
1   libsystem_kernel.dylib        	0x00007fff71fbe724 mach_msg + 60
2   com.apple.CoreFoundation      	0x00007fff49fa3ff5 __CFRunLoopServiceMachPort + 341
3   com.apple.CoreFoundation      	0x00007fff49fa3347 __CFRunLoopRun + 1783
4   com.apple.CoreFoundation      	0x00007fff49fa29b7 CFRunLoopRunSpecific + 487
5   com.apple.AppKit              	0x00007fff47670fc4 _NSEventThread + 184
6   libsystem_pthread.dylib       	0x00007fff72190661 _pthread_body + 340
7   libsystem_pthread.dylib       	0x00007fff7219050d _pthread_start + 377
8   libsystem_pthread.dylib       	0x00007fff7218fbf9 thread_start + 13

Thread 2:
0   libsystem_pthread.dylib       	0x00007fff7218fbdc start_wqthread + 0
1   ???                           	0x0000600000119201 0 + 105553117417985

Thread 3:
0   libsystem_pthread.dylib       	0x00007fff7218fbdc start_wqthread + 0
1   ???                           	0x0000000000000001 0 + 1

Thread 4:
0   libsystem_pthread.dylib       	0x00007fff7218fbdc start_wqthread + 0

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x4958ec8348535441  rbx: 0x0000000000000000  rcx: 0x000000002000610c  rdx: 0x0000000000000000
  rdi: 0x0000000000000000  rsi: 0x00007fff481d03f7  rbp: 0x00007ffee0e219b0  rsp: 0x00007ffee0e21980
   r8: 0x0000000000688100   r9: 0x00007fffaa39e2f0  r10: 0x0068860100684600  r11: 0x00007fff47536ef6
  r12: 0x0000000000000000  r13: 0x0000000000000000  r14: 0x0000000000000000  r15: 0x00007fff481ee902
  rip: 0x0000000111d49eb3  rfl: 0x0000000000010206  cr2: 0x000000010edaf000

Interesting.

But are you still using ColorGroups? I would try just using a raw color and see if that solves it.

Yep, removing ColorGroup entirely “solves” the problem, but introduces a whole ton of other ones. Still, let’s see what I can do with this.

To anybody that stumbles upon this thread looking for a solution, I solved it by creating a “ColorGroupMimic” class: Beacon/ColorGroupMimic.xojo_code at ae807bedd1510a902dc1908135d4ee86030ce3d8 · thommcgrath/Beacon · GitHub

It’s not a great class, but it does the job for my purposes.

1 Like

Ok so bad news @Greg_O_Lone, this crash is still present (or at least this trace) is still present on 10.11 when ColorGroup has not been used at all, including when built with the beta. I don’t have full details yet, but I suspect it’s the search field. I’ll file a bug report when I know more.

Edit: Looks like it’s already a known issue: feedback://showreport?report_id=63521

1 Like