Linux: GNOME logout causes sing-box for Desktop to exit with SIGTRAP and generate core dumps
Operating system
Linux
System version
Fedora Linux 44 GNOME Wayland
Installation type
sing-box for Linux Graphical Client sing-box frontend: XWayland (--ozone-platform=x11, automatically selected by the application)
If you are using a graphical client, please provide the version of the client.
1.14.0-beta.17
Version
Description
Description
When logging out of a GNOME session while sing-box for Desktop is still running, the desktop application frequently exits with SIGTRAP and systemd records a core dump for:
/opt/sing-box/sing-box
I noticed this because coredumpctl accumulated a large number of sing-box entries while I was repeatedly logging out and back in to test a GNOME Shell extension.
During normal desktop usage, I have not observed sing-box for Desktop spontaneously crashing. The SIGTRAP events appear to be strongly correlated with GNOME session logout.
Evidence
Here are several events from one day.
coredumpctl:
Sun 2026-08-23 10:06:55 +08 ... SIGTRAP ... /opt/sing-box/sing-box
Sun 2026-08-23 10:37:20 +08 ... SIGTRAP ... /opt/sing-box/sing-box
Sun 2026-08-23 11:11:04 +08 ... SIGTRAP ... /opt/sing-box/sing-box
Sun 2026-08-23 12:12:19 +08 ... SIGTRAP ... /opt/sing-box/sing-box
Sun 2026-08-23 12:35:17 +08 ... SIGTRAP ... /opt/sing-box/sing-box
Sun 2026-08-23 13:15:44 +08 ... SIGTRAP ... /opt/sing-box/sing-box
Corresponding systemd-logind session logout events:
10:06:59 Session 13 logged out
10:37:24 Session 15 logged out
11:11:08 Session 18 logged out
12:12:23 Session 20 logged out
12:35:14 Session 23 logged out
13:15:42 Session 25 logged out
The timing correlation is very consistent:
sing-box SIGTRAP GNOME logout
10:06:55 10:06:59
10:37:20 10:37:24
11:11:04 11:11:08
12:12:19 12:12:23
12:35:17 12:35:14
13:15:44 13:15:42
The difference is only about 2–4 seconds in every observed case.
I also have many similar entries from previous days:
Wed 2026-08-19 ... SIGTRAP ... /opt/sing-box/sing-box
Thu 2026-08-20 ... SIGTRAP ... /opt/sing-box/sing-box
Fri 2026-08-21 ... SIGTRAP ... /opt/sing-box/sing-box
Expected behavior
When the GNOME session is terminated, sing-box for Desktop should shut down cleanly without triggering SIGTRAP or generating a core dump.
Actual behavior
The desktop executable terminates with SIGTRAP, and systemd-coredump records it as a crash.
Additional information
This does not currently look like a spontaneous crash of the sing-box proxy core during normal operation.
The affected executable reported by coredumpctl is specifically:
/opt/sing-box/sing-box
and the crashes correlate with destruction of the GNOME graphical session.
This may therefore be related to the Electron/Chromium frontend shutdown path when the Wayland/GNOME session, D-Bus session, or related desktop resources are being torn down.
I can provide output from:
coredumpctl info <PID>
or a backtrace/core dump from one of the reproducible events if that would help diagnose the shutdown path.
Reproduction
- Start sing-box for Desktop normally.
- Leave the application running.
- Log out from the GNOME desktop session without manually quitting sing-box first.
- Log back in.
- Check:
coredumpctl list | grep -i sing-box
A new entry is frequently created similar to:
SIGTRAP present /opt/sing-box/sing-box
Logs
Supporter
- [ ] I am a sponsor
Integrity requirements
- [x] I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
- [x] I confirm that I have provided the server and client configuration files and process that can be reproduced locally, instead of a complicated client configuration file that has been stripped of sensitive data.
- [x] I confirm that I have provided the simplest configuration that can be used to reproduce the error I reported, instead of depending on remote servers, TUN, graphical interface clients, or other closed-source software.
- [x] I confirm that I have provided the complete configuration files and logs, rather than just providing parts I think are useful out of confidence in my own intelligence.
This is an electron on wayland issue. I have the same problem with signal and mattermost.
For me, on Ubuntu/GNOME Wayland, some Electron/Chromium applications randomly terminate with SIGTRAP during logout because the graphical session is torn down before the apps have completely finished shutting down. Who exactly is to blame, mutter or electron, not sure, but I lean towards electron being the guilty party because non-electron apps behave properly.
A simple workaround is to add a short delay during graphical session shutdown, keeping GNOME/Wayland alive long enough for applications to exit cleanly.
Create:
sudo nano /etc/systemd/user/logout-grace.service
with:
[Unit]
Description=Grace period during graphical session shutdown
PartOf=graphical-session.target
[email protected]
After=gnome-session-x11-services.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/true
ExecStop=/usr/bin/sleep 3
TimeoutStopSec=5
[Install]
WantedBy=graphical-session.target
Enable it for users:
sudo systemctl --global enable logout-grace.service
Then activate it for the current session:
systemctl --user daemon-reload
systemctl --user start logout-grace.service
Verify:
systemctl --user status logout-grace.service
It should show:
Active: active (exited)
Even though this service is not "alive" this works becuse systemd reverses unit ordering during shutdown. Because the grace service is ordered after GNOME Shell during startup, its ExecStop runs before GNOME Shell is allowed to stop.
The three-second delay thus allows applications time to shut down while the Wayland/XWayland graphical environment is still available.
This avoids having to maintain a list of individual Electron applications and do fixes for each of them. it does add 3 sec delay to logout.
Either way, there is nothing sing box maintainers can do, I think you can close the issue and we'll leave this workaround for others to find.