Skip to content

emacsclient (+ tmux + zsh) = hung processes #1127

Closed

Description

  • A brief description

This is a bit hard to pin down, but some combination of tmux + zsh + emacsclient results in a hung environment. There is also no way to kill the zombie processes without rebooting.

It is possible to launch a new install of bash and run top to see running processes, but tools like ps just hang.

In the top output you will see (unkillable) processes for emacs and zsh.

At this point the only solution is to reboot.

Some notes:

  • This only seems to happen with emacsclient
  • It does not happen right away... I have been able to launch 5+ emacsclients before this happens, but other times it occurs on the first launch
  • Plain bash + emacs (not emacsclient) can also trigger this, although it is usually after an hour or so of work and I have yet to see this happen with build 14931
  • Build 14931 is an improvement as in earlier builds this would result in a BSOD instead of just hanging the bash process
  • This happens in all combinations of: conhost, wsltty, conemu, and terminator exported via VcXsrv
  • The only seems to happen with emacs or emacsclient... I have not been able to replicate this with vim
  • Just noticed that in the emacs instance the error is: [persp-mode] Error: Can not deactivate frame.
  • This is nearly guaranteed when using tmux but may or may not occur without it.
  • Ditto with zsh
  • Your Windows build number
    14931

Activity

  1. glenstarchman commented on Sep 26, 2016

    @glenstarchman
    Author

    Some additional information... this may be somehow related to ensime. I was just able to reproduce, but killing the java process behind ensime-server allowed me to launch emacs in a new bash instance.

  2. fpqc commented on Sep 26, 2016

    @fpqc

    Glen Starchman (@glenstarchman) Yeah, I already demonstrated this with tmux and oh-my-zsh. They're working on it. I'm 99% sure that it involves the pty implementation.

  3. benhillis commented on Sep 26, 2016

    @benhillis
    Member

    fpqc Glen Starchman (@glenstarchman) - We identified a locking issue in our pty code that has been resolved and will be in an Insider build soon.

  4. glenstarchman commented on Sep 26, 2016

    @glenstarchman
    Author

    Thanks, guys... my normal Linux setup is so close to working with WSL. Almost there.

  5. glenstarchman commented on Sep 29, 2016

    @glenstarchman
    Author

    With build 14936 general crashes of the above seem to have gone away. However, launching more than 1 instance of emacsclient within a single bash window will hang the entire system... while normal emacs works just fine. For now a workaround is to launch server-start from within a WINDOWS emacs. Once that occurs you can launch as many emacslients as you want from within bash.

  6. fpqc commented on Sep 29, 2016

    @fpqc

    Glen Starchman (@glenstarchman) Does it hang the system (I haven't seen this happen since Win9x) or does it bugcheck/bsod? BSOD is a known issue in this build, says it on the changelog site.

  7. glenstarchman commented on Oct 2, 2016

    @glenstarchman
    Author

    I have narrowed this down even further. The culprit appears to be spacemacs and emacsclient in conjunction. Something in the way they are loading packages causes a hang in the terminal (eg, unresponsive in cmd, mintty, and terminator). Once this happens it is impossible to launch a bash instance again without a reboot. Digging deeper today.

  8. glenstarchman commented on Oct 2, 2016

    @glenstarchman
    Author

    fpqc I should have been more explicit. It hangs whatever terminal bash is running in. Once that happens the only way to continue to use bash is a reboot.

    I have not received a single BSOD in this version, so that is very hopeful.

    Edit to add: Of course I got a BSOD immediately after sending this (CRITICAL_PROCESS_DIED). Still, getting closer!

  9. fpqc commented on Oct 2, 2016

    @fpqc
  10. fpqc commented on Oct 2, 2016

    @fpqc

    Glen Starchman (@glenstarchman) btw if you can submit a memdump to Russ Alexander (@russalex) or Ben Hillis (@benhillis) It will probably be useful.

  11. glenstarchman commented on Oct 12, 2016

    @glenstarchman
    Author

    Update: No BSOD in latest build, but emacsclient still hangs the entire subsystem. I'll do some more digging later today.

  12. fpqc commented on Oct 12, 2016

    @fpqc

    Glen Starchman (@glenstarchman) Same. It no longer hangs rebooting my system, but it isn't fixed

    (with oh my zsh and tmux).

  13. glenstarchman commented on Oct 12, 2016

    @glenstarchman
    Author

    fpqc I can actually duplicate this without tmux or oh-my-ssh. It is not always consistent, but launching one or more emacsclient instances (or even multiple emacs instances) will render the entire subsystem unusable. This is using vanilla bash in the normal console.

    Note: I have been able to replicate this with vanilla emacs, prelude, and spacemacs both with and without tmux and oh-my-zsh. My current thought is that it has something to do with drawing multiple emacs frames. I noticed that the the Windows native emacs also seems to have some trouble with freezing from time to time and wonder if it is somehow related. I can use tmux, oh-my-zsh and multiple vim instances without any problem at all.

    Edited to add: it is impossible to get a strace of what is happening because the terminal just hangs. If anyone has a good solution for debugging this further I am happy to try it!

  14. fpqc commented on Oct 12, 2016

    @fpqc

    Happens wo emacs. It is ptys in general.

  15. 4 remaining items

  16. glenstarchman commented on Oct 21, 2016

    @glenstarchman
    Author

    Not sure if this is helpful or not but in the latest build simply launching zsh can completely hang the bash process. Looking forward for the fix! I can work with not having zsh (painfully) but a hanging emacsclient is a deal breaker.

    Edited to add: I don't boot into Windows too often. As soon as I posted this I saw there is a new build. Hopefully some changes in there :-)

  17. russalex commented on Oct 21, 2016

    @russalex
    Contributor

    I have not tested with emacsclient. I have to admit I am not an emacs person.

    Happy to repro this one myself if someone can give me the steps. I want to make certain I am installing / running emacs the same way as everyone else.

    The tmux + zsh one I did validate is fixed internally.

  18. glenstarchman commented on Oct 21, 2016

    @glenstarchman
    Author

    +1 on the tmux + zsh. My guess is that the fix for that will also fix the emacsclient issue. However, to attempt to duplicate do the following:

    emacs --daemon
    then launch a few emacsclient -t [filename] instances.

    Sometimes it freezes at one but other times it takes a few different clients... but eventually it will completely freeze the bash process.

  19. russalex commented on Oct 22, 2016

    @russalex
    Contributor

    I was never able to repro this. A screen like this should freeze, correct?

    image

    Tried on 14951 but really put it through it's paces on an internal build. The screenshot is internal and has:

    1. 32 emacsclient instances in 2 tmux windows (~/tmp/emacsclient -t foo)
    2. A tmux window where I held down the return key for about 15 seconds

    Other than the internal build, only thing special I can think of is I have a .tmux.conf of set-option -g mouse on.

  20. fpqc commented on Oct 22, 2016

    @fpqc

    Russ Alexander (@russalex) I'll have you know that on a proper (non-Apple) keyboard, it is called an Enter key. =O!!!!

    Also I haven't been able to get emacs to do it, so confirming no repro.

  21. glenstarchman commented on Oct 22, 2016

    @glenstarchman
    Author

    The latest build is much more stable and so far I have only experienced a freeze when closing an emacs window. Almost there!

  22. comzyh commented on Nov 4, 2016

    @comzyh

    Build 14959 seems solved this issue.

  23. glenstarchman commented on Nov 8, 2016

    @glenstarchman
    Author

    I have not seen this issue occur on build 14959, although on first run I got a BSOD using WSL on Mintty. Using a native Linux terminal exported via an xserver works just fine.

  24. fpqc commented on Nov 8, 2016

    @fpqc

    Glen Starchman (@glenstarchman) If you can find the minidump (I couldn't when I had a bugcheck), try seeing if you can send it over to [email protected] (email them first and they will tell you how and where to put it).

  25. glenstarchman commented on Nov 15, 2016

    @glenstarchman
    Author

    I have been unable to duplicate any issues with 14965. There are a few random freezes and whatnot within Spacemacs, but I really think this has more to do with Spacemacs than the build.

  26. russalex commented on Nov 15, 2016

    @russalex
    Contributor

    Thanks Glen Starchman (@glenstarchman). I am going to go aheadand close this one out.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions