Skip to content

Resize terminal: "slice bounds out of range" in util/progress/progressui.wrapHeight #1479

@mhansen

Description

@mhansen

Hi there, I was running a long build, and I was resizing my terminal in tmux. It got pretty small, maybe 1 line high, maybe less (I had a few vertically stacked frames and I was rearranging them - at the midpoint they got pretty short), anyway, my build was aborted with a panic in the progress UI library.

I gotta admit I laughed a bit, it's the first time that resizing my terminal has aborted my build :-)

panic: runtime error: slice bounds out of range

goroutine 8 [running]:
github.com/docker/buildx/vendor/github.com/moby/buildkit/util/progress/progressui.wrapHeight(0xc000678800, 0x3c, 0x40, 0xffffffffffffffff, 0x2, 0xc0005086f0, 0x1)
        /go/src/github.com/docker/buildx/vendor/github.com/moby/buildkit/util/progress/progressui/display.go:554 +0x4f3
github.com/docker/buildx/vendor/github.com/moby/buildkit/util/progress/progressui.setupTerminals(0xc000678800, 0x3c, 0x40, 0x1, 0x0, 0x1, 0x2b55940, 0x0)
        /go/src/github.com/docker/buildx/vendor/github.com/moby/buildkit/util/progress/progressui/display.go:433 +0x2ee
github.com/docker/buildx/vendor/github.com/moby/buildkit/util/progress/progressui.(*display).print(0xc000177e40, 0xbfa667cb4ee3f5c8, 0x2a9e25e, 0x2b55940, 0xc000678800, 0x3c, 0x40, 0x18, 0x10, 0xcc, ...)
        /go/src/github.com/docker/buildx/vendor/github.com/moby/buildkit/util/progress/progressui/display.go:441 +0x76
github.com/docker/buildx/vendor/github.com/moby/buildkit/util/progress/progressui.DisplaySolveStatus(0x210a5e0, 0xc0002a5100, 0x0, 0x0, 0x2124780, 0xc0003d6410, 0x20d8600, 0xc00000e010, 0xc00008eae0, 0x0, ...)
        /go/src/github.com/docker/buildx/vendor/github.com/moby/buildkit/util/progress/progressui/display.go:76 +0x62e
github.com/docker/buildx/util/progress.NewPrinter.func1(0xc00000e010, 0x1f05d64, 0x4, 0x210a5e0, 0xc0002a5100, 0xc00008eae0, 0xc000312920, 0xc00008eb40)
        /go/src/github.com/docker/buildx/util/progress/printer.go:52 +0x9c
created by github.com/docker/buildx/util/progress.NewPrinter
        /go/src/github.com/docker/buildx/util/progress/printer.go:46 +0x15c

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions