Skip to content
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

runtime: SIGCONT and SIGTSTP aren't handle-able #8953

Closed
gopherbot opened this issue Oct 17, 2014 · 2 comments
Closed

runtime: SIGCONT and SIGTSTP aren't handle-able #8953

gopherbot opened this issue Oct 17, 2014 · 2 comments
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@gopherbot
Copy link
Contributor

by burke@libbey.me:

signal.Notify accepts SIGCONT as a parameter, but SIGCONT is never actually delivered to
the channel. I was able to register SIGCONT handler with cgo, but couldn't find any way
from Go.

Tested on:

* go version go1.3.1 darwin/amd64
* go version go1.3.3 linux/amd64

With the following source, I would expect the program to terminate immediately; however,
it hangs indefinitely. You can change SIGCONT into nearly any other signal to verify.
SIGTSTP has the same issue.

package main

import (
    "os"
    "os/signal"
    "syscall"
)

func main() {
    ch := make(chan os.Signal)
    signal.Notify(ch, syscall.SIGCONT)
    syscall.Kill(0, syscall.SIGCONT)
    <-ch
}
@ianlancetaylor
Copy link
Contributor

Comment 1:

We don't set up a signal handler for SIGCONT or SIGTSTP (or SIGTTIN or SIGTTOU).  I
think it should be OK to always use a signal handler for SIGCONT, and just ignore it if
the signal arrives.  For SIGTSTP, SIGTTIN, and SIGTTOU we can only set up a signal
handler if the program explicitly requests notification for the signal, and we have to
remove the signal handler--return to the default signal action--if the program no longer
wants notification.  I think we now have the framework for this if anybody wants to work
on it.

Labels changed: added repo-main, release-none, suggested.

Status changed to Accepted.

@gopherbot gopherbot added accepted Suggested Issues that may be good for new contributors looking for work to do. labels Oct 17, 2014
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@gopherbot
Copy link
Contributor Author

CL https://golang.org/cl/18185 mentions this issue.

crosbymichael added a commit to crosbymichael/runc that referenced this issue May 20, 2016
With this change we need a fix in go 1.6 to allow us to receive SIGCONT
signals.

Ref: golang/go#8953

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
crosbymichael added a commit to crosbymichael/runc that referenced this issue May 23, 2016
With this change we need a fix in go 1.6 to allow us to receive SIGCONT
signals.

Ref: golang/go#8953

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
crosbymichael added a commit to crosbymichael/runc that referenced this issue May 27, 2016
With this change we need a fix in go 1.6 to allow us to receive SIGCONT
signals.

Ref: golang/go#8953

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
crosbymichael added a commit to crosbymichael/runc that referenced this issue May 27, 2016
With this change we need a fix in go 1.6 to allow us to receive SIGCONT
signals.

Ref: golang/go#8953

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
crosbymichael added a commit to crosbymichael/runc that referenced this issue May 31, 2016
With this change we need a fix in go 1.6 to allow us to receive SIGCONT
signals.

Ref: golang/go#8953

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
@golang golang locked and limited conversation to collaborators Jan 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

3 participants