Skip to content

panic: runtime error: slice bounds out of range [:258] with capacity 0 #333

@hopegi

Description

@hopegi

when i convert a oci image to nydus image,it occur a panic: panic: runtime error: slice bounds out of range [:258] with capacity 0
the stack is

panic: runtime error: slice bounds out of range [:258] with capacity 0

runtime/debug.Stack()
	/usr/local/go/src/runtime/debug/stack.go:24 +0x8c
golang.org/x/sync/singleflight.newPanicError({0x922e5e0, 0xaff4000})
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/vendor/golang.org/x/sync/singleflight/singleflight.go:44 +0x2e
golang.org/x/sync/singleflight.(*Group).doCall.func2.1()
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/vendor/golang.org/x/sync/singleflight/singleflight.go:193 +0x68
panic({0x922e5e0, 0xaff4000})
	/usr/local/go/src/runtime/panic.go:920 +0x26f
compress/flate.(*compressor).findMatch(0xb64e000, 0x0, 0x0, 0x3, 0x1afa)
	/usr/local/go/src/compress/flate/deflate.go:236 +0x336
compress/flate.(*compressor).deflate(0xb64e000)
	/usr/local/go/src/compress/flate/deflate.go:436 +0x672
compress/flate.(*compressor).write(0xb64e000, {0xb555c00, 0x400, 0xf8400})
	/usr/local/go/src/compress/flate/deflate.go:544 +0x98
compress/flate.(*Writer).Write(0xb64e000, {0xb54e000, 0x8000, 0x100000})
	/usr/local/go/src/compress/flate/deflate.go:710 +0x6b
compress/gzip.(*Writer).Write(0xaaac150, {0xb54e000, 0x8000, 0x100000})
	/usr/local/go/src/compress/gzip/gzip.go:196 +0x817
io.(*multiWriter).Write(0xaffa680, {0xb54e000, 0x8000, 0x100000})
	/usr/local/go/src/io/multi.go:85 +0xba
io.copyBuffer({0x93920a0, 0xaffa680}, {0x9392064, 0xabb5cc8}, {0xb54e000, 0x100000, 0x100000})
	/usr/local/go/src/io/io.go:432 +0x55f
io.CopyBuffer({0x93920a0, 0xaffa680}, {0x9392064, 0xabb5cc8}, {0xb54e000, 0x100000, 0x100000})
	/usr/local/go/src/io/io.go:403 +0xbd
github.com/containerd/nydus-snapshotter/pkg/converter.MergeLayers({0x939d1b8, 0xad000c0}, {0x939f9d4, 0xa87ca80}, {0xaf02000, 0x7, 0x8}, {{0xac5cd70, 0x4}, {0x92b2939, ...}, ...})
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/vendor/github.com/containerd/nydus-snapshotter/pkg/converter/convert_unix.go:1117 +0x14e2
github.com/containerd/nydus-snapshotter/pkg/converter.convertManifest({0x939d1b8, 0xad000c0}, {0x939f9d4, 0xa87ca80}, {{0xad0ac00, 0x34}, {0xb3c0140, 0x47}, 0x55d, {0x0, ...}, ...}, ...)
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/vendor/github.com/containerd/nydus-snapshotter/pkg/converter/convert_unix.go:984 +0x42a
github.com/containerd/nydus-snapshotter/pkg/converter.ConvertHookFunc.func1({0x939d1b8, 0xad000c0}, {0x939f9d4, 0xa87ca80}, {{0xad0ac00, 0x34}, {0xb3c0140, 0x47}, 0x55d, {0x0, ...}, ...}, ...)
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/vendor/github.com/containerd/nydus-snapshotter/pkg/converter/convert_unix.go:907 +0x2ab
github.com/goharbor/acceleration-service/pkg/driver/nydus.(*Driver).convert.func2({0x939d1b8, 0xad000c0}, {0x939f9d4, 0xa87ca80}, {{0xad0ac00, 0x34}, {0xb3c0140, 0x47}, 0x55d, {0x0, ...}, ...}, ...)
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/pkg/driver/nydus/nydus.go:298 +0xf6
github.com/containerd/containerd/images/converter.(*defaultConverter).convert(0xabf8330, {0x939d1b8, 0xad000c0}, {0x939f9d4, 0xa87ca80}, {{0xad0ac00, 0x34}, {0xb3c0140, 0x47}, 0x55d, ...})
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/vendor/github.com/containerd/containerd/images/converter/default.go:104 +0x55e
github.com/goharbor/acceleration-service/pkg/driver/nydus.(*Driver).convert(0xac21490, {0x939d1b8, 0xad000c0}, {0x939f540, 0xa87cab0}, {{0xad0ac00, 0x34}, {0xb3c0140, 0x47}, 0x55d, ...}, ...)
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/pkg/driver/nydus/nydus.go:338 +0x720
github.com/goharbor/acceleration-service/pkg/driver/nydus.(*Driver).Convert(0xac21490, {0x939d1b8, 0xad000c0}, {0x939f540, 0xa87cab0}, {0xada4320, 0x4a})
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/pkg/driver/nydus/nydus.go:239 +0x21d
github.com/goharbor/acceleration-service/pkg/converter.(*Converter).Convert(0xac5b700, {0x939d1b8, 0xad000c0}, {0xada4320, 0x4a}, {0xac1a2a0, 0x56}, {0x0, 0x0})
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/pkg/converter/converter.go:154 +0x14c9
github.com/goharbor/acceleration-service/pkg/adapter.(*LocalAdapter).Convert(0xa83b9c8, {0x939d1b8, 0xad000c0}, {0xb3f4050, 0x4a})
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/pkg/adapter/adapter.go:131 +0x6f6
github.com/goharbor/acceleration-service/pkg/adapter.(*LocalAdapter).Dispatch.func2.1.1()
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/pkg/adapter/adapter.go:168 +0x1c6
github.com/goharbor/acceleration-service/pkg/metrics.(*OpWrapper).OpWrap(0xa8117d0, 0xacf95bc, {0xae8fda0, 0x1, 0x1})
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/pkg/metrics/metrics.go:82 +0x6b
github.com/goharbor/acceleration-service/pkg/adapter.(*LocalAdapter).Dispatch.func2.1()
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/pkg/adapter/adapter.go:164 +0x1ac
golang.org/x/sync/singleflight.(*Group).doCall.func2(0xae8fe4f, 0xacea0c0, 0xacf9784)
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/vendor/golang.org/x/sync/singleflight/singleflight.go:198 +0xd1
golang.org/x/sync/singleflight.(*Group).doCall(0x9a8f068, 0xacea0c0, {0xb3f4050, 0x4a}, 0xacf9784)
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/vendor/golang.org/x/sync/singleflight/singleflight.go:200 +0x14b
golang.org/x/sync/singleflight.(*Group).Do(0x9a8f068, {0xb3f4050, 0x4a}, 0xacf9784)
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/vendor/golang.org/x/sync/singleflight/singleflight.go:113 +0x304
github.com/goharbor/acceleration-service/pkg/adapter.(*LocalAdapter).Dispatch.func2()
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/pkg/adapter/adapter.go:163 +0x14e
github.com/goharbor/acceleration-service/pkg/adapter.NewWorker.func1()
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/pkg/adapter/worker.go:44 +0x4e
created by github.com/goharbor/acceleration-service/pkg/adapter.NewWorker in goroutine 1
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/pkg/adapter/worker.go:41 +0x14d


goroutine 41 [running]:
golang.org/x/sync/singleflight.(*Group).doCall.func1()
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/vendor/golang.org/x/sync/singleflight/singleflight.go:170 +0x40f
golang.org/x/sync/singleflight.(*Group).doCall(0x9a8f068, 0xacea0c0, {0xb3f4050, 0x4a}, 0xacf9784)
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/vendor/golang.org/x/sync/singleflight/singleflight.go:205 +0x164
golang.org/x/sync/singleflight.(*Group).Do(0x9a8f068, {0xb3f4050, 0x4a}, 0xacf9784)
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/vendor/golang.org/x/sync/singleflight/singleflight.go:113 +0x304
github.com/goharbor/acceleration-service/pkg/adapter.(*LocalAdapter).Dispatch.func2()
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/pkg/adapter/adapter.go:163 +0x14e
github.com/goharbor/acceleration-service/pkg/adapter.NewWorker.func1()
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/pkg/adapter/worker.go:44 +0x4e
created by github.com/goharbor/acceleration-service/pkg/adapter.NewWorker in goroutine 1
	/home/hopegi/Codes/ecloud_code/go/acceld/src/github.com/goharbor/acceleration-service/pkg/adapter/worker.go:41 +0x14d

version infos

go version
go version go1.21.5 linux/amd64
acceld version
0.2.13

the painc occur randomly i think

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