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

[Bug] panic: runtime error: integer divide by zero #277

Open
rsivasamgit opened this issue Nov 16, 2023 · 0 comments
Open

[Bug] panic: runtime error: integer divide by zero #277

rsivasamgit opened this issue Nov 16, 2023 · 0 comments
Labels

Comments

@rsivasamgit
Copy link

Bug reports

We are using go-prompt and once in a while when we get into the CLI prompt, a "divide by zero" error is seen

panic: runtime error: integer divide by zero

goroutine 1 [running]:
github.com/c-bata/go-prompt.(*Render).toPos(...)
/go/pkg/mod/github.com/c-bata/go-prompt@v0.2.6/render.go:269
github.com/c-bata/go-prompt.(*Render).move(0x0?, 0x0?, 0xc00006f8b8?)
/go/pkg/mod/github.com/c-bata/go-prompt@v0.2.6/render.go:258 +0xbb
github.com/c-bata/go-prompt.(*Render).clear(0xc0004b8ea0, 0x17487af?)
/go/pkg/mod/github.com/c-bata/go-prompt@v0.2.6/render.go:245 +0x25
github.com/c-bata/go-prompt.(*Render).BreakLine(0xc0004b8ea0, 0xc000424140)
/go/pkg/mod/github.com/c-bata/go-prompt@v0.2.6/render.go:229 +0x22d
github.com/c-bata/go-prompt.(*Prompt).feed(0xc0000e6000, {0xc0004f9800, 0x1, 0x400})
/go/pkg/mod/github.com/c-bata/go-prompt@v0.2.6/prompt.go:124 +0x2fa
github.com/c-bata/go-prompt.(*Prompt).Run(0xc0000e6000)
/go/pkg/mod/github.com/c-bata/go-prompt@v0.2.6/prompt.go:71 +0x525
bitbucket.rks-cloud.com/edge/seinfra-common-app/pkg/cobrashell.New.func1(0xc000468600?, {0x173ef40?, 0x0?, 0x0?})
/stage/pkg/cobrashell/shell.go:62 +0xf2
github.com/spf13/cobra.(*Command).execute(0xc000468600, {0x24b6e68, 0x0, 0x0})
/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:944 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0x246d000)
/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992

The issue is not seen always, it is seen once in every 6 attempts or so and rest of the time, the CLI renders properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant