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

Panic in controller/expand-volume #141

Open
dr0pdb opened this issue Dec 6, 2020 · 2 comments
Open

Panic in controller/expand-volume #141

dr0pdb opened this issue Dec 6, 2020 · 2 comments

Comments

@dr0pdb
Copy link

dr0pdb commented Dec 6, 2020

Summary

Upon using controller/expand-volume command without the --cap option as shown below, the program panics:

┌[satiwa☮MININT-UMBS8MU]-(/mnt/c/Users/satiwa)
└> csc controller expand-volume --endpoint tcp://127.0.0.1:10000 --req-bytes 2147483648 "k8s#fusec2151e57321d480c8f7#csivolumename"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x86865d]

goroutine 1 [running]:
github.com/rexray/gocsi/csc/cmd.glob..func6(0xd177c0, 0xc0000c8870, 0x1, 0x5, 0x0, 0x0)
        /home/satiwa/.gvm/pkgsets/go1.15/global/src/github.com/rexray/gocsi/csc/cmd/controller_expand_volume.go:33 +0x5d
github.com/spf13/cobra.(*Command).execute(0xd177c0, 0xc0000c8820, 0x5, 0x5, 0xd177c0, 0xc0000c8820)
        /home/satiwa/.gvm/pkgsets/go1.15/global/src/github.com/spf13/cobra/command.go:850 +0x47c
github.com/spf13/cobra.(*Command).ExecuteC(0xd1aee0, 0x1, 0x99cc88, 0x13b)
        /home/satiwa/.gvm/pkgsets/go1.15/global/src/github.com/spf13/cobra/command.go:958 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
        /home/satiwa/.gvm/pkgsets/go1.15/global/src/github.com/spf13/cobra/command.go:895
github.com/rexray/gocsi/csc/cmd.Execute()
        /home/satiwa/.gvm/pkgsets/go1.15/global/src/github.com/rexray/gocsi/csc/cmd/root.go:165 +0x3f
main.main()
        /home/satiwa/.gvm/pkgsets/go1.15/global/src/github.com/rexray/gocsi/csc/main.go:6 +0x25

This seems to happen on this line.

Upon passing the --cap flag, the program panics again with the following error:

┌[satiwa☮MININT-UMBS8MU]-(/mnt/c/Users/satiwa)
└> csc controller expand-volume --endpoint tcp://127.0.0.1:10000 --cap 1,block --req-bytes 2147483648
"k8s#fusec2151e57321d480c8f7#csivolumename"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x866e9c]

goroutine 1 [running]:
github.com/rexray/gocsi/csc/cmd.(*volumeCapabilitySliceArg).Set(0x0, 0x7ffd6e6baaa1, 0x7, 0x3, 0xc000127e98)
        /home/satiwa/.gvm/pkgsets/go1.15/global/src/github.com/rexray/gocsi/csc/cmd/vartypes.go:96 +0x5dc
github.com/spf13/pflag.(*FlagSet).Set(0xc000268500, 0x97c308, 0x3, 0x7ffd6e6baaa1, 0x7, 0x7ffd6e6baa9d, 0xc000127e10)
        /home/satiwa/.gvm/pkgsets/go1.15/global/src/github.com/spf13/pflag/flag.go:470 +0xe2
github.com/spf13/pflag.(*FlagSet).Parse.func1(0xc0001e2e60, 0x7ffd6e6baaa1, 0x7, 0x3, 0xc000127e98)
        /home/satiwa/.gvm/pkgsets/go1.15/global/src/github.com/spf13/pflag/flag.go:1145 +0x54
github.com/spf13/pflag.(*FlagSet).parseLongArg(0xc000268500, 0x7ffd6e6baa9b, 0x5, 0xc0001e1ca0, 0x4, 0x4, 0xc0001edcb8, 0xc0001e1c90, 0x5, 0x5, ...)
        /home/satiwa/.gvm/pkgsets/go1.15/global/src/github.com/spf13/pflag/flag.go:1007 +0x28b
github.com/spf13/pflag.(*FlagSet).parseArgs(0xc000268500, 0xc0001e1ca0, 0x4, 0x7, 0xc0001edcb8, 0x8204f8, 0xc000269700)
        /home/satiwa/.gvm/pkgsets/go1.15/global/src/github.com/spf13/pflag/flag.go:1115 +0x479
github.com/spf13/pflag.(*FlagSet).Parse(0xc000268500, 0xc0001e1c70, 0x7, 0x7, 0x0, 0xc000141460)
        /home/satiwa/.gvm/pkgsets/go1.15/global/src/github.com/spf13/pflag/flag.go:1148 +0x13d
github.com/spf13/cobra.(*Command).ParseFlags(0xd177c0, 0xc0001e1c70, 0x7, 0x7, 0x7ffd6e6baa61, 0xd16aa0)
        /home/satiwa/.gvm/pkgsets/go1.15/global/src/github.com/spf13/cobra/command.go:1623 +0xbf
github.com/spf13/cobra.(*Command).execute(0xd177c0, 0xc0001e1c70, 0x7, 0x7, 0xd177c0, 0xc0001e1c70)
        /home/satiwa/.gvm/pkgsets/go1.15/global/src/github.com/spf13/cobra/command.go:777 +0xae
github.com/spf13/cobra.(*Command).ExecuteC(0xd1aee0, 0x1, 0x99cc88, 0x13b)
        /home/satiwa/.gvm/pkgsets/go1.15/global/src/github.com/spf13/cobra/command.go:958 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
        /home/satiwa/.gvm/pkgsets/go1.15/global/src/github.com/spf13/cobra/command.go:895
github.com/rexray/gocsi/csc/cmd.Execute()
        /home/satiwa/.gvm/pkgsets/go1.15/global/src/github.com/rexray/gocsi/csc/cmd/root.go:165 +0x3f
main.main()
        /home/satiwa/.gvm/pkgsets/go1.15/global/src/github.com/rexray/gocsi/csc/main.go:6 +0x25

Expected Behavior

Shouldn't panic with and without --cap.

Actual Behavior

Panics

@xing-yang
Copy link

@dr0pdb there's a fix for this bug: #142

Can you try it out and see if it fixed the problem for you?

@dr0pdb
Copy link
Author

dr0pdb commented Dec 8, 2020

@xing-yang Yeah it fixed it.

Nope, it didn't work.
Commented on the PR.

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

No branches or pull requests

2 participants