Description of problem:
When I send signal 27 to the docker process, which is running with --sig-proxy=true, it's not forwarded. Other signals are...
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. /usr/bin/docker -D run --tty=false --rm -i --name test_eoly localhost:5000/ldoktor/fedora:latest bash -c 'for NUM in `seq 1 64`; do trap "echo Received $NUM, ignoring..." $NUM; done; while :; do sleep 1; done'
2. ps ax |grep docker
3. kill -27 $PID
Received 27, ignoring...
When you send any other signal (apart from 19 or 9) it works fine.
The signal 17 is also ignored.
The same bug is in upstream Docker version 0.10.0, build dc9c28f/0.10.0
We are keeping all of the versions of docker insync, please only report these bugs once.
With upstream Docker, signal 27 works. Signal 17, however, is still broken.
After further testing, I've determined that all signals are sent correctly except 17 and 19. I'm looking into a fix for this.
Signal 17, SIGCHILD, is deliberately not forwarded - upstream commit https://github.com/dotcloud/docker/commit/440422a96346072a0a9016c4db78ff7599a702aa.
Signal 19 might actually be a Golang bug - I've constructed a small test program in Go which also fails to catch this. Looking into this further.
I think we should just document, ignoring sigchld makes sense.
We should document in the man page that signal 17 should be ignored, and signal 19 is a bug in golang.
Just fix the man page.
PR out: https://github.com/dotcloud/docker/pull/6544
It appears that Signal 19 is actually forwarded, also. SIGSTOP cannot be caught, so it was actually preventing my script from printing out that it was received. So it's only Signal 17 that's not forwarded.
After further testing, I've managed to reproduce being unable to send signals 19, 18, and 27 to the container via --sig-proxy.
This seems to be a Golang issue. I implemented a trivial signal-catching test program in Go and tested it with signals 1-31, and obtained identical results to Docker aside from Signal 17 (discarded on Docker, caught by my test program).
A brief summary of signals Docker does not play well with:
- Signal 17, SIGCHLD, deliberately caught and discarded. Makes no sense to pass this into a container.
- Signal 18, SIGCONT, seems to be Golang issue
- Signal 19, SIGSTOP, unmaskable signal - cannot be caught
- Signal 27, SIGPROF, seems to be Golang issue
Worth noting that the "docker kill" command should be able to send any of these without issue. If we have any general docs for Docker, we may want to recommend avoiding proxying signals in favor of docker kill whenever possible.
Appears to be an issue with Golang proper (https://code.google.com/p/go/issues/detail?id=4391&q=signal&colspec=ID%20Status%20Stars%20Release%20Owner%20Repo%20Summary)
Unknown when a fix will be released - there hasn't been any movement on the bug since February.
Bug is in golang, have to wait until golang is fixed handling of signals.