Bug 1087720 - signal 27 (SIGPROF) not passed to container using --sig-proxy
Summary: signal 27 (SIGPROF) not passed to container using --sig-proxy
Alias: None
Product: Fedora
Classification: Fedora
Component: docker-io
Version: 20
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Matthew Heon
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: 1096276
TreeView+ depends on / blocked
Reported: 2014-04-15 07:24 UTC by Lukáš Doktor
Modified: 2015-04-15 12:16 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1096276 (view as bug list)
Last Closed: 2015-04-15 12:16:44 UTC
Type: Bug

Attachments (Terms of Use)

Description Lukáš Doktor 2014-04-15 07:24:20 UTC
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):

How reproducible:

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

Actual results:

Expected results:
Received 27, ignoring...

Additional info:
When you send any other signal (apart from 19 or 9) it works fine.

Comment 1 Lukáš Doktor 2014-04-15 08:59:24 UTC
The signal 17 is also ignored.

Comment 2 Lukáš Doktor 2014-05-05 07:48:25 UTC
The same bug is in upstream Docker version 0.10.0, build dc9c28f/0.10.0

Comment 3 Daniel Walsh 2014-05-19 20:35:25 UTC
We are keeping all of the versions of docker insync, please only report these bugs once.

Comment 4 Matthew Heon 2014-06-17 20:27:06 UTC
With upstream Docker, signal 27 works. Signal 17, however, is still broken.

Comment 5 Matthew Heon 2014-06-18 13:09:59 UTC
After further testing, I've determined that all signals are sent correctly except 17 and 19. I'm looking into a fix for this.

Comment 6 Matthew Heon 2014-06-18 19:23:08 UTC
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.

Comment 7 Daniel Walsh 2014-06-18 20:23:22 UTC
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.

Comment 8 Matthew Heon 2014-06-19 14:45:29 UTC
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.

Comment 10 Matthew Heon 2014-06-30 16:59:29 UTC
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.

Comment 11 Matthew Heon 2014-07-23 14:09:48 UTC
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.

Comment 13 Daniel Walsh 2015-04-15 12:16:44 UTC
Bug is in golang, have to wait until golang is fixed handling of signals.

Note You need to log in before you can comment on or make changes to this bug.