Skip to content

slumber process hangs at 100% CPU if parent process is killed #136

Closed

Description

@LucasPickering

If slumber's parent process is killed (with SIGTERM, although not sure it matters how), instead of terminating the slumber process hangs at 100% CPU and stops responding to SIGTERM itself. I've noticed this with both watchexec and zellij as the parent.

Activity

  1. changed the title [-]`slumber` process hangs at 100% CPU[/-] [+]`slumber` process hangs at 100% CPU if parent process is killed[/+] on Mar 25, 2024
  2. LucasPickering commented on Apr 4, 2024

    @LucasPickering
    OwnerAuthor

    I got pretty far on diagnosing this but couldn't figure out a fix. A few things I found out:

    • Upgrading watchexec to 1.25.1 fixed the issue with watchexec (thanks to this PR)
    • Zellij sends SIGHUP to its child process on quit, and that signal isn't being handled properly
    • When the CPU goes to 100%, it's because it's stuck calling crossterm::poll
      • Despite giving a timeout, it never times out and just blocks on a read syscall
    • The issue is related to some interaction between crossterm::poll and having signal_hook catch SIGHUP
      • If you remove SIGHUP from this list, or remove the poll call, the issue disappears and the process exits gracefully

    I haven't figured out a way to reproduce this outside of zellij, so it's hard to submit a bug report anywhere for it. I'm not really sure if it's a bug in crossterm or signal_hook (or neither?).

  3. added 5 commits that reference this issue on Apr 29, 2024
    993b2cb
    19ee496
    4f05aef
    28bfc88
    a75ecff
  4. added a commit that references this issue on Apr 29, 2024
    7760728
  5. added a commit that references this issue on May 6, 2024
  6. added a commit that references this issue on May 11, 2026
  7. added a commit that references this issue on May 14, 2026
  8. added a commit that references this issue on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions