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

0xc0000142 error on powershell (running "cmd.exe /b /c start /b /min powershell.exe" inside WSL) #9542

Closed
1 of 2 tasks
emdns opened this issue Jan 26, 2023 · 4 comments
Closed
1 of 2 tasks

Comments

@emdns
Copy link

emdns commented Jan 26, 2023

Version

10.0.22000.1455

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.15.79.1

Distro Version

Debian and Ubuntu

Other Software

Powershell 5.1.22000.1335

Repro Steps

Launch wsl
Inside wsl bash shell type the command:
cmd.exe /b /c start /b /min powershell.exe

Expected Behavior

A powershell running

Actual Behavior

Powershell either silently fails to run or fails to run with the following popup:

image

Diagnostic Logs

WslLogs-2023-01-26_11-27-25.zip

@emdns
Copy link
Author

emdns commented Jan 26, 2023

@DHowett
(for vis)

@DHowett
Copy link
Member

DHowett commented Jan 27, 2023

@emdns Thanks for the tag. I think that this was fixed by a recent change we've made in Windows and will need some time to propagate out to all of our API consumers.

The specific issue:

cmd.exe is launched in a console session. cmd.exe /c start /b xyz launches application xyz inside the same console session and then immediately exits.

This means that depending on how quickly xyz starts up, it might not have a console any more. Because the session leader, cmd, just exited... which took down the console. :)

@emdns
Copy link
Author

emdns commented Jan 27, 2023

@DHowett thanks for the explanation
Just in case: I forgot to mention that the same code always works fine when launched outside WSL (in a regular cmd) but maybe WSL is just favoring the race condition?

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

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

No branches or pull requests

2 participants