You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is in the child right after the fork succeeded.
I haven't figured out why this occurs yet. fd closed, fd never valid in the first place, ... The fd and index in "fdsToClose" changes, so it's not just the first fd (and maybe all of them), nor it is always the same fd. I do not yet know if the fds are open and valid prior to forking.
OS and Go versions
OS: plan9 (up-to-date 9front amd64)
Go: head of master
Go bootstrap: 1.4.3
Steps to reproduce
Install a version of Go for bootstrapping (pre master)
Fetch master
GOROOT_BOOTSTRAP=/the/other/go ./make.rc
Expected result
Go build completes and gives me a freshly baked toolchain.
Actual result
Build crashes the vast majority of the time. Completing a build takes many attempts with --no-clean.
The text was updated successfully, but these errors were encountered:
Plan9 appears to have a close-on-exec flag (OCEXEC), making the fdsToClose construct unecessary it if can be set afterwards.
EDIT: I can't seem to find a way to set it after open, and in APE, it just marks all the fd's internally and manually close them before exec'ing.
This bug only appears on multiprocessor machines. This is a long-standing issue.
It seems there is a race condition that leads some file descriptors to be closed twice.
A simple workaround is to ignore the error returned by the close syscall.
This should be safe since we just want to be sure the fd was closed.
But, of course, it would be better to fix the race.
rsc
changed the title
syscall: forkAndExecInChild failing with "fd out or range or not open" on Plan9
syscall: don't check result of close(fd) in forkAndExecInChild on Plan9
Nov 24, 2015
On almost every build of Go I have made so far, "Building packages and commands" have failed with either:
or:
Completing a build tends to take quite a few tries.
I have traced the error to forkAndExecInChild (
go/src/syscall/exec_plan9.go
Line 219 in f9ed2f7
This is in the child right after the fork succeeded.
I haven't figured out why this occurs yet. fd closed, fd never valid in the first place, ... The fd and index in "fdsToClose" changes, so it's not just the first fd (and maybe all of them), nor it is always the same fd. I do not yet know if the fds are open and valid prior to forking.
OS and Go versions
OS: plan9 (up-to-date 9front amd64)
Go: head of master
Go bootstrap: 1.4.3
Steps to reproduce
Expected result
Go build completes and gives me a freshly baked toolchain.
Actual result
Build crashes the vast majority of the time. Completing a build takes many attempts with --no-clean.
The text was updated successfully, but these errors were encountered: