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

fixing SIGSEGV when running containers #303

Merged
merged 1 commit into from
Jul 6, 2017

Conversation

yastij
Copy link
Contributor

@yastij yastij commented Jul 6, 2017

Signed-off-by: Yassine TIJANI yasstij11@gmail.com

- How I did it checking that close is not before deferring it.

fixes moby/moby#33975

@codecov-io
Copy link

codecov-io commented Jul 6, 2017

Codecov Report

Merging #303 into master will not change coverage.
The diff coverage is 0%.

@@           Coverage Diff           @@
##           master     #303   +/-   ##
=======================================
  Coverage   48.68%   48.68%           
=======================================
  Files         185      185           
  Lines       12168    12168           
=======================================
  Hits         5924     5924           
  Misses       5877     5877           
  Partials      367      367

Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!


if close != nil {
defer close()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the more common way of doing this is to just move the defer close() after the if err != nil. This is only nil if there is an error, so handling the error first will fix the problem.

Copy link
Contributor Author

@yastij yastij Jul 6, 2017

Choose a reason for hiding this comment

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

@dnephin - indeed you are right. i thought that we might have no error and still have nil close.

Thanks for the hint.

@yastij
Copy link
Contributor Author

yastij commented Jul 6, 2017

@dnephin - LGTY ?

Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Please also squash to a single git commit.

Signed-off-by: Yassine TIJANI <yasstij11@gmail.com>

moving the deffering of the close after the error checking

Signed-off-by: Yassine TIJANI <yasstij11@gmail.com>

fixing SIGSEGV when running containers

Signed-off-by: Yassine TIJANI <yasstij11@gmail.com>
@yastij
Copy link
Contributor Author

yastij commented Jul 6, 2017

@dnephin - Done.

@aaronlehmann
Copy link
Contributor

LGTM

@aaronlehmann aaronlehmann merged commit dfdbdab into docker:master Jul 6, 2017
@GordonTheTurtle GordonTheTurtle added this to the 17.07.0 milestone Jul 6, 2017
@yastij yastij deleted the fix-SIGSEGV-runContainer branch July 20, 2017 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running any container causes [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x457888]
5 participants