Strange crash relating to NSStatusBar item rendering

Number:rdar://32675107 Date Originated:2017-06-09
Status:Closed Resolved:Duplicate
Product:AppKit Product Version:10.12
Classification: Reproducible:Rarely
My app (Hammerspoon - includes an NSStatusBar item, and also allows users to create their own.

Something, unfortunately I don't know what, because I haven't been able to reproduce it myself, is causing occasional status bar rendering to crash very deep in a stack which contains none of my code. Here is the main recurrence of this that my crash logger is catching:

The source for Hammerspoon is all on GitHub ( the code for the main app status bar item is in Hammerspoon/MJMenuIcon.m and does very little indeed. The source for user added status bar items is in extensions/menubar/internal.m and is much more complex.

I don't have any idea which of the two is causing the crash, but I would note that BetterTouchTool also is experiencing these crashes, and they do not have user-created status bar items:

I'm very prepared to believe that we are doing something wrong, but the crash happens so far down a stack that I sort of feel like even if we're doing something wrong, macOS should really be rejecting the mistake earlier.

Steps to Reproduce:
Not really sure - it may have something to do with connecting monitors and/or coming out of sleep (perhaps where the display configuration is changing during a wakeup? but that's a guess)

Expected Results:
No crash

Observed Results:





Engineering has determined that your bug report (32675107) is a duplicate of 19759543 and will be closed.

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!