sway: swaynag: infinite loop on POLLHUP
-
Sway Version: sway version 1.4-b34c198f (Mar 22 2020, branch ‘master’)
-
OS: Archlinux / wayland 1.18.0-1
-
Debug Log: Sway had not been started in with debug logging
-
Configuration File: https://github.com/jfchevrette/dotfiles/blob/master/sway/.config/sway/config
-
Stack Trace, if sway crashes: I ran
straceon the runningswaynagprocess and all there was was the following line repeated thousands of times per second over and over
1392818 poll([{fd=298, events=POLLIN}], 1, -1) = 1 ([{fd=298, revents=POLLIN|POLLHUP}])
1392818 poll([{fd=298, events=POLLIN}], 1, -1) = 1 ([{fd=298, revents=POLLIN|POLLHUP}])
1392818 poll([{fd=298, events=POLLIN}], 1, -1) = 1 ([{fd=298, revents=POLLIN|POLLHUP}])
- Steps that lead to the problem:
- Introduced an error in my config
- Hit
$mod-shift-rto run thereloadcommand. - sway reloaded and presented the typical message saying there is an error in the config at the top of the screen
- Clicked the
Toggle detailsbutton to show actual error - Fixed the error in my sway config
- Hit
$mod-shift-rto run thereloadcommand (without first closing the swaynag bar) - Went on with my day. Then about 45 min later, noticed my computer was becoming super slow. Looked at
topand noticedswaynagwas using 100% of a single code, and over 30GB of memory + swap. See below screenshot

About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 8
- Comments: 16 (4 by maintainers)
Commits related to this issue
- swaynag: exit on wl_display_roundtrip error fixes loop when sway closes the socket in the middle of querying outputs, see #5138. — committed to martinetd/sway by martinetd 4 years ago
- swaynag: exit on wl_display_roundtrip error fixes loop when sway closes the socket in the middle of querying outputs, see #5138. — committed to martinetd/sway by martinetd 4 years ago
- swaynag: exit on wl_display_roundtrip error fixes loop when sway closes the socket in the middle of querying outputs, see #5138. — committed to martinetd/sway by martinetd 4 years ago
- swaynag: exit on wl_display_roundtrip error fixes loop when sway closes the socket in the middle of querying outputs, see #5138. — committed to swaywm/sway by martinetd 4 years ago
swaynag receives
POLLHUP. It means the socket has been closed. swaynag should handle this properly.