Skip to content

Check for nullptr before dereferencing#7708

Merged
dmcgowan merged 1 commit intocontainerd:mainfrom
kiashok:CheckForNullptrs
Nov 29, 2022
Merged

Check for nullptr before dereferencing#7708
dmcgowan merged 1 commit intocontainerd:mainfrom
kiashok:CheckForNullptrs

Conversation

@kiashok
Copy link
Copy Markdown
Contributor

@kiashok kiashok commented Nov 21, 2022

This PR adds nullptr checks before dereferencing pointers in pkg/cri/server/helpers.go copyResourcesToStatus() function. The function was introduced as part of this PR.
While running some hcsshim tests, containerd crashed with a panic due to nullptr dereference and this PR attempts to fix that.

@k8s-ci-robot
Copy link
Copy Markdown

Hi @kiashok. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@AkihiroSuda
Copy link
Copy Markdown
Member

Thanks, but please sign the commit for DCO
https://github.com/apps/dco

(run git commit -a -s --amend, and make sure that the Signed-off-by: NAME <EMAIL> line with your real name is included in the commit message)

@mxpv
Copy link
Copy Markdown
Member

mxpv commented Nov 22, 2022

Could you pls add the same fix for sbserver ?

@kevpar
Copy link
Copy Markdown
Member

kevpar commented Nov 23, 2022

Can we add a test case to cover this as well?

This will also need backport to 1.6 branch, right? Is the same problem present in 1.5 branch?

@kevpar
Copy link
Copy Markdown
Member

kevpar commented Nov 23, 2022

/ok-to-test

@kiashok
Copy link
Copy Markdown
Contributor Author

kiashok commented Nov 28, 2022

Can we add a test case to cover this as well?

This will also need backport to 1.6 branch, right? Is the same problem present in 1.5 branch?

Added the test. Yes this needs to be backported to 1.6. 1.5 branch does not have these changes so we could skip backporting there

Comment thread integration/sandbox_clean_remove_windows_test.go Outdated
Comment thread integration/sandbox_clean_remove_windows_test.go Outdated
Comment thread integration/sandbox_clean_remove_windows_test.go Outdated
Comment thread integration/sandbox_clean_remove_windows_test.go Outdated
Comment thread integration/sandbox_clean_remove_windows_test.go Outdated
Comment thread integration/sandbox_clean_remove_windows_test.go Outdated
Comment thread integration/sandbox_clean_remove_windows_test.go Outdated
Comment thread integration/sandbox_clean_remove_windows_test.go
Comment thread integration/sandbox_clean_remove_windows_test.go Outdated
Comment thread integration/sandbox_clean_remove_windows_test.go Outdated
Comment thread integration/sandbox_clean_remove_windows_test.go
Comment thread integration/sandbox_clean_remove_windows_test.go Outdated
Comment thread integration/main_test.go Outdated
@kiashok
Copy link
Copy Markdown
Contributor Author

kiashok commented Nov 29, 2022

The linux integration test that is failing seems to be flaky and and is not related to any changes made in this PR. The changes in this PR is mostly on the windows side and I also see another PR that is failing at the same location (at log_hook.go at line 40) - https://github.com/containerd/containerd/actions/runs/3526988813/jobs/5915601489 .

@dmcgowan dmcgowan merged commit 18cb7f2 into containerd:main Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants