Description
What version of Go are you using (go version
)?
$ go version go version go1.14.2 darwin/amd64 $
Does this issue reproduce with the latest release?
Yes. Also with go version devel +be08e10b3b Fri May 1 21:57:29 2020 +0000 darwin/amd6
.
It does not reproduce with Go 1.13.10.
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env GO111MODULE="" GOARCH="amd64" GOBIN="/Users/craig/go/bin" GOCACHE="/Users/craig/Library/Caches/go-build" GOENV="/Users/craig/Library/Application Support/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/craig/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/craig/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/Users/craig/github/golang/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/Users/craig/github/golang/go/pkg/tool/darwin_amd64" GCCGO="gccgo" GOAMD64="alignedjumps" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/m_/0sxkm11s5wd625ypnp0g0ffm0000gn/T/go-build624939018=/tmp/go-build -gno-record-gcc-switches -fno-common" $
Note that, in a different shell, GOROOT=/usr/local/go
, corresponding to Go 1.14.2, where the same problem occurs (though, anecdotally, less frequently) compared to the recent commit, identified above, on master
.
What did you do?
Built a simple Go program, ran it repeatedly via:
$ while true; do ./hangme 100; date; done
What did you expect to see?
Repeated runs ad infinitum, no hang.
What did you see instead?
Occasionally (intermittently), the program hangs. SIGQUIT
stack dump shows it usually hangs in the Command.Start()
receiver in os/exec
, which is not supposed to hang at all. (I've seen somewhat-different stack traces across different programs and built with different versions of Golang, but they all hang at that call or soon after.)
Such hangs have been observed (by me) only in programs that import plugin
(even though they don't use it at all; only its initialization code should run). Comment-out the _ "plugin"
import line in the above program, rebuild (via go build
), and rerun the ever-looping command, and it runs until manually stopped.