Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bash.exe 25% CPU usage and Stuck #358

Closed
iFocsy opened this issue May 13, 2016 · 14 comments
Closed

Bash.exe 25% CPU usage and Stuck #358

iFocsy opened this issue May 13, 2016 · 14 comments

Comments

@iFocsy
Copy link

iFocsy commented May 13, 2016

I"m having a quite strange problem when installing Ubuntu Bash on Windows 10 Build 14342, after installing i get "Installation Successful!", after this it does get stuck there and creates another process called bash which keep stuck around 25% CPU usage.

bash

@benhillis
Copy link
Member

This is interesting. We run some post-install commands to fix #143 and it's possible one of those is hanging. While you're in this state you should be able to run bash.exe, could you run bash.exe and run 'ps x' and tell me what commands are running?

@iFocsy
Copy link
Author

iFocsy commented May 17, 2016

First Scenario:

  1. Enabled Bash Features on Add/Remove Windows Features.
  2. Restarted.
  3. Run Bash.exe via windows Start Menu
  4. Accept the license.

Result: Installation Successful! and after this, bash.exe gets around 25% CPU use and i can't even finish the process, the only way is restarting computer.

Second Scenario:

  1. Restart computer, after bash says it is installed.
  2. Run Bash.exe from start menu.
  3. Nothing is started, Bash.exe goes to Task Manager already in 25% CPU usage and can't be finished, not even logging off, only restarting.

@MarioRicalde
Copy link

I'm having this exact same issue as stated in the comment above. The process just hangs. The installation is not completed. It stops right before you get requested to create the user.

@benhillis
Copy link
Member

benhillis commented Jun 21, 2016

@MarioRicalde Can you share the following information with me? I'd like to try to reproduce this on my end but I have not been able to.

  1. Which Windows build number are you running?
  2. What Windows locale is your install?
  3. What is your Windows username?
  4. Any other configuration differences you can think of from a fresh Windows install.

Thanks!

@MarioRicalde
Copy link

@benhillis Of course, although I already did a clean install to get it to work, I'm going to name some things from memory.

  1. I was using Windows Build 14342.1002
  2. My locale is English.
  3. Username was "M" ( new installation has the same username )
  4. What I did was "upgrade" a previous Windows Installation using the .iso (keeping files and config), so there's definitely a lot of things that could have gone wrong. I looked into some issues here on GitHub before doing a clean install and I made sure that I had no weird characters on my username or user directory name.

Cheers!

@benhillis
Copy link
Member

@MarioRicalde - So to confirm, you had WSL installed before upgrading, and after upgrading you were unable to launch bash?

If so, did you install many apt packages? I wonder if something got added to your .bashrc file that we're hanging on when trying to load bash. If anybody else is hitting this I'd be interested if you could run the below command and share the output:

bash.exe -c "ps auxf"

@MarioRicalde
Copy link

@benhillis - My apologies for the confusing information. What I was trying to say was that I had a non-insider version of Windows. And I applied the upgrade via the .iso. I kept the files and what not. Everything seemed to work fine, except when installing Bash. It would hang just hang everytime.

I don't have access to that Windows Installation anymore since I did a clean install, now everything works.

@benhillis
Copy link
Member

@MarioRicalde - Thank you for the clarification. Which OS were you upgrading from? Win 10?

@MarioRicalde
Copy link

@benhillis yes, it was an upgrade from Windows 10 non-insider to insider.

@benhillis
Copy link
Member

benhillis commented Jun 28, 2016

Thanks for the information. Would it be possible for you to take a sample profile trace of you launching bash.exe? Since we can't reproduce this locally this would be very beneficial for us to see /bin/bash is getting stuck.

  1. Download and install the SDK form https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk
  2. Run this command from an admin command prompt to start the trace:
    xperf.exe -on PROC_THREAD+LOADER+INTERRUPT+DPC+PROFILE -stackwalk profile -minbuffers 16 -maxbuffers 1024 -flushtimer 0 -f tmp.etl
  3. Launch bash.exe
  4. Wait a couple of minutes
  5. Run this in an admin command prompt to stop the trace:
    xperf.exe -d profile.etl
  6. Email profile.etl to: [email protected]. Include in the subject / message to forward to the WSL team. In the body of the email mention it is for benhill and russalex.

@benhillis
Copy link
Member

Shoutout to @N00byEdge who helped me identify the problem.

@MarioRicalde Can you confirm for me that you have more than one pagefile on your system?

See more info here: #538 (comment)

@chunchengwei
Copy link

I meet the same problem when using version 1607.
when I using bash to compile cern root, the cpu around 20 -30 %.
This is so slow.

@RowboTony
Copy link

RowboTony commented Apr 21, 2017

I have encountered this on the latest WSL build. Bash is installed completely. However, while compiling Ruby I noticed the (quad core) CPU is limited to 25%. Thus Ruby took about 15 minutes to compile. Is this a WSL feature? To limit CPU usage to 25%?

@aseering
Copy link
Contributor

Hi @tgroff -- WSL has no CPU limitations. I have a quad-core processor as well and I have no trouble using it up to 100%.

25% sounds like you're just using one of your cores. Which is what would happen with a simple serial build. I've never built Ruby before, but I suspect you have to do something to request a parallel build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants