Skip to content

Fix potential panic for task in unknown state.#3611

Merged
estesp merged 1 commit intocontainerd:masterfrom
Random-Liu:fix-panic-for-unknown-task
Sep 3, 2019
Merged

Fix potential panic for task in unknown state.#3611
estesp merged 1 commit intocontainerd:masterfrom
Random-Liu:fix-panic-for-unknown-task

Conversation

@Random-Liu
Copy link
Copy Markdown
Member

@Random-Liu Random-Liu commented Sep 2, 2019

We added unknown state support for task in 101d4b7. And task in unknown state will have empty fifos path.

However, we continue attach IO for task in unknown state https://github.com/containerd/containerd/blob/master/container.go#L386, which will potentially trigger a panic, because copyIO tries to access nil stdout.

This PR:

  1. Avoids attaching IO if task is in unknown state;
  2. Fix io attaching helper to tolerant empty stdout fifo path.

Signed-off-by: Lantao Liu [email protected]

@Random-Liu Random-Liu added this to the 1.3 milestone Sep 2, 2019
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Sep 2, 2019

Build succeeded.

@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #3611 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3611      +/-   ##
==========================================
+ Coverage   42.38%   42.38%   +<.01%     
==========================================
  Files         126      126              
  Lines       13900    13901       +1     
==========================================
+ Hits         5891     5892       +1     
  Misses       7123     7123              
  Partials      886      886
Flag Coverage Δ
#linux 45.91% <100%> (ø) ⬆️
#windows 37.2% <ø> (ø) ⬆️
Impacted Files Coverage Δ
cio/io_unix.go 74.41% <100%> (+0.3%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 95301fe...c410f0e. Read the comment docs.

@crosbymichael
Copy link
Copy Markdown
Member

LGTM

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@estesp estesp merged commit f7bd7e3 into containerd:master Sep 3, 2019
@Random-Liu Random-Liu deleted the fix-panic-for-unknown-task branch September 3, 2019 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants