Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-17151

Observed a panic: "invalid memory address or nil pointer dereference"

XMLWordPrintable

    • No
    • SDN Sprint 241
    • 1
    • Approved
    • False
    • Hide

      None

      Show
      None

      In Hypershift CI, we see nil deref panic

      I0801 06:35:38.203019       1 controller.go:182] Assigning key: ip-10-0-132-175.ec2.internal to node workqueue
      E0801 06:35:38.567021       1 runtime.go:79] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
      goroutine 195 [running]:
      k8s.io/apimachinery/pkg/util/runtime.logPanic({0x28103a0?, 0x47a6400})
      	/go/src/github.com/openshift/cloud-network-config-controller/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:75 +0x99
      k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0xc00088f260?})
      	/go/src/github.com/openshift/cloud-network-config-controller/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:49 +0x75
      panic({0x28103a0, 0x47a6400})
      	/usr/lib/golang/src/runtime/panic.go:884 +0x213
      github.com/openshift/cloud-network-config-controller/pkg/cloudprovider.(*AWS).getSubnet(0xc000c05220, 0xc000d760b0)
      	/go/src/github.com/openshift/cloud-network-config-controller/pkg/cloudprovider/aws.go:266 +0x24a
      github.com/openshift/cloud-network-config-controller/pkg/cloudprovider.(*AWS).GetNodeEgressIPConfiguration(0x0?, 0x31b8490?, {0x0, 0x0, 0x0})
      	/go/src/github.com/openshift/cloud-network-config-controller/pkg/cloudprovider/aws.go:200 +0x185
      github.com/openshift/cloud-network-config-controller/pkg/controller/node.(*NodeController).SyncHandler(0xc000d526e0, {0xc00005d7e0, 0x1c})
      	/go/src/github.com/openshift/cloud-network-config-controller/pkg/controller/node/node_controller.go:129 +0x44f
      github.com/openshift/cloud-network-config-controller/pkg/controller.(*CloudNetworkConfigController).processNextWorkItem.func1(0xc00071f740, {0x25ff720?, 0xc00088f260?})
      	/go/src/github.com/openshift/cloud-network-config-controller/pkg/controller/controller.go:152 +0x11c
      github.com/openshift/cloud-network-config-controller/pkg/controller.(*CloudNetworkConfigController).processNextWorkItem(0xc00071f740)
      	/go/src/github.com/openshift/cloud-network-config-controller/pkg/controller/controller.go:162 +0x46
      github.com/openshift/cloud-network-config-controller/pkg/controller.(*CloudNetworkConfigController).runWorker(...)
      	/go/src/github.com/openshift/cloud-network-config-controller/pkg/controller/controller.go:113
      k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0x30?)
      	/go/src/github.com/openshift/cloud-network-config-controller/vendor/k8s.io/apimachinery/pkg/util/wait/backoff.go:226 +0x3e
      k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0x0?, {0x318e140, 0xc0005aa1e0}, 0x1, 0xc0000c4ba0)
      	/go/src/github.com/openshift/cloud-network-config-controller/vendor/k8s.io/apimachinery/pkg/util/wait/backoff.go:227 +0xb6
      k8s.io/apimachinery/pkg/util/wait.JitterUntil(0x0?, 0x3b9aca00, 0x0, 0x0?, 0x0?)
      	/go/src/github.com/openshift/cloud-network-config-controller/vendor/k8s.io/apimachinery/pkg/util/wait/backoff.go:204 +0x89
      k8s.io/apimachinery/pkg/util/wait.Until(0x0?, 0x0?, 0x0?)
      	/go/src/github.com/openshift/cloud-network-config-controller/vendor/k8s.io/apimachinery/pkg/util/wait/backoff.go:161 +0x25
      created by github.com/openshift/cloud-network-config-controller/pkg/controller.(*CloudNetworkConfigController).Run
      	/go/src/github.com/openshift/cloud-network-config-controller/pkg/controller/controller.go:99 +0x3aa
      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=0x0 pc=0x236d14a]
      

      https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/logs/periodic-ci-openshift-hypershift-release-4.14-periodics-e2e-aws-ovn/1686255525022404608/artifacts/e2e-aws-ovn/run-e2e/artifacts/TestNodePool_PreTeardownClusterDump/namespaces/e2e-clusters-m222b-example-85hhk/core/pods/logs/cloud-network-config-controller-6984cd6dcb-l7pcx-controller-previous.log

      https://github.com/openshift/cloud-network-config-controller/blob/master/pkg/cloudprovider/aws.go#L266

      Code does an unprotected deref of `networkInterface.SubnetId` which appears to be `nil`, which is probably why multiple subnets are returned in the first place.

              ffernand@redhat.com Flavio Fernandes (Inactive)
              sjenning Seth Jennings
              Anurag Saxena Anurag Saxena
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: