-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
os/signal: sometimes SIGINT is not delivered #21905
Comments
As the os/signal package documents, you should always use a buffered channel with
|
I've updated the repository. With a buffered channel it's the same: sometimes the signal is lost. |
Does the problem occur without using cgo?
…On Sat, Sep 16, 2017 at 3:13 PM, opennota ***@***.***> wrote:
I've updated the repository. With a buffered channel it's the same:
sometimes the signal is lost.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#21905 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAcAz_kQs5FXKeLKAvWJFGOfKrxf673ks5si1jogaJpZM4PZtNb>
.
|
It occurs with cgo (not all cgo, though: a simpler function instead of |
Running the go env
fatal: morestack on g0
|
It's because your C code calls the standard library Closing because there is nothing we can do to fix this in Go. |
What version of Go are you using (
go version
)?1.9 linux/amd64
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/opennota/gocode"
GORACE=""
GOROOT="/home/opennota/go"
GOTOOLDIR="/home/opennota/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build828076735=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
What did you do?
The complete program (it uses CImg via cgo): https://github.com/opennota/sigint_issue
I build the program, run it and after some waiting press Ctrl+C to terminate it.
What did you expect to see?
SIGINT delivered, the program printed "interrupt" and exited.
What did you see instead?
Sometimes pressing Ctrl+C doesn't stop the program, and it continues to run indefinitely. No "interrupt" is printed.
The text was updated successfully, but these errors were encountered: