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

nil pointer exception when accessing UserLevelNetworking

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Minor Minor
    • None
    • 4.12.z
    • Node Tuning Operator
    • None
    • No
    • False
    • Hide

      None

      Show
      None

      We run into a nil pointer exception because we are not checking if the field is nil or not ...

      panic: runtime error: invalid memory address or nil pointer dereference
      [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x15a68cc]
      
      goroutine 1169 [running]:
      github.com/openshift/cluster-node-tuning-operator/pkg/performanceprofile/controller/performanceprofile/components/tuned.NewNodePerformance(0xc001600000)
      	/go/src/github.com/openshift/cluster-node-tuning-operator/pkg/performanceprofile/controller/performanceprofile/components/tuned/tuned.go:119 +0x3ec
      github.com/openshift/cluster-node-tuning-operator/pkg/performanceprofile/controller/performanceprofile/components/manifestset.GetNewComponents(0xc001600000, 0xc001d38600?)
      	/go/src/github.com/openshift/cluster-node-tuning-operator/pkg/performanceprofile/controller/performanceprofile/components/manifestset/manifestset.go:65 +0x85
      github.com/openshift/cluster-node-tuning-operator/pkg/performanceprofile/controller.(*PerformanceProfileReconciler).applyComponents(0xc00098fc20, 0xc001600000, 0xc001d38510?)
      	/go/src/github.com/openshift/cluster-node-tuning-operator/pkg/performanceprofile/controller/performanceprofile_controller.go:389 +0xd3
      github.com/openshift/cluster-node-tuning-operator/pkg/performanceprofile/controller.(*PerformanceProfileReconciler).Reconcile(0xc00098fc20, {0x1e8b1b8, 0xc001d38510}, {{{0x0?, 0x1ad5a00?}, {0xc000d0d456?, 0x30?}}})
      	/go/src/github.com/openshift/cluster-node-tuning-operator/pkg/performanceprofile/controller/performanceprofile_controller.go:312 +0x87c
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0xc0007902c0, {0x1e8b1b8, 0xc001d384e0}, {{{0x0?, 0x1ad5a00?}, {0xc000d0d456?, 0x408b34?}}})
      	/go/src/github.com/openshift/cluster-node-tuning-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:114 +0x28b
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0007902c0, {0x1e8b110, 0xc000d119c0}, {0x19d6960?, 0xc0005b0000?})
      	/go/src/github.com/openshift/cluster-node-tuning-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:311 +0x352
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0007902c0, {0x1e8b110, 0xc000d119c0})
      	/go/src/github.com/openshift/cluster-node-tuning-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:266 +0x1d9
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
      	/go/src/github.com/openshift/cluster-node-tuning-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:227 +0x85
      created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2
      	/go/src/github.com/openshift/cluster-node-tuning-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:223 +0x31c
      

      Code:

       if profile.Spec.Net != nil && *profile.Spec.Net.UserLevelNetworking && profile.Spec.CPU.Reserved != nil {
      

      To reproduce, create a PerformanceProfile with .spec.net set, but with .spec.net.userLevelNetworking not set:

        net:
          devices:
          - interfaceName: ens2*
          - interfaceName: ens5*
      

              akaris@redhat.com Andreas Karis
              akaris@redhat.com Andreas Karis
              Mallapadi Niranjan Mallapadi Niranjan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: