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

kubelet: fix panic triggered when playing with a wip CRI #109042

Merged
merged 1 commit into from May 4, 2022

Conversation

bjorand
Copy link
Contributor

@bjorand bjorand commented Mar 25, 2022

I'm writing a custom container runtime and I encounter a kubelet panic:

I0325 22:39:20.613544    9913 kuberuntime_sandbox.go:296] "Pod Sandbox status doesn't have network information, cannot report IPs" pod="default/httpd-86d666c486-s58ls"
I0325 22:39:20.620552    9913 kubelet.go:2098] "SyncLoop (PLEG): event for pod" pod="default/httpd-86d666c486-s58ls" event=&{ID:7d04550d-2db8-4725-91d8-316f3fb95636 Type:ContainerStarted Data:7d04550d-2db8-4725-91d8-316f3fb95636}
E0325 22:39:20.622081    9913 runtime.go:79] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
goroutine 344 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic({0x438b5a0, 0x77750e0})
  /home/meister/go/src/github.com/kubernetes/kubernetes/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:75 +0xb4
k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0x0})
  /home/meister/go/src/github.com/kubernetes/kubernetes/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:49 +0x8c
panic({0x438b5a0, 0x77750e0})
  /usr/local/go/src/runtime/panic.go:1038 +0x25b
k8s.io/kubernetes/pkg/kubelet/kuberuntime.(*kubeGenericRuntimeManager).podSandboxChanged(0xc0008c29a0, 0xc000eb7000, 0xc000ed4980)
  /home/meister/go/src/github.com/kubernetes/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_manager.go:500 +0x2b5
k8s.io/kubernetes/pkg/kubelet/kuberuntime.(*kubeGenericRuntimeManager).computePodActions(0xc0008c29a0, 0xc000eb7000, 0xc000ed4980)
  /home/meister/go/src/github.com/kubernetes/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_manager.go:529 +0x225
k8s.io/kubernetes/pkg/kubelet/kuberuntime.(*kubeGenericRuntimeManager).SyncPod(0xc0008c29a0, 0xc000eb7000, 0xc000ed4980, {0x77e7ed8, 0x0, 0x0}, 0xc00009da40)
  /home/meister/go/src/github.com/kubernetes/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_manager.go:714 +0x89
k8s.io/kubernetes/pkg/kubelet.(*Kubelet).syncPod(0xc000a68000, {0x53b6a50, 0xc000e73880}, 0x0, 0xc000eb7000, 0x0, 0xc000ed4980)
  /home/meister/go/src/github.com/kubernetes/kubernetes/pkg/kubelet/kubelet.go:1718 +0x23c4
k8s.io/kubernetes/pkg/kubelet.(*podWorkers).managePodLoop.func1(0xc000b3dee0, 0xc0004c3680, 0xc000eb7000, 0xc000b3dea8)
  /home/meister/go/src/github.com/kubernetes/kubernetes/pkg/kubelet/pod_workers.go:935 +0x333
k8s.io/kubernetes/pkg/kubelet.(*podWorkers).managePodLoop(0xc0004c3680, 0xc000e8e960)
  /home/meister/go/src/github.com/kubernetes/kubernetes/pkg/kubelet/pod_workers.go:940 +0x469
k8s.io/kubernetes/pkg/kubelet.(*podWorkers).UpdatePod.func1(0xc0004c3680, 0xc000e8e960)
  /home/meister/go/src/github.com/kubernetes/kubernetes/pkg/kubelet/pod_workers.go:736 +0x72
created by k8s.io/kubernetes/pkg/kubelet.(*podWorkers).UpdatePod
  /home/meister/go/src/github.com/kubernetes/kubernetes/pkg/kubelet/pod_workers.go:734 +0x2005
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
  panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x3b99615]

goroutine 344 [running]:
k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0x0})
  /home/meister/go/src/github.com/kubernetes/kubernetes/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:56 +0x109
panic({0x438b5a0, 0x77750e0})
  /usr/local/go/src/runtime/panic.go:1038 +0x25b
k8s.io/kubernetes/pkg/kubelet/kuberuntime.(*kubeGenericRuntimeManager).podSandboxChanged(0xc0008c29a0, 0xc000eb7000, 0xc000ed4980)
  /home/meister/go/src/github.com/kubernetes/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_manager.go:500 +0x2b5
k8s.io/kubernetes/pkg/kubelet/kuberuntime.(*kubeGenericRuntimeManager).computePodActions(0xc0008c29a0, 0xc000eb7000, 0xc000ed4980)
  /home/meister/go/src/github.com/kubernetes/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_manager.go:529 +0x225
k8s.io/kubernetes/pkg/kubelet/kuberuntime.(*kubeGenericRuntimeManager).SyncPod(0xc0008c29a0, 0xc000eb7000, 0xc000ed4980, {0x77e7ed8, 0x0, 0x0}, 0xc00009da40)
  /home/meister/go/src/github.com/kubernetes/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_manager.go:714 +0x89
k8s.io/kubernetes/pkg/kubelet.(*Kubelet).syncPod(0xc000a68000, {0x53b6a50, 0xc000e73880}, 0x0, 0xc000eb7000, 0x0, 0xc000ed4980)
  /home/meister/go/src/github.com/kubernetes/kubernetes/pkg/kubelet/kubelet.go:1718 +0x23c4
k8s.io/kubernetes/pkg/kubelet.(*podWorkers).managePodLoop.func1(0xc000b3dee0, 0xc0004c3680, 0xc000eb7000, 0xc000b3dea8)
  /home/meister/go/src/github.com/kubernetes/kubernetes/pkg/kubelet/pod_workers.go:935 +0x333
k8s.io/kubernetes/pkg/kubelet.(*podWorkers).managePodLoop(0xc0004c3680, 0xc000e8e960)
  /home/meister/go/src/github.com/kubernetes/kubernetes/pkg/kubelet/pod_workers.go:940 +0x469
k8s.io/kubernetes/pkg/kubelet.(*podWorkers).UpdatePod.func1(0xc0004c3680, 0xc000e8e960)
  /home/meister/go/src/github.com/kubernetes/kubernetes/pkg/kubelet/pod_workers.go:736 +0x72
created by k8s.io/kubernetes/pkg/kubelet.(*podWorkers).UpdatePod
  /home/meister/go/src/github.com/kubernetes/kubernetes/pkg/kubelet/pod_workers.go:734 +0x2005

/kind bug

NONE

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 25, 2022
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 25, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: bjorand / name: Benjamin Jorand (3c65728)

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 25, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @bjorand!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Mar 25, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @bjorand. Thanks for your PR.

I'm waiting for a kubernetes 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.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Mar 25, 2022
@k8s-ci-robot k8s-ci-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 25, 2022
@ehashman ehashman added this to Triage in SIG Node PR Triage Mar 29, 2022
Copy link
Member

@ehashman ehashman left a comment

Choose a reason for hiding this comment

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

/priority backlog
/triage accepted
/lgtm

@k8s-ci-robot k8s-ci-robot added priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 29, 2022
@ehashman
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 29, 2022
@ehashman ehashman moved this from Triage to Needs Approver in SIG Node PR Triage Mar 29, 2022
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 29, 2022
@bjorand
Copy link
Contributor Author

bjorand commented Mar 30, 2022

/retest

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bjorand, mrunalp

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 3, 2022
@k8s-ci-robot k8s-ci-robot merged commit 1b2de5c into kubernetes:master May 4, 2022
SIG Node PR Triage automation moved this from Needs Approver to Done May 4, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.25 milestone May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants