wagoodman / dive

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

Dive is crashing when browsing layers of paketobuildpacks/run:base-cnb image #396

Closed asaintsever closed 2 years ago

asaintsever commented 2 years ago

Using dive 0.10.0

How to repro issue:

image

Image Source: docker://13cb3aded743
Fetching image... (this can take a while for large images)
Analyzing image...
Building cache...
panic: runtime error: index out of range [4] with length 4

goroutine 4 [running]:
github.com/wagoodman/dive/runtime/ui/view.(*Layer).CurrentLayer(...)
        /home/runner/work/dive/dive/runtime/ui/view/layer.go:235
github.com/wagoodman/dive/runtime/ui/view.(*Layer).notifyLayerChangeListeners(0xc000176d20, 0x0, 0x4)
        /home/runner/work/dive/dive/runtime/ui/view/layer.go:62 +0x206
github.com/wagoodman/dive/runtime/ui/view.(*Layer).SetCursor(0xc000176d20, 0x4, 0x1, 0x0)
        /home/runner/work/dive/dive/runtime/ui/view/layer.go:225 +0x37
github.com/wagoodman/dive/runtime/ui/view.(*Layer).CursorDown(0xc000176d20, 0x446f53, 0xc00116d7f8)
        /home/runner/work/dive/dive/runtime/ui/view/layer.go:205 +0x8b
github.com/wagoodman/dive/runtime/ui/key.(*Binding).onAction(0xc000523640, 0xc001179b80, 0xc00034a480, 0x5, 0x1)
        /home/runner/work/dive/dive/runtime/ui/key/binding.go:110 +0x34
github.com/awesome-gocui/gocui.(*Gui).execKeybinding(...)
        /home/runner/go/pkg/mod/github.com/awesome-gocui/gocui@v0.6.0/gui.go:747
github.com/awesome-gocui/gocui.(*Gui).execKeybindings(0xc001179b80, 0xc00034a480, 0xc001787a38, 0x8, 0x9, 0x3)
        /home/runner/go/pkg/mod/github.com/awesome-gocui/gocui@v0.6.0/gui.go:733 +0x10b
github.com/awesome-gocui/gocui.(*Gui).onKey(0xc001179b80, 0xc001787a38, 0x2, 0x0)
        /home/runner/go/pkg/mod/github.com/awesome-gocui/gocui@v0.6.0/gui.go:694 +0x176
github.com/awesome-gocui/gocui.(*Gui).handleEvent(...)
        /home/runner/go/pkg/mod/github.com/awesome-gocui/gocui@v0.6.0/gui.go:455
github.com/awesome-gocui/gocui.(*Gui).MainLoop(0xc001179b80, 0x7ffc555e1766, 0xc)
        /home/runner/go/pkg/mod/github.com/awesome-gocui/gocui@v0.6.0/gui.go:415 +0x205
github.com/wagoodman/dive/runtime/ui.Run(0x7ffc555e1766, 0xc, 0xc00026e150, 0xc0004d6300, 0x4, 0x4, 0xc000af3470, 0xc000af34a0, 0x0, 0x0)
        /home/runner/work/dive/dive/runtime/ui/app.go:145 +0x10d
github.com/wagoodman/dive/runtime.run(0xee6f01, 0x0, 0x7ffc555e1766, 0xc, 0x1, 0x0, 0x0, 0x0, 0xc00010f600, 0x0, ...)
        /home/runner/work/dive/dive/runtime/run.go:110 +0x5d3
created by github.com/wagoodman/dive/runtime.Run
        /home/runner/work/dive/dive/runtime/run.go:132 +0x132
mark2185 commented 2 years ago

That should be solved by #395, could you give it a try?

asaintsever commented 2 years ago

Thanks @mark2185 for pointing this PR to me. I did the test and can confirm that it successfully fixes the issue :-)

asaintsever commented 2 years ago

Closing issue, solved by #395