Skip to content

TestFileReaderSeek fails on go1.18 #3614

@zhsj

Description

@zhsj
$ go test -run TestFileReaderSeek
--- FAIL: TestFileReaderSeek (0.00s)
panic: runtime error: slice bounds out of range [13313:13312] [recovered]
        panic: runtime error: slice bounds out of range [13313:13312]

goroutine 7 [running]:
testing.tRunner.func1.2({0x7fb820, 0xc00002e198})
        /usr/lib/go-1.18/src/testing/testing.go:1389 +0x24e
testing.tRunner.func1()
        /usr/lib/go-1.18/src/testing/testing.go:1392 +0x39f
panic({0x7fb820, 0xc00002e198})
        /usr/lib/go-1.18/src/runtime/panic.go:838 +0x207
github.com/distribution/distribution/v3/registry/storage/driver/inmemory.(*file).ReadAt(0xc0008912c0?, {0xc000380000?, 0x0?, 0x0?}, 0x0?)
        /home/zhsj/go/src/github.com/distribution/distribution/registry/storage/driver/inmemory/mfs.go:287 +0x7a
io.(*SectionReader).Read(0xc0008a2060, {0xc000380000?, 0x0?, 0x1000000000000?})
        /usr/lib/go-1.18/src/io/io.go:512 +0x54
bufio.(*Reader).Read(0xc0000385a0, {0xc00089c390, 0x10, 0x1?})
        /usr/lib/go-1.18/src/bufio/bufio.go:236 +0x1b4
github.com/distribution/distribution/v3/registry/storage.(*fileReader).Read(0xc00031def8, {0xc00089c390, 0x10, 0x10})
        /home/zhsj/go/src/github.com/distribution/distribution/registry/storage/filereader.go:63 +0x62
github.com/distribution/distribution/v3/registry/storage.TestFileReaderSeek(0xc0001191e0)
        /home/zhsj/go/src/github.com/distribution/distribution/registry/storage/filereader_test.go:142 +0xa85
testing.tRunner(0xc0001191e0, 0x857278)
        /usr/lib/go-1.18/src/testing/testing.go:1439 +0x102
created by testing.(*T).Run
        /usr/lib/go-1.18/src/testing/testing.go:1486 +0x35f
exit status 2
FAIL    github.com/distribution/distribution/v3/registry/storage        0.010s

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions