microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.55k stars 823 forks source link

calling exe from ssh on WSL2 will cause `UtilAcceptVsock:244: accept4 failed 110` #8677

Open anatawa12 opened 2 years ago

anatawa12 commented 2 years ago

Version

Microsoft Windows [Version 10.0.22000.795]

WSL Version

Kernel Version

5.10.102.1

Distro Version

Ubuntu 22.04

Other Software

Visual Studio/2022/Community

Repro Steps

  1. setup & start the ssh server via systemctl
  2. run some exe included in VisualStudio on ssh

    $ "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX64\x64\cl.exe"
    $ "/mnt/c/Windows/system32/cmd.exe"

Expected Behavior

run cl.exe successfully

Actual Behavior

error

anatawa12@wsl-2204:~$ "/mnt/c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.30.30705/bin/HostX64/x64/cl.exe"
<3>init: (4870) ERROR: UtilAcceptVsock:244: accept4 failed 110
                                                              anatawa12@wsl-2204:~$
anatawa12@wsl-2204:~$ "/mnt/c/Windows/system32/cmd.exe"
<3>init: (6522) ERROR: UtilAcceptVsock:244: accept4 failed 110
                                                              anatawa12@wsl-2204:~$

Diagnostic Logs

execve("/mnt/c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.30.30705/bin/HostX64/x64/cl.exe", ["/mnt/c/Program Files/Microsoft V"...], 0x7fffdcfb4f38 /* 26 vars */) = 0
arch_prctl(ARCH_SET_FS, 0x356ce0)       = 0
set_tid_address(0x356d18)               = 5428
brk(NULL)                               = 0x5ab000
brk(0x5ac000)                           = 0x5ac000
gettid()                                = 5428
gettid()                                = 5428
gettid()                                = 5428
gettid()                                = 5428
sched_getaffinity(0, 128, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) = 32
brk(0x5ad000)                           = 0x5ad000
getpid()                                = 5428
getcwd("/home/anatawa12", 4096)         = 16
uname({sysname="Linux", nodename="wsl-2204", ...}) = 0
getcwd("/home/anatawa12", 4096)         = 16
open("/mnt/c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.30.30705/bin/HostX64/x64/cl.exe", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_PATH) = 3
readlink("/proc/self/fd/3", "/mnt/c/Program Files/Microsoft V"..., 4095) = 108
fstat(3, {st_mode=S_IFREG|0555, st_size=403904, ...}) = 0
stat("/mnt/c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.30.30705/bin/HostX64/x64/cl.exe", {st_mode=S_IFREG|0555, st_size=403904, ...}) = 0
close(3)                                = 0
open("/proc/self/mountinfo", O_RDONLY)  = 3
readv(3, [{iov_base="", iov_len=0}, {iov_base="226 85 8:32 / / rw,relatime - ex"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="oexec,relatime - cgroup cgroup r"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="fs none rw,mode=755\n248 247 0:42"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="mnt/c rw,noatime - 9p drvfs rw,d"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="tl fusectl rw\n267 226 8:32 /snap"..., iov_len=1024}], 2) = 1004
readv(3, [{iov_base="", iov_len=0}, {iov_base="", iov_len=1024}], 2) = 0
close(3)                                = 0
getcwd("/home/anatawa12", 4096)         = 16
open("/proc/self/mountinfo", O_RDONLY)  = 3
readv(3, [{iov_base="", iov_len=0}, {iov_base="226 85 8:32 / / rw,relatime - ex"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="oexec,relatime - cgroup cgroup r"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="fs none rw,mode=755\n248 247 0:42"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="mnt/c rw,noatime - 9p drvfs rw,d"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="tl fusectl rw\n267 226 8:32 /snap"..., iov_len=1024}], 2) = 1004
readv(3, [{iov_base="", iov_len=0}, {iov_base="", iov_len=1024}], 2) = 0
close(3)                                = 0
getppid()                               = 5425
access("/run/WSL/5425_interop", F_OK)   = -1 ENOENT (No such file or directory)
open("/proc/5425/stat", O_RDONLY)       = 3
readv(3, [{iov_base="", iov_len=0}, {iov_base="5425 (strace) S 530 5425 530 348"..., iov_len=1024}], 2) = 320
brk(0x5ae000)                           = 0x5ae000
close(3)                                = 0
access("/run/WSL/530_interop", F_OK)    = -1 ENOENT (No such file or directory)
open("/proc/530/stat", O_RDONLY)        = 3
readv(3, [{iov_base="", iov_len=0}, {iov_base="530 (bash) S 529 530 530 34817 5"..., iov_len=1024}], 2) = 331
close(3)                                = 0
access("/run/WSL/529_interop", F_OK)    = -1 ENOENT (No such file or directory)
open("/proc/529/stat", O_RDONLY)        = 3
readv(3, [{iov_base="", iov_len=0}, {iov_base="529 (sshd) R 424 424 424 0 -1 41"..., iov_len=1024}], 2) = 167
close(3)                                = 0
access("/run/WSL/424_interop", F_OK)    = -1 ENOENT (No such file or directory)
open("/proc/424/stat", O_RDONLY)        = 3
readv(3, [{iov_base="", iov_len=0}, {iov_base="424 (sshd) S 344 424 424 0 -1 41"..., iov_len=1024}], 2) = 179
close(3)                                = 0
access("/run/WSL/344_interop", F_OK)    = -1 ENOENT (No such file or directory)
open("/proc/344/stat", O_RDONLY)        = 3
readv(3, [{iov_base="", iov_len=0}, {iov_base="344 (sshd) S 1 344 344 0 -1 4194"..., iov_len=1024}], 2) = 169
close(3)                                = 0
access("/run/WSL/1_interop", F_OK)      = 0
socket(AF_UNIX, SOCK_SEQPACKET|SOCK_CLOEXEC, 0) = 3
connect(3, {sa_family=AF_UNIX, sun_path="/run/WSL/1_interop"}, 110) = 0
write(3, "\22\0\0\0\10\0\0\0", 8)       = 8
poll([{fd=3, events=POLLIN}], 1, 10000) = 1 ([{fd=3, revents=POLLIN|POLLHUP}])
read(3, "Ubuntu-22.04", 256)            = 12
close(3)                                = 0
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, TIOCGPGRP, [5425])             = 0
getpgid(0)                              = 5425
fstat(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x1), ...}) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x1), ...}) = 0
fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x1), ...}) = 0
ioctl(0, TIOCGWINSZ, {ws_row=50, ws_col=361, ws_xpixel=5054, ws_ypixel=1700}) = 0
ioctl(0, SNDCTL_TMR_START or TCSETS, {B38400 -opost -isig -icanon -echo ...}) = 0
                                                                                 dup(0)                                  = 3
                                                                                                                            socket(AF_VSOCK, SOCK_STREAM|SOCK_CLOEXEC, 0) = 4
                                                                                                                                                                             bind(4, {sa_family=AF_VSOCK, svm_cid=VMADDR_CID_ANY, svm_port=VMADDR_PORT_ANY, svm_flags=0}, 16) = 0
                                                                                                                                                                                                                                                                                 getsockname(4, {sa_family=AF_VSOCK, svm_cid=VMADDR_CID_ANY, svm_port=0x3aaa0d52, svm_flags=0}, [16]) = 0
                listen(4, 4)                            = 0
                                                           socket(AF_UNIX, SOCK_SEQPACKET|SOCK_CLOEXEC, 0) = 5
                                                                                                              connect(5, {sa_family=AF_UNIX, sun_path="/run/WSL/1_interop"}, 110) = 0
                                                                                                                                                                                     write(5, "\6\0\0\0T\1\0\0R\r\252:\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 340) = 340
                                                                                                                                                                                                                                                                              poll([{fd=4, events=POLLIN}], 1, 10000) = 0 (Timeout)
                                                                                                                                                                                                                                                                                                                                   getpid()                                = 5428
        writev(2, [{iov_base="<3>init: (5428) ERROR: UtilAccep"..., iov_len=63}, {iov_base=NULL, iov_len=0}], 2<3>init: (5428) ERROR: UtilAcceptVsock:244: accept4 failed 110
                                                                                                                                                                             ) = 63
                                                                                                                                                                                   close(5)                                = 0
                                                                                                                                                                                                                              close(4)                                = 0
                                                                                                                                                                                                                                                                         ioctl(3, SNDCTL_TMR_START or TCSETS, {B38400 opost isig icanon echo ...}) = 0
close(3)                                = 0
exit_group(-1)                          = ?
+++ exited with 255 +++
anatawa12@wsl-2204:~$
anatawa12@wsl-2204:~$ strace -ff "/mnt/c/Windows/system32/cmd.exe"
execve("/mnt/c/Windows/system32/cmd.exe", ["/mnt/c/Windows/system32/cmd.exe"], 0x7ffe74a603b8 /* 26 vars */) = 0
arch_prctl(ARCH_SET_FS, 0x356ce0)       = 0
set_tid_address(0x356d18)               = 6654
brk(NULL)                               = 0x895000
brk(0x896000)                           = 0x896000
gettid()                                = 6654
gettid()                                = 6654
gettid()                                = 6654
gettid()                                = 6654
sched_getaffinity(0, 128, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) = 32
brk(0x897000)                           = 0x897000
getpid()                                = 6654
getcwd("/home/anatawa12", 4096)         = 16
uname({sysname="Linux", nodename="wsl-2204", ...}) = 0
getcwd("/home/anatawa12", 4096)         = 16
open("/mnt/c/Windows/system32/cmd.exe", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_PATH) = 3
readlink("/proc/self/fd/3", "/mnt/c/Windows/system32/cmd.exe", 4095) = 31
fstat(3, {st_mode=S_IFREG|0555, st_size=331776, ...}) = 0
stat("/mnt/c/Windows/system32/cmd.exe", {st_mode=S_IFREG|0555, st_size=331776, ...}) = 0
close(3)                                = 0
open("/proc/self/mountinfo", O_RDONLY)  = 3
readv(3, [{iov_base="", iov_len=0}, {iov_base="226 85 8:32 / / rw,relatime - ex"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="oexec,relatime - cgroup cgroup r"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="fs none rw,mode=755\n248 247 0:42"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="mnt/c rw,noatime - 9p drvfs rw,d"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="tl fusectl rw\n267 226 8:32 /snap"..., iov_len=1024}], 2) = 1004
readv(3, [{iov_base="", iov_len=0}, {iov_base="", iov_len=1024}], 2) = 0
close(3)                                = 0
getcwd("/home/anatawa12", 4096)         = 16
open("/proc/self/mountinfo", O_RDONLY)  = 3
readv(3, [{iov_base="", iov_len=0}, {iov_base="226 85 8:32 / / rw,relatime - ex"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="oexec,relatime - cgroup cgroup r"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="fs none rw,mode=755\n248 247 0:42"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="mnt/c rw,noatime - 9p drvfs rw,d"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="tl fusectl rw\n267 226 8:32 /snap"..., iov_len=1024}], 2) = 1004
readv(3, [{iov_base="", iov_len=0}, {iov_base="", iov_len=1024}], 2) = 0
close(3)                                = 0
getppid()                               = 6651
access("/run/WSL/6651_interop", F_OK)   = -1 ENOENT (No such file or directory)
open("/proc/6651/stat", O_RDONLY)       = 3
readv(3, [{iov_base="", iov_len=0}, {iov_base="6651 (strace) S 530 6651 530 348"..., iov_len=1024}], 2) = 320
brk(0x898000)                           = 0x898000
close(3)                                = 0
access("/run/WSL/530_interop", F_OK)    = -1 ENOENT (No such file or directory)
open("/proc/530/stat", O_RDONLY)        = 3
readv(3, [{iov_base="", iov_len=0}, {iov_base="530 (bash) S 529 530 530 34817 6"..., iov_len=1024}], 2) = 330
close(3)                                = 0
access("/run/WSL/529_interop", F_OK)    = -1 ENOENT (No such file or directory)
open("/proc/529/stat", O_RDONLY)        = 3
readv(3, [{iov_base="", iov_len=0}, {iov_base="529 (sshd) R 424 424 424 0 -1 41"..., iov_len=1024}], 2) = 167
close(3)                                = 0
access("/run/WSL/424_interop", F_OK)    = -1 ENOENT (No such file or directory)
open("/proc/424/stat", O_RDONLY)        = 3
readv(3, [{iov_base="", iov_len=0}, {iov_base="424 (sshd) S 344 424 424 0 -1 41"..., iov_len=1024}], 2) = 179
close(3)                                = 0
access("/run/WSL/344_interop", F_OK)    = -1 ENOENT (No such file or directory)
open("/proc/344/stat", O_RDONLY)        = 3
readv(3, [{iov_base="", iov_len=0}, {iov_base="344 (sshd) S 1 344 344 0 -1 4194"..., iov_len=1024}], 2) = 169
close(3)                                = 0
access("/run/WSL/1_interop", F_OK)      = 0
socket(AF_UNIX, SOCK_SEQPACKET|SOCK_CLOEXEC, 0) = 3
connect(3, {sa_family=AF_UNIX, sun_path="/run/WSL/1_interop"}, 110) = 0
write(3, "\22\0\0\0\10\0\0\0", 8)       = 8
poll([{fd=3, events=POLLIN}], 1, 10000) = 1 ([{fd=3, revents=POLLIN|POLLHUP}])
read(3, "Ubuntu-22.04", 256)            = 12
close(3)                                = 0
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, TIOCGPGRP, [6651])             = 0
getpgid(0)                              = 6651
fstat(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x1), ...}) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x1), ...}) = 0
fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x1), ...}) = 0
ioctl(0, TIOCGWINSZ, {ws_row=50, ws_col=361, ws_xpixel=5054, ws_ypixel=1700}) = 0
ioctl(0, SNDCTL_TMR_START or TCSETS, {B38400 -opost -isig -icanon -echo ...}) = 0
                                                                                 dup(0)                                  = 3
                                                                                                                            socket(AF_VSOCK, SOCK_STREAM|SOCK_CLOEXEC, 0) = 4
                                                                                                                                                                             bind(4, {sa_family=AF_VSOCK, svm_cid=VMADDR_CID_ANY, svm_port=VMADDR_PORT_ANY, svm_flags=0}, 16) = 0
                                                                                                                                                                                                                                                                                 getsockname(4, {sa_family=AF_VSOCK, svm_cid=VMADDR_CID_ANY, svm_port=0x3aaa0d55, svm_flags=0}, [16]) = 0
                listen(4, 4)                            = 0
                                                           socket(AF_UNIX, SOCK_SEQPACKET|SOCK_CLOEXEC, 0) = 5
                                                                                                              connect(5, {sa_family=AF_UNIX, sun_path="/run/WSL/1_interop"}, 110) = 0
                                                                                                                                                                                     write(5, "\6\0\0\0\272\0\0\0U\r\252:\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 186) = 186
                                                                                                                                                                                                                                                                                 poll([{fd=4, events=POLLIN}], 1, 10000) = 0 (Timeout)
                                                                                                                                                                                                                                                                                                                                      getpid()                                = 6654
           writev(2, [{iov_base="<3>init: (6654) ERROR: UtilAccep"..., iov_len=63}, {iov_base=NULL, iov_len=0}], 2<3>init: (6654) ERROR: UtilAcceptVsock:244: accept4 failed 110
                                                                                                                                                                                ) = 63
                                                                                                                                                                                      close(5)                                = 0
                                                                                                                                                                                                                                 close(4)                                = 0
                                                                                                                                                                                                                                                                            ioctl(3, SNDCTL_TMR_START or TCSETS, {B38400 opost isig icanon echo ...}) = 0
close(3)                                = 0
exit_group(-1)                          = ?
+++ exited with 255 +++
anatawa12@wsl-2204:~$

WslLogs-2022-08-03_15-54-53.zip

benhillis commented 2 years ago

/logs

ghost commented 2 years ago

Hello! Could you please provide more logs to help us better diagnose your issue?

To collect WSL logs, download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging

Thank you!

anatawa12 commented 2 years ago

I've uploaded wsl logs.

benhillis commented 2 years ago

Thanks for the logs. The issue here is that sshd is not tied to a wsl.exe or wslhost.exe on the windows side (which handles interop requests). I have some thoughts on how to fix this, let me think about it a bit.

shoucandanghehe commented 1 year ago

looks like i have the same issue

Program Files (x86)/Gpg4win/bin🔒
❯ ./pinentry.exe
<3>WSL (1330) ERROR: UtilAcceptVsock:246: accept4 failed 110

Program Files (x86)/Gpg4win/bin🔒 took 10s
❯ strace -ff ./pinentry.exe
execve("./pinentry.exe", ["./pinentry.exe"], 0x7fff08717ee8 /* 38 vars */) = 0
arch_prctl(ARCH_SET_FS, 0x3e0470)       = 0
set_tid_address(0x3e0410)               = 1512
gettid()                                = 1512
gettid()                                = 1512
gettid()                                = 1512
gettid()                                = 1512
brk(NULL)                               = 0xe75000
brk(0xe77000)                           = 0xe77000
mmap(0xe75000, 4096, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xe75000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f66fa653000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f66fa652000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f66fa651000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f66fa650000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f66fa64f000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f66fa64e000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f66fa64d000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f66fa64c000
sched_getaffinity(0, 128, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]) = 32
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f66fa64a000
getpid()                                = 1512
getpid()                                = 1512
uname({sysname="Linux", nodename="wsl", ...}) = 0
getcwd("/mnt/c/Program Files (x86)/Gpg4win/bin", 4096) = 39
readlink("pinentry.exe", 0x7fff593ccdd0, 4096) = -1 EINVAL (无效的参数)
getcwd("/mnt/c/Program Files (x86)/Gpg4win/bin", 4097) = 39
open("/proc/self/mountinfo", O_RDONLY|O_LARGEFILE) = 3
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f66fa649000
read(3, "74 80 0:27 / /mnt/wsl rw,relatim"..., 1024) = 1024
read(3, "ode=000\n105 80 0:53 / /run rw,no"..., 1024) = 1024
read(3, "emory rw,nosuid,nodev,noexec,rel"..., 1024) = 1024
read(3, "dir=/systemvhd,upperdir=/system/"..., 1024) = 1024
read(3, ",mmap,access=client,msize=262144"..., 1024) = 46
read(3, "", 1024)                       = 0
close(3)                                = 0
munmap(0x7f66fa649000, 4096)            = 0
mmap(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f66fa646000
getcwd("/mnt/c/Program Files (x86)/Gpg4win/bin", 4096) = 39
munmap(0x7f66fa646000, 16384)           = 0
getcwd("/mnt/c/Program Files (x86)/Gpg4win/bin", 4096) = 39
open("/proc/self/mountinfo", O_RDONLY|O_LARGEFILE) = 3
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f66fa649000
read(3, "74 80 0:27 / /mnt/wsl rw,relatim"..., 1024) = 1024
read(3, "ode=000\n105 80 0:53 / /run rw,no"..., 1024) = 1024
read(3, "emory rw,nosuid,nodev,noexec,rel"..., 1024) = 1024
read(3, "dir=/systemvhd,upperdir=/system/"..., 1024) = 1024
read(3, ",mmap,access=client,msize=262144"..., 1024) = 46
read(3, "", 1024)                       = 0
close(3)                                = 0
munmap(0x7f66fa649000, 4096)            = 0
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, TIOCGPGRP, [1509])             = 0
getpgid(0)                              = 1509
fstat(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
ioctl(0, TIOCGWINSZ, {ws_row=35, ws_col=150, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(0, SNDCTL_TMR_START or TCSETS, {B38400 -opost -isig -icanon -echo ...}) = 0
                                                                                 dup(0)                                  = 3
                                                                                                                            socket(AF_VSOCK, SOCK_STREAM|SOCK_CLOEXEC, 0) = 4
                       bind(4, {sa_family=AF_VSOCK, svm_cid=VMADDR_CID_ANY, svm_port=VMADDR_PORT_ANY, svm_flags=0}, 16) = 0
                                                                                                                           getsockname(4, {sa_family=AF_VSOCK, svm_cid=VMADDR_CID_ANY, svm_port=0x8e4f9223, svm_flags=0}, [16]) = 0
                                                                             listen(4, 4)                            = 0
                                                                                                                        getppid()
          = 1509
                access("/run/WSL/1509_interop", F_OK)   = -1 ENOENT (没有那个文件或目录)
                                                                                        open("/proc/1509/stat", O_RDONLY|O_LARGEFILE) = 5
                                                                                                                                         mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f66fa649000
                                                                            read(5, "1509 (strace) S 9 1509 9 34816 1"..., 1024) = 316
                                                                                                                                      close(5)                                = 0
                           munmap(0x7f66fa649000, 4096)            = 0
                                                                      access("/run/WSL/9_interop", F_OK)      = -1 ENOENT (没有那个文件或目录)
                                                                                                                                              open("/proc/9/stat", O_RDONLY|O_LARGEFILE) = 5
                                      mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f66fa649000
                                                                                                                               read(5, "9 (bash) S 8 9 9 34816 1509 4194"..., 1024) = 322
                                   close(5)                                = 0
                                                                              munmap(0x7f66fa649000, 4096)            = 0
                                                                                                                         access("/run/WSL/8_interop", F_OK)      = -1 ENOENT (没有那个文件或目录)
                                           open("/proc/8/stat", O_RDONLY|O_LARGEFILE) = 5
                                                                                         mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f66fa649000
                            read(5, "8 (init) R 7 7 7 0 -1 4194624 20"..., 1024) = 164
                                                                                      close(5)                                = 0
                                                                                                                                 munmap(0x7f66fa649000, 4096)            = 0
                      access("/run/WSL/7_interop", F_OK)      = -1 ENOENT (没有那个文件或目录)
                                                                                              open("/proc/7/stat", O_RDONLY|O_LARGEFILE) = 5
                                                                                                                                            mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f66fa649000
                                                                               read(5, "7 (init) S 1 7 7 0 -1 4194624 21"..., 1024) = 164
                                                                                                                                         close(5)                                = 0
                              munmap(0x7f66fa649000, 4096)            = 0
                                                                         access("/run/WSL/1_interop", F_OK)      = 0
                                                                                                                    socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 5
              connect(5, {sa_family=AF_UNIX, sun_path="/run/WSL/1_interop"}, 110) = 0
                                                                                     write(5, "\7\0\0\0001\1\0\0#\222O\216\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 305) = 305
                            poll([{fd=4, events=POLLIN}], 1, 10000) = 0 (Timeout)
                                                                                 getpid()                                = 1512
                                                                                                                               writev(2, [{iov_base="<3>WSL (1512) ERROR: UtilAcceptV"..., iov_len=61}, {iov_base=NULL, iov_len=0}], 2<3>WSL (1512) ERROR: UtilAcceptVsock:246: accept4 failed 110
                                                                                                                                            ) = 61
                                                                                                                                                  close(5)                                = 0
                                       close(4)                                = 0
                                                                                  ioctl(3, SNDCTL_TMR_START or TCSETS, {B38400 opost isig icanon echo ...}) = 0
close(3)                                = 0
munmap(0x7f66fa64d000, 4096)            = 0
munmap(0x7f66fa64e000, 4096)            = 0
munmap(0x7f66fa64f000, 4096)            = 0
munmap(0x7f66fa650000, 4096)            = 0
munmap(0x7f66fa651000, 4096)            = 0
munmap(0x7f66fa653000, 4096)            = 0
exit_group(1)                           = ?
+++ exited with 1 +++

WslLogs-2023-02-06_03-22-30.zip When can we fix it?

speller commented 1 year ago

I'm facing this issue with Docker Desktop running from under WSL

<3>WSL (5984) ERROR: UtilAcceptVsock:248: accept4 failed 110

But not always, randomly.

mbilal100 commented 1 year ago

I'm also getting same issue randomly

2<3>WSL (13815) ERROR: UtilAcceptVsock:248: accept4 failed 110

logs:

socket(AF_VSOCK, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3
bind(3, {sa_family=AF_VSOCK, sa_data="\0\0\377\377\377\377\377\377\377\377\0\0\0\0"}, 16) = 0
getsockname(3, {sa_family=AF_VSOCK, sa_data="\0\0l\345Q\201\377\377\377\377\0\0\0\0"}, [16]) = 0
listen(3, 4)                            = 0
access("/run/WSL/19860_interop", F_OK)  = 0
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 4
connect(4, {sa_family=AF_UNIX, sun_path="/run/WSL/19860_interop"}, 110) = 0
write(4, "\7\0\0\0[\1\0\0l\345Q\201\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 347) = 347
poll([{fd=3, events=POLLIN}], 1, 10000) = 0 (Timeout)
getpid()                                = 13815
writev(2, [{iov_base="<3>WSL (13815) ERROR: UtilAccept"..., iov_len=62}, {iov_base=NULL, iov_len=0}], 2<3>WSL (13815) ERROR: UtilAcceptVsock:248: accept4 failed 110
) = 62
close(4)                                = 0
close(3) 
max-dekock commented 1 year ago

I'm getting this issue intermittently with Docker Desktop

<3>WSL (1965) ERROR: UtilAcceptVsock:248: accept4 failed 110

WslLogs-2023-04-03_10-54-32.zip

John-zhan commented 1 year ago

everytime execute "code .", it's always give a prompt like this "<3>WSL (51) ERROR: UtilAcceptVsock:248: accept4 failed 110" WslLogs-2023-04-06_13-44-57.zip we need to solve this problem, it's too annoying

mimikun commented 1 year ago

I'm also randomly getting similar issues.

In my case, I get an error(UtilAcceptVsock:248: accept4 failed 110) when I login to Ubuntu. I am using fish-shell as our Ubuntu login shell. config.fish contains the following: set -x WINDOWS_HOME_DIRECTORY (wslpath (wslvar USERPROFILE))

log is here: WslLogs-2023-04-08_22-14-38.zip

birdup000 commented 1 year ago

Interesting I'm receiving the same issue <3>WSL (20931) ERROR: UtilAcceptVsock:248: accept4 failed 110

birdup000 commented 1 year ago

Hello! Could you please provide more logs to help us better diagnose your issue?

To collect WSL logs, download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging

Thank you!

here's my logs WslLogs-2023-04-07_18-12-23.zip

G-Rath commented 1 year ago

As with others above, I've started getting this infrequently with some work I'm doing with Docker - previously I've been using docker for just local development which was mainly docker compose up powered which has never had this problem but this new work is related to deploying containers to ECS which involves docker build and docker push both of which are failing intermittently with this error.

My understanding is that the docker CLI on WSL is at some point talking to at least one exe managed by Docker for Windows, which could be why I'm hitting this (since everything else I'm doing is pure Ubuntu).

@OneBlue @benhillis I've not done any log collecting since it looks like there's a fair few already posted, but if either of you want to prioritize this I'm happy to be a guinea pig again to try and get any extra information you might need.

ghost commented 1 year ago

In my case, enabling the interop option in wsl.conf solved the problem.
It may not be a solution in every case, but I hope it helps someone.

https://learn.microsoft.com/en-us/windows/wsl/wsl-config#interop-settings

[interop]
enable = true
John-zhan commented 1 year ago

In my case, enabling the interop option in wsl.conf solved the problem. It may not be a solution in every case, but I hope it helps someone.

https://learn.microsoft.com/en-us/windows/wsl/wsl-config#interop-settings

[interop]
enable = true

yeah man you get it. the problem about my wsl has been fix through this method

bigfree commented 1 year ago

In my case, enabling the interop option in wsl.conf solved the problem. It may not be a solution in every case, but I hope it helps someone. https://learn.microsoft.com/en-us/windows/wsl/wsl-config#interop-settings

[interop]
enable = true

yeah man you get it. the problem about my wsl has been fix through this method

I have no idea how this setting can solve the problem, because the value enable doesn't exist in the official documentation.

There is a value enabled and its default true.

MitchellBot commented 1 year ago

I get this on occasion and removing "credsStore": "desktop.exe" from ~/.docker/config.json fixes it.

sherif-elmetainy commented 1 year ago

I had the same problem and @MitchellBot's solution fixed it for me. Thanks a lot.

patricknelson commented 1 year ago

Bizarrely, I got this error too when running an exe from WSL2 (in my case, git-credential-wincred.exe) and the "solves all" quick fix of restarting WSL apparently worked for me as well. i.e. from a command prompt:

wsl --shutdown
wsl

Also worth a shot for anyone else. Interestingly, this was only an issue for me after applying a Docker Desktop upgrade as well. Very odd.

Rcardu commented 1 year ago

In my case, enabling the interop option in wsl.conf solved the problem.就我而言,在wsl.conf中启用互操作选项解决了问题。 It may not be a solution in every case, but I hope it helps someone.它可能不是每种情况下的解决方案,但我希望它对某人有所帮助。

https://learn.microsoft.com/en-us/windows/wsl/wsl-config#interop-settings

[interop]
enable = true

my hero!

Moscode commented 5 months ago

Bizarrely, I got this error too when running an exe from WSL2 (in my case, git-credential-wincred.exe) and the "solves all" quick fix of restarting WSL apparently worked for me as well. i.e. from a command prompt:

wsl --shutdown
wsl

Also worth a shot for anyone else. Interestingly, this was only an issue for me after applying a Docker Desktop upgrade as well. Very odd.

This worked for the similar issue that I had. The ERROR code was UtilAcceptVsock:250 instead of UtilAcceptVsock:246.

ColumbusAI commented 2 months ago

Still getting this error when trying to run a llamafile in WSL2. @benhillis quick mention to see if this is on the team's radar?

kodie commented 2 months ago

In my case, enabling the interop option in wsl.conf solved the problem. It may not be a solution in every case, but I hope it helps someone. https://learn.microsoft.com/en-us/windows/wsl/wsl-config#interop-settings

[interop]
enable = true

yeah man you get it. the problem about my wsl has been fix through this method

I have no idea how this setting can solve the problem, because the value enable doesn't exist in the official documentation.

There is a value enabled and its default true.

@bigfree is correct. Adding this to your config will cause a wsl: Unknown key 'interop.enable' error.

Bizarrely, I got this error too when running an exe from WSL2 (in my case, git-credential-wincred.exe) and the "solves all" quick fix of restarting WSL apparently worked for me as well. i.e. from a command prompt:

wsl --shutdown
wsl

Also worth a shot for anyone else. Interestingly, this was only an issue for me after applying a Docker Desktop upgrade as well. Very odd.

This is what worked for me.

ColumbusAI commented 2 months ago

To clarify, the error I receive is this:

<3>WSL (5984) ERROR: UtilAcceptVsock:248: accept4 failed 110 It is not resolved by enabling or disabling Interop as I have tried both methods.
fchastanet commented 1 month ago

I had the same issue and I remarked that most of WSL RAM was used I stopped one vscode that was taking more than 4GB of memory ! I re-run vscode and this error disappeared