Skip to content

Autocomplete crashes cmk if at the end of uuid string聽#195

Description

@borisstoyanov

When you are towards the end of the uuid string and tab to auto complete it crashes cmk.

Image

out of range exception appears:

(localcloud) 馃惐 >
panic: runtime error: slice bounds out of range [:22] with capacity 20

goroutine 19 [running]:
github.com/chzyer/readline.(*opCompleter).truncateBufferAfterLastEqual(0xc0000e7490, {0xc0014fa040, 0x14, 0x14})
	/home/shwstppr/lab/shapeblue/cloudstack-cloudmonkey/vendor/github.com/chzyer/readline/complete.go:54 +0x1e9
github.com/chzyer/readline.(*opCompleter).writeRunes(0xc0000e7490, {0xc0014fa000, 0x10000c0000efc28?, 0x24})
	/home/shwstppr/lab/shapeblue/cloudstack-cloudmonkey/vendor/github.com/chzyer/readline/complete.go:70 +0x8d
github.com/chzyer/readline.(*opCompleter).OnComplete(0xc0000e7490)
	/home/shwstppr/lab/shapeblue/cloudstack-cloudmonkey/vendor/github.com/chzyer/readline/complete.go:125 +0x1b2
github.com/chzyer/readline.(*Operation).ioloop(0xc0000e73b0)
	/home/shwstppr/lab/shapeblue/cloudstack-cloudmonkey/vendor/github.com/chzyer/readline/operation.go:180 +0xd0f
created by github.com/chzyer/readline.NewOperation in goroutine 1
	/home/shwstppr/lab/shapeblue/cloudstack-cloudmonkey/vendor/github.com/chzyer/readline/operation.go:88 +0x2c6

Activity

  1. shwstppr commented on Oct 6, 2025

    @shwstppr
    Contributor

    @borisstoyanov I tried this but couldn't reproduce. I even tried with different environments and on different hosts.
    Interestingly your error mentions my local directory structure for some reason /home/shwstppr/lab/shapeblue/cloudstack-cloudmonkey. Can you please confirm, cmk is used from the official release?

  2. added a commit that references this issue on Oct 7, 2025
    18ebd4b
  3. shwstppr commented on Oct 7, 2025

    @shwstppr
    Contributor

    @borisstoyanov while I was not able to reproduce this. I've added some safety check in the code to avoid crash. Can you please test the PR #196?

  4. borisstoyanov commented on Oct 8, 2025

    @borisstoyanov
    ContributorAuthor

    Thanks @shwstppr I think I've noticed this on one of your envs which might be gone by now, let me close this for now

  5. added this to the 6.6.0 milestone on Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions