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

[fix] skip empty command #26

Merged
merged 1 commit into from
Nov 22, 2024
Merged

[fix] skip empty command #26

merged 1 commit into from
Nov 22, 2024

Conversation

xyz-li
Copy link
Contributor

@xyz-li xyz-li commented Nov 22, 2024

When newBPFReconciler is not enabled, it return an empty ScriptCmd. Which cause cilium shell help panic.

https://github.com/cilium/cilium/blob/21ad13700b0f295e4997ffe4d204a9dbcd4cf309/pkg/loadbalancer/experimental/bpf_reconciler.go#L48-L51

PANIC: runtime error: invalid memory address or nil pointer dereference
goroutine 1947 [running]:
github.com/cilium/cilium/daemon/cmd.shell.handleConn.func2()
	/go/src/github.com/cilium/cilium/daemon/cmd/shell.go:117 +0x78
panic({0x36dd600?, 0x706ef80?})
	/usr/local/go/src/runtime/panic.go:785 +0x124
github.com/cilium/hive/script.(*Engine).ListCmds(0x40004f6b00, {0x4689a00, 0x400045ae00}, 0x0, {0x0?, 0x4c?, 0x4003a55768?})
	/go/src/github.com/cilium/cilium/vendor/github.com/cilium/hive/script/engine.go:770 +0x104
github.com/cilium/hive/script.DefaultCmds.Help.func13(0x4002173340, {0x7675940?, 0x0, 0x732fec?})
	/go/src/github.com/cilium/cilium/vendor/github.com/cilium/hive/script/cmds.go:760 +0x3c8
github.com/cilium/hive/script.(*funcCmd).Run(0x0?, 0x2aaaaaaaa?, {0x7675940?, 0x108888?, 0x394dca0?})
	/go/src/github.com/cilium/cilium/vendor/github.com/cilium/hive/script/cmds.go:73 +0x38
github.com/cilium/hive/script.(*Engine).runCommand(0x4002173340?, 0x4002173340, 0x4003df6ab0, {0x46bd7f8, 0x4001e61860})
	/go/src/github.com/cilium/cilium/vendor/github.com/cilium/hive/script/engine.

@xyz-li xyz-li requested a review from a team as a code owner November 22, 2024 09:17
@xyz-li xyz-li requested review from ovidiutirla and removed request for a team November 22, 2024 09:17
@ovidiutirla
Copy link
Contributor

cc @joamaki

Signed-off-by: xyz-li <[email protected]>
@joamaki
Copy link
Contributor

joamaki commented Nov 22, 2024

Should also fix in cilium/cilium, but I’m fine adding this too.

@joamaki joamaki merged commit e90d087 into cilium:main Nov 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants