wagoodman / dive

A tool for exploring each layer in a docker image
MIT License
45.84k stars 1.75k forks source link

[ERROR] index out of range when reaching end of layers list #295

Open MonsieurRz opened 4 years ago

MonsieurRz commented 4 years ago

Hello, I would like to say that this tool is very useful, thanks a lot ! This error can be reproduced in a image containing lots of layers (15 layers in my case). In the layer section, reach the last layer and continue pressing down, you will get this error:

panic: runtime error: index out of range [15] with length 15

goroutine 19 [running]: github.com/wagoodman/dive/runtime/ui/view.(Layer).CurrentLayer(...) /Users/wagoodman/code/dive/runtime/ui/view/layer.go:235 github.com/wagoodman/dive/runtime/ui/view.(Layer).notifyLayerChangeListeners(0xc004b7a000, 0x0, 0xf) /Users/wagoodman/code/dive/runtime/ui/view/layer.go:62 +0x20d github.com/wagoodman/dive/runtime/ui/view.(Layer).SetCursor(0xc004b7a000, 0xf, 0x1, 0x0) /Users/wagoodman/code/dive/runtime/ui/view/layer.go:225 +0x37 github.com/wagoodman/dive/runtime/ui/view.(Layer).CursorDown(0xc004b7a000, 0xc0008f98e8, 0x43d95c) /Users/wagoodman/code/dive/runtime/ui/view/layer.go:205 +0x8a github.com/wagoodman/dive/runtime/ui/key.(Binding).onAction(0xc005046bc0, 0xc004b74000, 0xc0050820f0, 0x0, 0x28) /Users/wagoodman/code/dive/runtime/ui/key/binding.go:109 +0x34 github.com/jroimartin/gocui.(Gui).execKeybindings(0xc004b74000, 0xc0050820f0, 0xc0008f9a58, 0x0, 0x8, 0x9) /Users/wagoodman/go/pkg/mod/github.com/jroimartin/gocui@v0.4.0/gui.go:629 +0xc2 github.com/jroimartin/gocui.(Gui).onKey(0xc004b74000, 0xc0008f9a58, 0x2, 0x0) /Users/wagoodman/go/pkg/mod/github.com/jroimartin/gocui@v0.4.0/gui.go:593 +0x19b github.com/jroimartin/gocui.(Gui).handleEvent(...) /Users/wagoodman/go/pkg/mod/github.com/jroimartin/gocui@v0.4.0/gui.go:413 github.com/jroimartin/gocui.(*Gui).MainLoop(0xc004b74000, 0xc000317110, 0xc000331b00) /Users/wagoodman/go/pkg/mod/github.com/jroimartin/gocui@v0.4.0/gui.go:373 +0x1e2 github.com/wagoodman/dive/runtime/ui.Run(0xc000317110, 0xc000331b00, 0xf, 0x10, 0xc000bd19b0, 0xc000bd19e0, 0x0, 0x0) /Users/wagoodman/code/dive/runtime/ui/app.go:144 +0x102 github.com/wagoodman/dive/runtime.run(0xff4d01, 0x0, 0x7ffc5bab20d2, 0xe, 0x1, 0x0, 0x0, 0xc000121500, 0x0, 0x0, ...) /Users/wagoodman/code/dive/runtime/run.go:108 +0x645 created by github.com/wagoodman/dive/runtime.Run /Users/wagoodman/code/dive/runtime/run.go:130 +0x118

TBeijen commented 4 years ago

Second this. In my case at 13:

panic: runtime error: index out of range [13] with length 13
mark2185 commented 2 years ago

Could you give https://github.com/wagoodman/dive/pull/395 a spin to see if it helps?

silviot commented 1 year ago

I was experiencing this issue. #395 fixed it for me.

rpl-ian-lunam commented 10 months ago

I get the same issue (on v0.11.0) but only when using PGDN.