Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
os: FreeBSD system crashes when adding regular files to kqueue #19093
While testing https://golang.org/cl/36800, it appears that the FreeBSD amd64 system crashes when adding regular disk files to kqueue. This is based on testing using gomote, which creates a VM running FreeBSD 10.1 (I think). I am going to disable using kqueue on FreeBSD for regular files; it will still be used for sockets as usual. I am opening this issue to note the problem in the hopes that it can be fixed by someone more familiar with FreeBSD.
pushed a commit
Feb 15, 2017
Sorry for not noticing your earlier message.
I do not have a stack trace of the system. I am accessing the system using https://godoc.org/golang.org/x/build/cmd/gomote, which runs FreeBSD in a VM, and I am deducing that the system has crashed because it stops responding for a while, and when it does start responding the system uptime has been reset to a very small number. I assume that what is happening is that the VM is being discarded and restarted. Perhaps @bradfitz can say something more about that.
This is how I reproduce it (I just verified that it still fails like this for me). First, remove these lines from src/os/file_unix.go:
When I try this it gets to the point where it prints
which is the point where it starts running cmd/go built with the new polling code. At that point the run stops and gomote prints
Further attempts to use
Then after a while the gomote usually recovers, but running
With luck you can create the problem on a real FreeBSD system, or on a VM which you fully control, by simply editing src/os/file_unix.go as suggested and then running
It's FreeBSD 11.0.
I can reproduce it on 11.0-RELEASE. This turns out to be a duplicate of FreeBSD PR 24923, even though the stack traces look different. Here's the stacktrace:
This bug was fixed in head by r310302 and later MFCed to stable/11 by r310578, but no update was ever issued for FreeBSD 11.0. I checked with secteam, and they don't plan to issue an update. So you should continue to use your current workaround until 11.1 is released, which will happen sometime in June.
referenced this issue
May 10, 2017
Btw, the x/build/cmd/debugnewvm does the serial console thing, btw, but gomote doesn't yet. But sounds like it's not needed now, since the bug has been fixed.
@ianlancetaylor, do you want to conditionally enable this behavior based on FreeBSD version?
In the meantime I can update our builder image from 11.0 to 11.1. We still have our 9.3 builders running too, which would test the fallback path if you make it $FREE_VERSION >= 11.1.