crash during autocomplete selection
Open
Nobody has claimed this yet.
bug
- Dominant language
- Go
- Stars
- 113
- Forks
- 18
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 23
Description
I've just press tab key on box.space.space_name. for some times, can't reproduce it again, but maybe stack trace can helps
/Users/andrey.klyuev/Projects/tarantool/tarakafka/var/run/tarakafka/storage-1-1/storage-1-1.control> box.space.queue.2023/05/15 15:04:39 whoops! It looks like something is wrong with this version of Tarantool CLI.
Error: Unhandled internal error: runtime error: slice bounds out of range [:1] with capacity 0
Version: Tarantool CLI version <unknown>, darwin/amd64. commit:
Stacktrace:
goroutine 1 [running]:
runtime/debug.Stack()
/usr/local/Cellar/go/1.20.3/libexec/src/runtime/debug/stack.go:24 +0x65
github.com/tarantool/tt/cli/util.InternalError({0x10099d6f4, 0x1c}, 0x0?, {0xc0000b5138, 0x1, 0x1})
cli/tt/cli/util/util.go:125 +0xa5
main.main.func1()
cli/main.go:19 +0x5f
panic({0x10092d200, 0xc0005e0480})
/usr/local/Cellar/go/1.20.3/libexec/src/runtime/panic.go:884 +0x213
github.com/c-bata/go-prompt.(*Render).renderCompletion(0xc000157ee0, 0xc000388580, 0xc0005f6dc0)
/Users/andrey.klyuev/go/pkg/mod/github.com/c-bata/go-prompt@v0.2.6/render.go:110 +0x869
github.com/c-bata/go-prompt.(*Render).Render(0xc000157ee0, 0xc000388580, 0xc0005f6dc0)
/Users/andrey.klyuev/go/pkg/mod/github.com/c-bata/go-prompt@v0.2.6/render.go:206 +0x39f
github.com/c-bata/go-prompt.(*Prompt).Run(0xc0001bc630)
/Users/andrey.klyuev/go/pkg/mod/github.com/c-bata/go-prompt@v0.2.6/prompt.go:100 +0x6ea
github.com/tarantool/tt/cli/connect.(*Console).Run(0xc0001de140)
cli/tt/cli/connect/console.go:145 +0x1aa
github.com/tarantool/tt/cli/connect.runConsole({{0x1009825f7, 0x4}, {0xc00014a070, 0x63}, {0x0, 0x0}, {0x0, 0x0}, {{0x0, 0x0}, ...}}, ...)
cli/tt/cli/connect/connect.go:159 +0x125
github.com/tarantool/tt/cli/connect.Connect({{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, 0x0, {0x0, 0x0}, {0x0, ...}, ...}, ...)
cli/tt/cli/connect/connect.go:92 +0xdc
github.com/tarantool/tt/cli/cmd.internalConnectModule(0x1008a8480?, {0xc0001922c0, 0x1, 0x1})
cli/tt/cli/cmd/connect.go:227 +0x335
github.com/tarantool/tt/cli/modules.RunCmd(0x1011a33a0, {0xc0005e2b30, 0xa}, 0xc0001bf300?, 0x100aa11d8, {0xc0001922c0, 0x1, 0x1})
cli/tt/cli/modules/run.go:36 +0x90
github.com/tarantool/tt/cli/cmd.NewConnectCmd.func1(0xc00013e500?, {0xc0001922c0, 0x1, 0x1})
cli/tt/cli/cmd/connect.go:59 +0x94
github.com/spf13/cobra.(*Command).execute(0xc00013e500, {0xc0001941a0, 0x1, 0x1})
/Users/andrey.klyuev/go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:860 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0xc00013ac80)
/Users/andrey.klyuev/go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:974 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
/Users/andrey.klyuev/go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:902
github.com/tarantool/tt/cli/cmd.Execute()
cli/tt/cli/cmd/root.go:176 +0x25
main.main()
cli/main.go:32 +0x18a
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the autocomplete path in cli/tt/cli/connect/console.go and compare it with the go-prompt renderCompletion call shown in the stack trace. Investigate the reported slice-bounds panic during repeated Tab selection, then add a regression test if the failure can be reproduced and verify that autocomplete no longer crashes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100