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

Piping yes to stream deletion causes SIGSEGV #150

Closed
LucasRxTx opened this issue May 3, 2021 · 1 comment
Closed

Piping yes to stream deletion causes SIGSEGV #150

LucasRxTx opened this issue May 3, 2021 · 1 comment

Comments

@LucasRxTx
Copy link

yes yes | nats str delete SOME_STREAM When SOME_STREAM is the name of an actual stream, will SIGSEGV.

? Really delete Stream Junk (y/N) panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x83b0fc9]
goroutine 1 [running]:
github.com/AlecAivazis/survey/v2/terminal.(*RuneReader).ReadLine(0x57303e00, 0x0, 0x8d51968, 0x5700e110, 0x89a3a74, 0x5700e118, 0x57303e00)
    /Users/rip/go/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.2.7/terminal/runereader.go:56 +0x3b9
github.com/AlecAivazis/survey/v2.(*Confirm).getBool(0x57084f00, 0x8874000, 0x570b5364, 0x87c5d00, 0x0, 0x0)
    /Users/rip/go/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.2.7/confirm.go:57 +0x109
github.com/AlecAivazis/survey/v2.(*Confirm).Prompt(0x57084f00, 0x570b5364, 0x5700e108, 0x89a6b58, 0x5700e110, 0x89a3a74)
    /Users/rip/go/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.2.7/confirm.go:136 +0xe5
github.com/AlecAivazis/survey/v2.Ask(0x5727fdf4, 0x1, 0x1, 0x8732240, 0x5701f7f4, 0x0, 0x0, 0x0, 0x5706ca20, 0x811cc0b)
    /Users/rip/go/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.2.7/survey.go:293 +0x400
github.com/AlecAivazis/survey/v2.AskOne(...)
    /Users/rip/go/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.2.7/survey.go:236
main.askConfirmation(0x57026aa0, 0x19, 0x5727fe00, 0x1, 0x1, 0x57026aa0)
    /Users/rip/go/src/github.com/nats-io/natscli/nats/util.go:273 +0xe3
main.(*streamCmd).rmAction(0x57124500, 0x5724e0a0, 0x0, 0x0)
    /Users/rip/go/src/github.com/nats-io/natscli/nats/stream_command.go:1701 +0x174
gopkg.in/alecthomas/kingpin%2ev2.(*actionMixin).applyActions(0x57302e4c, 0x5724e0a0, 0x0, 0x0)
    /Users/rip/go/pkg/mod/gopkg.in/alecthomas/kingpin.v2@v2.2.6/actions.go:28 +0x51
gopkg.in/alecthomas/kingpin%2ev2.(*Application).applyActions(0x57120900, 0x5724e0a0, 0x0, 0x0)
    /Users/rip/go/pkg/mod/gopkg.in/alecthomas/kingpin.v2@v2.2.6/app.go:557 +0xb6
gopkg.in/alecthomas/kingpin%2ev2.(*Application).execute(0x57120900, 0x5724e0a0, 0x57318200, 0x2, 0x2, 0x0, 0x0, 0x0, 0x877a940)
    /Users/rip/go/pkg/mod/gopkg.in/alecthomas/kingpin.v2@v2.2.6/app.go:390 +0x7d
gopkg.in/alecthomas/kingpin%2ev2.(*Application).Parse(0x57120900, 0x57016128, 0x3, 0x3, 0x1, 0x572c83b8, 0x0, 0x2)
    /Users/rip/go/pkg/mod/gopkg.in/alecthomas/kingpin.v2@v2.2.6/app.go:222 +0x183
main.main()
    /Users/rip/go/src/github.com/nats-io/natscli/nats/main.go:109 +0x113b
@ripienaar
Copy link
Collaborator

While piping yes to the cli is neither useful or neccesary, I've made it exit with a less scary error in that case.

You can pass -f to avoid the prompt.

#153

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