-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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 on fd 1 failed with 22 #68333
Comments
It looks like when the kernel module runs the Go program, it runs it with (at least) file descriptor 1 not set to standard output. One effect is that the netpoll code uses descriptor 1 for the epoll descriptor. The program then uses There is no nothing we can change in Go to fix this, so closing this issue. |
Thank you for investigating. Does that mean it is not possible from within go to set the file descriptors 0-2 before the go runtime uses them? Wouldn't that mean that even when I don't change what FD 1 refers to (via I guess in that case a workaround would be to write a wrapper program that sets those FDs before executing the application written in go. |
And what would be the best way to check for this situation? I could check if |
The Go os package on Unix systems does expect that it will be started with file descriptors 0, 1, and 2 set as they normally are. There is no support for programs that use the os package to run without those descriptors being set. I don't know of a fully reliable way to detect the situation. It may work to |
Go version
go version go1.22.5 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I want to call a userspace program written in go from an LKM. I do this via
call_usermodehelper
. However the go program crashes.You can reproduce it via this simple repository: https://github.com/powellnorma/go-crash
Any workarounds? Thank you.
What did you see happen?
What did you expect to see?
No crash.
The text was updated successfully, but these errors were encountered: