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

Segment violation when cli does not exit with 0 code #98

Closed
aratz-lasa opened this issue Mar 29, 2023 · 1 comment
Closed

Segment violation when cli does not exit with 0 code #98

aratz-lasa opened this issue Mar 29, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@aratz-lasa
Copy link
Contributor

If we run the CLI command incorrectly, such as not passing the mandatory arguments, it raises a segment violation instead of only showing an error about lacking arguments.

Command:
go run ./cmd/ww client sub

Output:

NAME:
   ww cluster subscribe - print messages from a topic

USAGE:
   ww cluster subscribe [command options] [arguments...]

OPTIONS:
   --topic value, -t value  pubsub topic
   --hex                    format output as hex (default: false)
   --help, -h               show help
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0x100dcc71e]

goroutine 1 [running]:
go.uber.org/fx.(*App).StopTimeout(...)
        /Users/aratz/go/pkg/mod/go.uber.org/fx@v1.19.2/app.go:748
github.com/wetware/ww/internal/cmd/cluster.teardown.func1(0x1015440a0?)
        /Users/aratz/github.com/wetware/ww/internal/cmd/cluster/cluster.go:92 +0x3e
github.com/urfave/cli/v2.(*Command).Run.func1()
        /Users/aratz/go/pkg/mod/github.com/urfave/cli/v2@v2.25.1/command.go:195 +0x3a
github.com/urfave/cli/v2.(*Command).Run(0xc00015fce0, 0xc0001ec780, {0xc000449840, 0x1, 0x1})
        /Users/aratz/go/pkg/mod/github.com/urfave/cli/v2@v2.25.1/command.go:210 +0x77b
github.com/urfave/cli/v2.(*Command).Run(0xc0001f29a0, 0xc0001ec480, {0xc00048eaa0, 0x2, 0x2})
        /Users/aratz/go/pkg/mod/github.com/urfave/cli/v2@v2.25.1/command.go:267 +0xc4d
github.com/urfave/cli/v2.(*Command).Run(0xc0001f2dc0, 0xc0001ec140, {0xc000194090, 0x3, 0x3})
        /Users/aratz/go/pkg/mod/github.com/urfave/cli/v2@v2.25.1/command.go:267 +0xc4d
github.com/urfave/cli/v2.(*App).RunContext(0xc0003825a0, {0x10154ffd0?, 0xc00019c008}, {0xc000194090, 0x3, 0x3})
        /Users/aratz/go/pkg/mod/github.com/urfave/cli/v2@v2.25.1/app.go:332 +0x616
github.com/urfave/cli/v2.(*App).Run(...)
        /Users/aratz/go/pkg/mod/github.com/urfave/cli/v2@v2.25.1/app.go:309
main.run(0x100f1b840?)
        /Users/aratz/github.com/wetware/ww/cmd/ww/main.go:82 +0x3c
main.main()
        /Users/aratz/github.com/wetware/ww/cmd/ww/main.go:65 +0x19b
exit status 2
@aratz-lasa aratz-lasa added the bug Something isn't working label Mar 29, 2023
@lthibault
Copy link
Collaborator

Fixed in v0.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants