Egressor crashes with SIGTRAP: trace trap on macOS when the system tray
is enabled alongside the Wails desktop UI.
The root cause is that systray.Run() starts its own NSApplication run
loop in a goroutine, while Wails already owns the main thread. macOS
requires all UI work to happen on a single main thread — two competing
run loops cause a fatal signal.
Stack trace points to:
github.com/energye/systray._Cfunc_nativeLoop() (goroutine 7)
github.com/wailsapp/wails/v2/...darwin._Cfunc_RunMainLoop() (goroutine 1, main thread)
The fix is to use systray.Register() instead of systray.Run().
Register() sets up the tray icon and menus but lets the existing run
loop (Wails) handle events, avoiding the conflict.
Egressor crashes with
SIGTRAP: trace trapon macOS when the system trayis enabled alongside the Wails desktop UI.
The root cause is that
systray.Run()starts its ownNSApplicationrunloop in a goroutine, while Wails already owns the main thread. macOS
requires all UI work to happen on a single main thread — two competing
run loops cause a fatal signal.
Stack trace points to:
github.com/energye/systray._Cfunc_nativeLoop()(goroutine 7)github.com/wailsapp/wails/v2/...darwin._Cfunc_RunMainLoop()(goroutine 1, main thread)The fix is to use
systray.Register()instead ofsystray.Run().Register()sets up the tray icon and menus but lets the existing runloop (Wails) handle events, avoiding the conflict.