wslbridge icon indicating copy to clipboard operation
wslbridge copied to clipboard

wslbridge error

Open soundnotation opened this issue 4 years ago • 4 comments

I'm using ConEmu to open bash. I use to call it via a link to ConEmu with the following target: "C:\Program Files\ConEmu\ConEmu64.exe" /cmd @dev.txt My dev.txt is under C:\Program Files\ConEmu and contains the following line, as described here: >bash --rcfile <(echo '. ~/.bashrc; some_command_that_connects_to_another_server') -cur_console:n

After the last Windows 10 update, my ConEmu bash window disappears right after calling it. From what I can see before it goes away, it puts a line that says: /bin/bash: '.: no such file or directory Before today, it worked without issues.

Plus, I get the following error when trying to open bash within an open instance of ConEmu:

wslbridge error: failed to start backend process
note: backend error output: -v: -c: line 0: unexpected EOF while looking for matching `''
-v: -c: line 1: syntax error: unexpected end of file


ConEmuC: Root process was alive less than 10 sec, ExitCode=0.
Press Enter or Esc to close console...

I believe this has something to do with wslbridge specifically.

My ConEmu task for {Bash::bash} is set as following: set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt

soundnotation avatar Sep 10 '20 10:09 soundnotation

I have the same issue as of today after a Windows update.

A workaround I found is to change the ConEmu task to: set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & wsl -cur_console:pm:/mnt

BrandtHill avatar Sep 10 '20 17:09 BrandtHill

@BrandtHill regarding the task, your workaround works, thanks. Regarding my problem, I changed the command in the .txt file as follows: >bash -c ". ~/.bashrc; ssh server; bash" -cur_console:n (final bash is to let the console stay open) It works, but this makes the following dialog appear when trying to close the console:

drawing

which didn't appear before.

soundnotation avatar Sep 11 '20 09:09 soundnotation

It works, but this makes the following dialog appear when trying to close the console:

drawing

which didn't appear before.

is solved by https://superuser.com/a/1365351 and changing the content of the .txt file to

>bash -c ". ~/.bashrc; some_command_that_connects_to_another_server; bash" -cur_console:n

But:

Plus, I get the following error when trying to open bash within an open instance of ConEmu:

wslbridge error: failed to start backend process
note: backend error output: -v: -c: line 0: unexpected EOF while looking for matching `''
-v: -c: line 1: syntax error: unexpected end of file


ConEmuC: Root process was alive less than 10 sec, ExitCode=0.
Press Enter or Esc to close console...

is still valid, unfortunately. As @BrandtHill and I said before,

A workaround I found is to change the ConEmu task to: set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & wsl -cur_console:pm:/mnt

works, but I believe there's something wrong with %ConEmuBaseDirShort%\conemu-cyg-64.exe when using

set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt

as ConEmu task for {Bash::bash}.

soundnotation avatar Sep 16 '20 11:09 soundnotation

The root cause seems to be a behavior change of base.exe after Windows 10 Update KB4576484, as I mentioned in microsoft/WSL#5932 . Therefore in frontend/wslbridge.cc, this in the end causes cmdLine which has bashCmdLine appended and quoted got misinterpreted by bash.exe, effectively causing this error.

I'm not sure if such behavior change of bash.exe is expected, but I would then by this chance propose a solution where command line strings that are passed into CreateProcess shall be processed and quoted in a manner that obeys the logic mentioned in msdn thus could be parsed and understood by cmd/CommandLineToArgvW .

gnaggnoyil avatar Sep 16 '20 16:09 gnaggnoyil