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

runtime: epollwait failed with ENOSYS on Windows Subsystem for Linux #25384

Closed
zhengxiaoyao0716 opened this issue May 14, 2018 · 5 comments

Comments

Projects
None yet
4 participants
@zhengxiaoyao0716
Copy link

commented May 14, 2018

What version of Go are you using (go version)?

image

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

image

What did you do?

Download the go1.10.2.linux-amd64.tar.gz and extract it, then set the enviroment variable, followed the official install guide.
image

What did you expect to see?

Everything works well.

What did you see instead?

go version command works, but I got an error after typed go env:
image

runtime: epollwait on fd 4 failed with 38
fatal error: runtime: netpoll failed

runtime stack:
runtime.throw(0x8b4137, 0x17)
        /usr/local/go/src/runtime/panic.go:616 +0x81
runtime.netpoll(0x9e71e90f00, 0x7fec00000000)
        /usr/local/go/src/runtime/netpoll_epoll.go:75 +0x216
runtime.sysmon()
        /usr/local/go/src/runtime/proc.go:4265 +0x424
runtime.mstart1(0x0)
        /usr/local/go/src/runtime/proc.go:1227 +0xe7
runtime.mstart()
        /usr/local/go/src/runtime/proc.go:1193 +0x76

goroutine 1 [runnable]:
os.newFile(0x5, 0x8a9f6f, 0x2, 0x2, 0x0)
        /usr/local/go/src/os/file_unix.go:94 +0x1d1
os.Pipe(0x9, 0x8, 0x8, 0xc4201e20b8)
        /usr/local/go/src/os/pipe_linux.go:32 +0xb7
os/exec.(*Cmd).writerDescriptor(0xc4202106e0, 0x910960, 0xc420224150, 0x7fecd8647bc0, 0xc4201e20b8, 0x7fecd86a0d90)
        /usr/local/go/src/os/exec/exec.go:267 +0x63
os/exec.(*Cmd).stdout(0xc4202106e0, 0x0, 0x0, 0x0)
        /usr/local/go/src/os/exec/exec.go:243 +0x3d
os/exec.(*Cmd).Start(0xc4202106e0, 0x1, 0xc420224150)
        /usr/local/go/src/os/exec/exec.go:368 +0x10c
os/exec.(*Cmd).Run(0xc4202106e0, 0xc420224150, 0xc4201bb450)
        /usr/local/go/src/os/exec/exec.go:302 +0x2b
os/exec.(*Cmd).CombinedOutput(0xc4202106e0, 0x1, 0x1, 0xc420217340, 0x1c, 0x1c)
        /usr/local/go/src/os/exec/exec.go:521 +0x106
cmd/go/internal/work.(*Builder).gccSupportsFlag(0xc420222000, 0xc4201da140, 0x1, 0x1, 0x8b444c, 0x18, 0x0)
        /usr/local/go/src/cmd/go/internal/work/exec.go:1889 +0x53c
cmd/go/internal/work.(*Builder).compilerCmd(0xc420222000, 0xc4201da140, 0x1, 0x1, 0x8a9d5d, 0x1, 0x0, 0x0, 0xc4201e0240, 0xc4201e01e0, ...)
        /usr/local/go/src/cmd/go/internal/work/exec.go:1833 +0x712
cmd/go/internal/work.(*Builder).GccCmd(0xc420222000, 0x8a9d5d, 0x1, 0x0, 0x0, 0xc4201e01e0, 0x2, 0x2)
        /usr/local/go/src/cmd/go/internal/work/exec.go:1742 +0x6b
cmd/go/internal/envcmd.ExtraEnvVars(0xc42006e260, 0x406f4e, 0x401650)
        /usr/local/go/src/cmd/go/internal/envcmd/env.go:122 +0x255
cmd/go/internal/envcmd.runEnv(0xafec80, 0xc42000c090, 0x0, 0x0)
        /usr/local/go/src/cmd/go/internal/envcmd/env.go:158 +0x8fa
main.main()
        /usr/local/go/src/cmd/go/main.go:140 +0x7e1

goroutine 5 [syscall]:
os/signal.signal_recv(0x0)
        /usr/local/go/src/runtime/sigqueue.go:139 +0xa6
os/signal.loop()
        /usr/local/go/src/os/signal/signal_unix.go:22 +0x22
created by os/signal.init.0
        /usr/local/go/src/os/signal/signal_unix.go:28 +0x41
@slrz

This comment has been minimized.

Copy link

commented May 14, 2018

Errno 38 is ENOSYS on Linux. This might just be hitting a not-yet-implemented-in-WSL part of the Linux system call interface. In that case, it's not a Go bug.

The WSL developers might appreciate a report if you can't find an already existing one (AIUI, WSL aims for Linux binary compatibility).

@bcmills

This comment has been minimized.

Copy link
Member

commented May 23, 2018

hashicorp/vault#4339 seems to be the same symptom.

@bcmills bcmills changed the title Install go1.10.2 failed on WSL (Bash on Windows) runtime: epollwait failed with ENOSYS on Windows Subsystem for Linux May 23, 2018

@bcmills

This comment has been minimized.

Copy link
Member

commented May 23, 2018

This may be related in some way to #22606 (fixed).

CC: @ianlancetaylor @aclements @dvyukov

@bcmills bcmills added this to the Go1.11 milestone May 23, 2018

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented May 24, 2018

This is almost certainly due to #23750, which changed the code from calling epoll_wait to calling epoll_pwait. I guess that WSL implements the former but not the latter. From our point of view the best fix would be for WSL to implement epoll_pwait, which has been available since Linux kernel version 2.6.19.

I will comment on the WSL issue.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented May 24, 2018

Closing this issue because historically we've just waited for Microsoft to fix kernel compatibility issues in WSL. If anybody wants to make a case for adding a fallback from epoll_pwait to epoll_wait I'm willing to listen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.