We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version
$ go version go version go1.19.2 linux/amd64
yes
go env
$ go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/ubuntu/.cache/go-build" GOENV="/home/ubuntu/.config/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/ubuntu/.gvm/pkgsets/go1.19.2/global/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/ubuntu/.gvm/pkgsets/go1.19.2/global" GOPRIVATE="" GOPROXY="https://goproxy.woa.com,direct" GOROOT="/home/ubuntu/.gvm/gos/go1.19.2" GOSUMDB="sum.woa.com+643d7a06+Ac5f5VOC4N8NUXdmhbm8pZSXIWfhek5JSmWdWrq7pLX4" GOTMPDIR="" GOTOOLDIR="/home/ubuntu/.gvm/gos/go1.19.2/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.19.2" GCCGO="gccgo" GOAMD64="v1" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/dev/null" GOWORK="" 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 -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3184007767=/tmp/go-build -gno-record-gcc-switches"
golang-code: https://go.dev/play/p/YZ7rxFZihNv
main.sh:
#!/bin/bash sleep 10000
please chmod +x ./main.sh
It is expected that after one second, cmd.Run() exits and returns the error that the process is Killed.
cmd.Run() blocks forever and cannot return.
The text was updated successfully, but these errors were encountered:
os/exec: exit cmd.Run() when context becomes done
6280cc4
For golang#56187
Change https://go.dev/cl/442500 mentions this issue: os/exec: exit cmd.Run() when context becomes done
Sorry, something went wrong.
ddcac86
Fix golang#56187
Duplicate of #23019
#50436 proposes a solution to this that does not break backward compatibility.
Successfully merging a pull request may close this issue.
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?
golang-code: https://go.dev/play/p/YZ7rxFZihNv
main.sh:
#!/bin/bash sleep 10000
What did you expect to see?
It is expected that after one second, cmd.Run() exits and returns the error that the process is Killed.
What did you see instead?
cmd.Run() blocks forever and cannot return.
The text was updated successfully, but these errors were encountered: