-
Notifications
You must be signed in to change notification settings - Fork 18k
os/exec: fd leak on NetBSD #3955
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
Labels
FrozenDueToAge
OS-NetBSD
Suggested
Issues that may be good for new contributors looking for work to do.
Milestone
Comments
Comment 11 by justin@specialbusservice.com: re "What do you mean by "cloned" file descriptor?" - I think the NetBSD implementation must be using the clone(2) syscall, which is there for compatibility with Linux, rather than fork(2), and that results in issues with cloexec. I will look into this. |
There is a kernel function that clones file descriptors (search for fd_clone): http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/kern_descrip.c?rev=1.224 This particular function sets the file type to DTYPE_MISC, which is the same as the type that is being leaked. There are a handful of places where this function is used in the NetBSD kernel - one of which is the rndopen() function (in sys/dev/rndpseudo.c), which is used when the /dev/urandom device is opened. I (or someone else) still needs to dig further, however this cloned descriptor either does not have FD_CLOEXEC set and/or we are not setting it, which results in the file descriptor leak when Go does a fork/exec. |
Fixed by requiring NetBSD 8+ for Go 1.10. Documentation bug is #22911 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FrozenDueToAge
OS-NetBSD
Suggested
Issues that may be good for new contributors looking for work to do.
The text was updated successfully, but these errors were encountered: