Skip to content

invalid memory address or nil pointer dereference #22

@lbudai74

Description

@lbudai74

Hello,

I'm testing your ice plugin and I run into a segmentation fault:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x163d3f6]

goroutine 1 [running]:
github.com/NimbleArchitect/kubectl-ice/pkg/plugin.(*security).securityBuildRow(_, {{{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {{{...}, ...}, ...}, ...}, ...}, ...)
	/home/runner/work/kubectl-ice/kubectl-ice/pkg/plugin/security.go:206 +0x836
github.com/NimbleArchitect/kubectl-ice/pkg/plugin.(*security).BuildContainerSpec(_, {{0xc000391cf8, 0x12}, {0xc000391d10, 0x11}, {0x0, 0x0, 0x0}, {0xc00023ca00, 0x2, ...}, ...}, ...)
	/home/runner/work/kubectl-ice/kubectl-ice/pkg/plugin/security.go:146 +0x105
github.com/NimbleArchitect/kubectl-ice/pkg/plugin.(*RowBuilder).podLoop(_, {_, _}, {{{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x0, ...}, ...}, ...}, ...)
	/home/runner/work/kubectl-ice/kubectl-ice/pkg/plugin/builder.go:696 +0x152e
github.com/NimbleArchitect/kubectl-ice/pkg/plugin.(*RowBuilder).BuildContainerTable(0xc0005f1ae8, {0x1cdcc20, 0xc0003941df}, 0xc0005ed468, {0xc000632000?, 0x1e, 0x2a})
	/home/runner/work/kubectl-ice/kubectl-ice/pkg/plugin/builder.go:410 +0x62b
github.com/NimbleArchitect/kubectl-ice/pkg/plugin.(*RowBuilder).Build(0xc0005f1ae8, {0x1cdcc20, 0xc0003941df})
	/home/runner/work/kubectl-ice/kubectl-ice/pkg/plugin/builder.go:202 +0x28a
github.com/NimbleArchitect/kubectl-ice/pkg/plugin.Security(0x0?, 0x0?, {0xc000341a00, 0x0, 0x2})
	/home/runner/work/kubectl-ice/kubectl-ice/pkg/plugin/security.go:81 +0x38f
github.com/NimbleArchitect/kubectl-ice/pkg/plugin.InitSubCommands.func12(0xc0003c4900?, {0xc000341a00?, 0x2?, 0x2?})
	/home/runner/work/kubectl-ice/kubectl-ice/pkg/plugin/plugin.go:324 +0x2e
github.com/spf13/cobra.(*Command).execute(0xc0003c4900, {0xc0003419e0, 0x2, 0x2})
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:940 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc000378300)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992
github.com/NimbleArchitect/kubectl-ice/cmd/plugin/cli.InitAndExecute()
	/home/runner/work/kubectl-ice/kubectl-ice/cmd/plugin/cli/root.go:52 +0x1e
main.main()
	/home/runner/work/kubectl-ice/kubectl-ice/cmd/plugin/main.go:10 +0x17

I'm getting a similar error for the kubernetes-dasboard ns as well, but it works with kube-system, default.

My environment:

Client Version: v1.29.0
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.29.0

# kubectl get node -o wide
NAME       STATUS   ROLES           AGE    VERSION   INTERNAL-IP   EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION      CONTAINER-RUNTIME
c-plane1   Ready    control-plane   275d   v1.29.0   10.10.10.51   <none>        Ubuntu 22.04.3 LTS   5.15.0-91-generic   containerd://1.7.24
worker1    Ready    <none>          275d   v1.29.0   10.10.10.52   <none>        Ubuntu 22.04.3 LTS   5.15.0-91-generic   containerd://1.7.24
worker2    Ready    <none>          275d   v1.29.0   10.10.10.53   <none>        Ubuntu 22.04.3 LTS   5.15.0-91-generic   containerd://1.7.24
worker3    Ready    <none>          275d   v1.29.0   10.10.10.54   <none>        Ubuntu 22.04.3 LTS   5.15.0-91-generic   containerd://1.7.24

# uname -a
Linux admin-ws 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Kind regards,
Laszlo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions