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 strace on the running swaynag process 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-r to run the reload command.
    • sway reloaded and presented the typical message saying there is an error in the config at the top of the screen
    • Clicked the Toggle details button to show actual error
    • Fixed the error in my sway config
    • Hit $mod-shift-r to run the reload command (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 top and noticed swaynag was using 100% of a single code, and over 30GB of memory + swap. See below screenshot

screenshot_2020-03-25_10-40-18

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 8
  • Comments: 16 (4 by maintainers)

Commits related to this issue

Most upvoted comments

swaynag receives POLLHUP. It means the socket has been closed. swaynag should handle this properly.