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

Crash trying to list traces #87

Closed
dalehamel opened this issue Sep 16, 2019 · 1 comment · Fixed by #89
Closed

Crash trying to list traces #87

dalehamel opened this issue Sep 16, 2019 · 1 comment · Fixed by #89

Comments

@dalehamel
Copy link
Member

$ kubectl trace get
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x1d02385]

goroutine 1 [running]:
github.com/iovisor/kubectl-trace/pkg/tracejob.(*TraceJobClient).GetJob(0xc00066fc90, 0x0, 0x0, 0x0, 0x1d00903, 0xc00000c3c0, 0x0, 0x0)
	/Users/dalehamel/workspace/kubectl-trace/pkg/tracejob/job.go:135 +0x375
github.com/iovisor/kubectl-trace/pkg/cmd.(*GetOptions).Run(0xc0005a3280, 0x21af8e0, 0xc000379b00)
	/Users/dalehamel/workspace/kubectl-trace/pkg/cmd/get.go:163 +0x274
github.com/iovisor/kubectl-trace/pkg/cmd.NewGetCommand.func2(0xc0003d4000, 0x2a8f058, 0x0, 0x0, 0x0, 0x0)
	/Users/dalehamel/workspace/kubectl-trace/pkg/cmd/get.go:88 +0x94
github.com/spf13/cobra.(*Command).execute(0xc0003d4000, 0x2a8f058, 0x0, 0x0, 0xc0003d4000, 0x2a8f058)
	/Users/dalehamel/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:762 +0x460
github.com/spf13/cobra.(*Command).ExecuteC(0xc0002d7900, 0xc0000da000, 0x215ede0, 0xc0000e6000)
	/Users/dalehamel/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:852 +0x2ea
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/dalehamel/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:800
main.main()
	/Users/dalehamel/workspace/kubectl-trace/cmd/kubectl-trace/root.go:24 +0x10e

Appears to be this https://github.com/iovisor/kubectl-trace/blob/master/pkg/tracejob/job.go#L134 (note my local file is different line num)

It looks like if you try to list the trace jobs before their are any, reading this is trying to read invalid memory. We probably need to check that it's safe to navigate the status struct before trying to access its members.

@dalehamel
Copy link
Member Author

@fntlnz @leodido can either of you take a look / reproduce?

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 a pull request may close this issue.

1 participant