Skip to content

Completely freeze and zombify WSL with tmux and oh-my-zsh #1085

Closed

Description

@fpqc
  • A brief description

Under specific but easy to reproduce conditions, tmux and oh-my-zsh will freeze the entire WSL and become unkillable even from the Windows task manager. It also becomes impossible to stop the LxssManager service, which gets stuck at the "Stopping" phase, and it is even unkillable by killing the service's PID with taskkill /f /PID in an administrative command prompt. The only way to kill it is by rebooting (I haven't tried elevating my commandprompt from administrator to NT Authority\System, maybe that would work, since even administrative taskkill is being told access denied.

  • Your Windows build number

Build 14926
(happens on earlier builds too, at least since 14905. Don't remember if it happened in anniversary)

  • Steps / All commands required to reproduce the error from a brand new installation

From a clean install of WSL:

Install dependencies:

sudo apt install tmux git curl zsh

Run the oh-my-zsh install script

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

While running the script, it will ask for your user password in order to change your default shell. This does not actually do anything with WSL, so whatever.

Now run tmux with tmux. Inside of tmux, you will have a bash prompt. From here, run zsh with zsh.

Now hold down the enter key for a while, continually entering an empty line, which should begin to scroll the screen. Eventually it will freeze and become totally unkillable, even with the Windows task manager, and even if you attempt to manually stop the LxssManager service with either sc or from the administrative tools snap-in.

  • Strace of the failing command
    Freezes, so no strace.
  • Required packages and commands to install
    tmux, git, curl, zsh (commands to install oh-my-zsh covered above)

By the way, this is definitely not a console issue, because it happens even if you try to do it from an X terminal.

Also, I tested this without oh-my-zsh, and it didn't freeze. When I looked at what oh-my-zsh does while screenscrolling outside of tmux, I noticed that intermittently, it's printing something that says "git:()". I think this might be related to the problem.

2016-09-15

Activity

  1. fpqc commented on Sep 16, 2016

    @fpqc
    Author

    By the way, I only was able to test on one machine. If anyone else could attempt to reproduce and confirm, it would be helpful.

  2. fpqc commented on Sep 16, 2016

    @fpqc
    Author

    By the way, I was playing with a few other programs, and I was able to get them to break on oh-my-zsh (the new mintty/wsltty, for example, will crash oh-my-zsh without tmux. I think the hang is related to the pty implementation, maybe).

  3. benhillis commented on Sep 16, 2016

    @benhillis
    Member

    fpqc - If you could narrow down a sequence of reproducible steps it'd be very useful to us.

  4. fpqc commented on Sep 16, 2016

    @fpqc
    Author

    Ben Hillis (@benhillis) I gave them above, from a clean install even.

    • Install git curl zsh and tmux
    • Install oh-my-zsh by running this command sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
    • run tmux
    • inside tmux, run zsh
    • hold down the enter key for a while until it freezes up.
  5. benhillis commented on Sep 16, 2016

    @benhillis
    Member

    fpqc Sorry, missed that :)

  6. fpqc commented on Sep 16, 2016

    @fpqc
    Author

    Ben Hillis (@benhillis) also, btw, if you change the theme in .zshrc from robbyrussell to pygmalion (it's right at the top of .zshrc after you install oh-my-zsh), it seems to hang much faster (sometimes in as few as eight lines). Not sure why that is. Could just be the fact that my sample space is small).

  7. fpqc commented on Sep 17, 2016

    @fpqc
    Author

    Ben Hillis (@benhillis) I know it's the weekend but I am dying to know if you got a chance to attempt reproduction.

  8. dethoma commented on Sep 19, 2016

    @dethoma

    Yes we got a repro and have a working theory on what is going wrong that led to this behavior. Once we have the fix ready we will certainly try to get it into the earliest possible insider build.

  9. fpqc commented on Sep 19, 2016

    @fpqc
    Author

    Great! Deepu Thomas (@dethoma) ! Did you get the bsod too?

  10. dethoma commented on Sep 19, 2016

    @dethoma

    Not yet, if you do narrow down the repro steps please do share it with us. Thanks for your help.

  11. fpqc commented on Sep 19, 2016

    @fpqc
    Author

    Deepu Thomas (@dethoma) I haven't been able to reproduce it myself, but I would have assumed that it generated a proper crashdump somewhere. I basically got it after repeatedly triggering this bug (to narrow down what part of oh-my-zsh was causing it), rebooting, then retrying. Once I finally thought I had found the culprit, I went to save a file inside of nano inside of tmux, and that's wot did it.

  12. arcanis commented on Sep 25, 2016

    @arcanis

    I think I've just hit this issue with a fresh build - no bsod, but a freezing bash, almost right after starting it

    Any workaround instead of disabling all of oh-my-zsh ?

  13. fpqc commented on Sep 25, 2016

    @fpqc
    Author

    Maël Nison (@arcanis) The freeze is the easy part, triggers very reliably with tmux and oh-my-zsh (I think it is a bug in the pty implementation, since I managed to trigger it outside of tmux). I have not yet been able to reproduce the bsod, but I think that might be disk i/o related, since it happened to me while saving my .zshrc file in nano (while using zsh in tmux).

  14. reopened this on Oct 7, 2016
  15. fpqc commented on Oct 7, 2016

    @fpqc
    Author

    Never mind. Still broken. Just got it to deadlock in 14942 as soon as I re-added completion and compfix.

  16. zadjii-msft commented on Oct 17, 2016

    @zadjii-msft
    Member

    For the sake of linking, this is probably related to #1127

  17. russalex commented on Oct 20, 2016

    @russalex
    Contributor

    The bad news: this bug looks to continue to happen in build 14951.

    The good news: I can not get this to reproduce on an internal build. We have made quite a few fixes which have not made it out to the Insider builds yet.

    image

    One interesting bit, I did see it display "git:()" once in testing. Not certain what's causing that.

  18. fpqc commented on Nov 5, 2016

    @fpqc
    Author

    Russ Alexander (@russalex) Seems good now. I worked all day with oh-my-zsh (with the completion and compfix libs re-added), and I haven't hit a deadlock. I didn't do the "enter key stress" test this time, but I am sure you guys have (and there is another issue open related to this anyway), so I am going to go ahead and close.

  19. nyanpasu64 commented on Aug 6, 2018

    @nyanpasu64

    I managed to encounter this on Windows Store Ubuntu (Xenial?) using a similar procedure. After installing Oh My Zsh, I tried navigating into a directory with a Git repository, and following some steps (I forgot what, it may have involved Ctrl+C on a particularly slow prompt), eventually freezing zsh; all attempts to start bash or wsl froze. In procexp, I have unkillable zombie zsh5 and git processes.

  20. nyanpasu64 commented on Aug 6, 2018

    @nyanpasu64

    Windows 10 Version 1709 (OS Build 16299.547)

    wsl freeze

    After pressing Ctrl+C, I get text $(virtualenv_prompt_info) on-screen. Opening the same Git repository in Git Bash, I get an error fatal: Unable to create 'C:/Users/jimbo1qaz/encrypted/code/wavetable/wavetable/.git/index.lock': File exists.

    Note that I have system-drive Veracrypt and a rather odd Windows directory hierarchy.

    • I entered the Git repository via %userprofile%/code/wavetable/wavetable, which looks innocent enough...
    • code/ is a Windows symlink to encrypted/code/
    • encrypted/ is a Windows symlink to Dropbox/encrypted/
    • Dropbox/encrypted/code/wavetable/wavetable is a Windows symlink to C:\Users\jimbo1qaz\encrypted\dirlinks\path\wavetable
      • Again, encrypted/ is a Windows symlink to Dropbox/encrypted/

    oh my god, my directory hierarchy is fucked.

    Should I create a new issue?

  21. yveslange commented on Apr 17, 2019

    @yveslange

    I have encountered this issue multiple times.
    Using WSL partially fixed the problem (the freezes happens less).

    I have removed Oh-my-zsh for the moment and I'm using woefe/git-prompt.zsh.

    Also, upgrading GIT to the latest version seemed to increase the performance by.. a lot

    sudo apt-add-respository ppa:git-core/ppa
    sudo apt-get update
    sudo apt-get install git
    

    So WSL tty + upgrading git + woefe = No freeze anymore

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