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
Kernel crash when closing device beginning in Go 1.9 #43906
Comments
If the kernel is crashing, this sounds like a bug in the kernel, not a bug in Go, and it sounds like something that should be fixed in the kernel, not something that should be fixed in Go. If you want to find the difference between Go 1.8 and Go 1.9, try running the program under |
I agree @ianlancetaylor - the issue should be that Go 1.9 exposed this kernel bug. But I still would like to understand the change that broke. The OpenFile results in a I'm wondering if its possible to turn off epoll for this character device. strace's are below, but it just confirms that 1.9 is dropping into the O_NONBLOCK/epoll code as suspect. |
Use I'm going to close this issue because I don't think there is anything for us to do in Go. |
Thanks @ianlancetaylor - appreciate the help. I confirmed the suggested workaround works. I will pursue root cause with the kernel contributors. I wonder if this behavior might be more baked in to os.OpenFile(), particularly for use cases like mine where you are interfacing with a device driver in simple request/response fashion. Something like an O_ flag the opposite of O_NONBLOCK so |
These are highly unusual cases, and they normally indicate kernel bugs. I don't see a reason to have two workarounds. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Open switchtec device to perform basic identify of the device - this is a Go port of the switchtec-user code from https://github.com/Microsemi/switchtec-user
The following code results in a kernel panic beginning in go1.9
go1.8.7 has no issues
What did you expect to see?
No kernel crash observed and a valid
Response: [0 0 0 0]
from the deviceWhat did you see instead?
Beginning in Go1.9 the above code crashes the kernel with the kdump info as show below
kdump
OutputThe text was updated successfully, but these errors were encountered: