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

clip.exe hangs when redirecting output into it. #5648

Closed
EricWardner opened this issue Jul 24, 2020 · 30 comments
Closed

clip.exe hangs when redirecting output into it. #5648

EricWardner opened this issue Jul 24, 2020 · 30 comments

Comments

@EricWardner
Copy link

EricWardner commented Jul 24, 2020

Environment

Windows build number: 10.0.20175.1000
Your Distribution version: Ubuntu 18.04
WSL 2: Linux version 4.19.104-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Feb 19 06:37:35 UTC 2020

Steps to reproduce

echo "AAAA" | clip.exe

Expected behavior

AAAA get copied to my windows clipboard

Actual behavior

The command hangs and nothing is copied

@therealkenc
Copy link
Collaborator

therealkenc commented Jul 24, 2020

Ref #4475 (with a side of #4852). Am able to reproduce here. Consensus work-around is use a better clip application.

image

[ed] Wild speculation maybe an IPC thing unique to 20175. Do you use clip.exe a lot (I do not), and if so was it working before you recently got the Windows Update?

@EricWardner
Copy link
Author

I also do not use it often. Can't remember if it was working before the most recent update.

@Biswa96
Copy link

Biswa96 commented Jul 24, 2020

dmesg? ETW? Any logs.

@therealkenc
Copy link
Collaborator

dmesg? ETW? Any logs.

Nah. Turns out it isn't limited to clip.exe. Also hangs on:

$ ls | findstr.exe foo

Which used to work (at least to the extent the scenario didn't hang).

@EricWardner
Copy link
Author

EricWardner commented Jul 24, 2020

Work-around I'm using is just to output to a file first and then read it in to clip.exe

echo "AAAA" > file.tmp
clip.exe < file.tmp

@raisin-loaf
Copy link

This is also the case with win32yank which is automatically detected by Neovim meaning it's not currently possible to yank to the system clipboard from Neovim in WSL 2.

echo 'please please me?' | win32yank.exe -i hangs as per previous comments. It's not a problem on another computer that's still on build 20170.

Happy to gather additional info if someone can point me in the right direction. 🙂

@therealkenc
Copy link
Collaborator

It's not a problem on another computer that's still on build 20170.

Those are the words I was looking for. Thanks.

@benhillis benhillis self-assigned this Jul 25, 2020
@blumu
Copy link

blumu commented Jul 28, 2020

This bug also breaks the git credentials manager trick to authenticate in git under WSL via the Windows credential manager (git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-manager.exe")

@SR-Lut3t1um
Copy link

This Bug also breaks Docker :/

@zyazhb
Copy link

zyazhb commented Jul 30, 2020

Is this still not fix in build 2018?

@shadowmaster63
Copy link

shadowmaster63 commented Jul 30, 2020

Not work in Microsoft Windows [Version 10.0.20180.1000]
But Docker 2.3.0.4 install success.

@zyazhb
Copy link

zyazhb commented Jul 30, 2020

Not work in Microsoft Windows [Version 10.0.20180.1000]
But Docker 2.3.0.4 install success.

tnx for information i have tried to install docker in build 2018 but failed.

@shadowmaster63
Copy link

shadowmaster63 commented Jul 30, 2020

tnx for information i have tried to install docker in build 2018 but failed.

$ lsb_release -r
Release: 16.04
$ cat /proc/version
Linux version 4.19.121-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Fri Jun 19 21:06:10 UTC 2020

>wsl --list -v
  NAME                   STATE           VERSION
* Ubuntu                 Running         2
  docker-desktop-data    Running         2
  docker-desktop         Running         2

@Mortinke
Copy link

Mortinke commented Jul 30, 2020

I also get the same docker installation error with Build 20180 :(

@zyazhb
Copy link

zyazhb commented Jul 30, 2020

@shadowmaster63

$lsb_release -r                                                                 
Release:        18.04

$cat /proc/version
Linux version 4.19.121-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Fri Jun 19 21:06:10 UTC 2020

> wsl --list -v
  NAME            STATE           VERSION
* kali-linux      Stopped         2
  Ubuntu-18.04    Running         2
  Debian          Stopped         2

I have updated to build 2018 but when i install docker still:

 在 System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   在 System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
   在 System.Linq.Enumerable.<CastIterator>d__97`1.MoveNext()
   在 System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   在 System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   在 System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
   在 CommunityInstaller.EnableFeaturesAction.GetFeaturesToEnable()
   在 CommunityInstaller.EnableFeaturesAction.<DoAsync>d__37.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 CommunityInstaller.InstallWorkflow.<HandleD4WPackageAsync>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 CommunityInstaller.InstallWorkflow.<DoProcessAsync>d__27.MoveNext()

@DarkTraveler
Copy link

DarkTraveler commented Jul 30, 2020

I apologize everyone for my english!

After 10 unsuccessful attempts, I thought to do reinstall windows.
But at the very last moment I changed my mind ...

  1. We completely remove the Docker use script via PoweShell
    https://stackoverflow.com/questions/42161471/how-to-uninstall-docker-machine-under-windows-10/51167323#51167323

  2. Run the latest Docker installation, I took 2.3.4.0

  3. When installing, DO NOT select support for WSL2

  4. Docker is installed ... and a notification appears at startup, about the start of the WSL2 subsystem, I don't understand how, but the launch still occurs

  5. Docker itself did not completely start for me

  6. You need to get to the settings and run hard reset

  7. He is started, but unfortunately past manipulations cleared it :/ Nevertheless, I have already launched my working project
    P/s Because of something, I had to execute "docker-compose up" under sudo

  8. Also check that the marks about integration with wsl 2 distributions have not gone off (Resources / Wsl integration)

image
image

  1. maybe he's pretending ... that he works through wsl2 :)

image

@metcalfc
Copy link

Folks here for Docker issues. This WSL2 bug does effect Docker, it is not an issue with Docker. We are hopeful for a fix soon. Right now Windows 20175 and 20180 have this issue. You can disable the WSL2 backend in your Docker settings for now. You won't find docker in your WSL2 path anymore but you can work around this temporarily with:

alias docker=docker.exe

Docker on the Windows side (powershell, cmd, etc) will behave normally.

@bsosnowski
Copy link

Windows 20175 and 20180 have this issue

I have the same issue with 19041.423. I think it started with one of the updates.

@therealkenc
Copy link
Collaborator

I have the same issue with 19041.423.

The cause of this issue is known and applies only to Insider builds. If you are experiencing a problem on 19041.* that appears to have similar symptoms, please open a new tracker. Be sure to follow the template and be excruciatingly specific about the reproduction steps, in order to get a me2 from someone on 19041.

@nlundquist
Copy link

Still there in 20185 :(

@nguyennb9
Copy link

win32yank.exe was working perfectly in Neovim before I join the insider program. So that this bug happens with the new build only. I guess I have to use vscode while waiting for this bug fixed :(

Edition	Windows 10 Pro Insider Preview
Version	2004
Installed on	‎8/‎6/‎2020
OS build	20185.1000
Experience	Windows Feature Experience Pack 120.19801.0.0

@benhillis
Copy link
Member

/fixed 20190.

@ghost ghost closed this as completed Aug 12, 2020
@ghost ghost added the fixedininsiderbuilds label Aug 12, 2020
@ghost
Copy link

ghost commented Aug 12, 2020

This bug or feature request originally submitted has been addressed in whole or in part. Related or ongoing bug or feature gaps should be opened as a new issue submission if one does not already exist.

Thank you!

@sajithneyo
Copy link

I updated the windows yesterday. It's KB4566782 (OS Build 19041.450). Suddenly WSL 2 started crashing. Any fixes?

@benhillis
Copy link
Member

@sajithneyo - define "crashing". This is an unrelated issue.

@sajithneyo
Copy link

@benhillis my bad. opened #5760

@Siths
Copy link

Siths commented Aug 18, 2020

Anyways to get Docker Desktop installed?
Docker Desktop 2.3.0.4
Installation failed
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
at System.Linq.Enumerable.d__971.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at System.Linq.Enumerable.Any[TSource](IEnumerable1 source)
at CommunityInstaller.EnableFeaturesAction.GetFeaturesToEnable()
at CommunityInstaller.EnableFeaturesAction.d__37.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at CommunityInstaller.InstallWorkflow.d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at CommunityInstaller.InstallWorkflow.d__29.MoveNext()

@1two3code
Copy link

1two3code commented Mar 3, 2022

Since it has not been mentioned here yet:

This issue can also occur with <3>init: (2167) ERROR: UtilConnectUnix:467: connect failed 111 rather than just hanging the session.
In my case it was related to the $WSL_INTEROP pointing to the wrong parent.
This can be fixed by defining and executing the following function in your .bashrc, as explained by @lvlts here

fix_wsl2_interop() {
    for i in $(pstree -np -s $$ | grep -o -E '[0-9]+'); do
        if [[ -e "/run/WSL/${i}_interop" ]]; then
            export WSL_INTEROP=/run/WSL/${i}_interop
        fi
    done
}
fix_wsl2_interop

I hope this might help someone 🙏

@Yalian
Copy link

Yalian commented Jan 11, 2023

This bug seems that still persists as I'm experimenting the hangs with docker in build 22621

@ImBIOS
Copy link

ImBIOS commented Mar 9, 2024

This bug seems that still persists as I'm experimenting the hangs with docker in build 4.27.2 137060

This issue was closed.
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