Skip to content

systray crashes on macOS due to dual NSApplication run loops #11

Closed

Description

@ehsaniara

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.

Activity

  1. self-assigned this
    on Apr 9, 2026
  2. added
    bug
    on Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions