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

Exec start kills daemon with nil reference #20638

Closed
KostyaSha opened this issue Feb 24, 2016 · 5 comments · Fixed by #20647
Closed

Exec start kills daemon with nil reference #20638

KostyaSha opened this issue Feb 24, 2016 · 5 comments · Fixed by #20647
Labels
kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. priority/P1 Important: P1 issues are a top priority and a must-have for the next release.
Milestone

Comments

@KostyaSha
Copy link
Contributor

Full stacktrace: https://gist.github.com/KostyaSha/849a2f21e017b7099685
Piece of trace:

time="2016-02-23T23:24:49.983175708Z" level=debug msg="starting exec command 32872f2d97a44f6eb05f5051ba57ed4aebb6e44186dffd4e27165e97b6035d22 in container 9b8572202459e502251a08520102da2f17c2ec701279602b515a833b7468537c"
time="2016-02-23T23:24:49.985347690Z" level=debug msg="attach: stdin: begin"
time="2016-02-23T23:24:49.985669491Z" level=debug msg="Closing buffered stdin pipe"
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x20 pc=0x6b32e3]

docker-toolbox: 1.10.1-1.10.2
docker-version:

Client:
 Version:      1.10.2
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   c3959b1
 Built:        Mon Feb 22 22:37:33 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.10.2
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   c3959b1
 Built:        Mon Feb 22 22:37:33 2016
 OS/Arch:      linux/amd64

Localised example. Steps to reproduce:

  1. docker run -itd busybox cat
curl --cert cert.pem --key key.pem --cacert ca.pem \
 https://192.168.99.100:2376/containers/${CONTAINER_ID}/exec \
 -H "Content-Type: application/json" \
 -X POST \
 --data @exec.json

exec.json:

{
    "AttachStderr": true,
    "AttachStdin": true,
    "AttachStdout": true,
    "Cmd": [
        "/bin/bash",
        "-cxe",
        "cat << EOF > /tmp/config.sh.tmp && cd /tmp && mv config.sh.tmp config.sh\n sdf\nEOF\n"
    ]
}
curl --cert cert.pem --key key.pem --cacert ca.pem \
 https://192.168.99.100:2376/exec/${EXEC_ID}/start \
 -H "Content-Type: application/json" \
 -X POST \
 --data @start.json

start.json:

{
    "Detach": true,
    "Tty": true
}

Combination may be crazy, but i expect that daemon should survive.

@coolljt0725 coolljt0725 added the kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. label Feb 24, 2016
@coolljt0725
Copy link
Contributor

thanks for your report @KostyaSha
confirm it's a bug

@KostyaSha
Copy link
Contributor Author

@coolljt0725 thanks, i think somebody should better wrote IT test in go, right?

@coolljt0725
Copy link
Contributor

@karkhaz I'm working on the fix and will add a test :)

@KostyaSha
Copy link
Contributor Author

@coolljt0725 cool! Thanks. Btw, what would be the right combination for executing command without reading it's response?

@KostyaSha
Copy link
Contributor Author

Ok, found. I shouldn't attachStdin :)

coolljt0725 added a commit to coolljt0725/docker that referenced this issue Feb 25, 2016
@thaJeztah thaJeztah added this to the 1.10.3 milestone Mar 4, 2016
@thaJeztah thaJeztah added the priority/P1 Important: P1 issues are a top priority and a must-have for the next release. label Mar 4, 2016
tiborvass pushed a commit to tiborvass/docker that referenced this issue Mar 7, 2016
…by#20638

Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit fb0ac1a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. priority/P1 Important: P1 issues are a top priority and a must-have for the next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants