[Issue] panic when received SIGINT
qiuchengxuan opened this issue · comments
qiuchengxuan commented
Current Behavior
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x118 pc=0x7ccdd2]
goroutine 1 [running]:
github.com/regclient/regclient/types/blob.(*BReader).Close(0xc0003b0df0?)
github.com/regclient/regclient/types/blob/reader.go:85 +0x12
github.com/regclient/regclient/mod.Apply.func3.1()
github.com/regclient/regclient/mod/mod.go:121 +0x24
github.com/regclient/regclient/mod.Apply.func3(0xc0004c6c00)
github.com/regclient/regclient/mod/mod.go:136 +0x374
github.com/regclient/regclient/mod.dagWalkLayers(0xc00037ac60, 0xc0003b1408)
github.com/regclient/regclient/mod/dag.go:509 +0x92
github.com/regclient/regclient/mod.dagWalkLayers(0xc000446420, 0xc0003b1408)
github.com/regclient/regclient/mod/dag.go:498 +0x137
github.com/regclient/regclient/mod.Apply({0xa9a778, 0xc0000b04b0}, _, {{0x9a957b, 0x3}, {0x7ffcff334c3d, 0x15}, {0x9aaf58, 0x9}, {0x7ffcff334c3d, ...}, ...}, ...)
github.com/regclient/regclient/mod/mod.go:117 +0x750
main.(*imageCmd).runImageMod(0xc00033a160, 0xc000360608, {0xc00031e150?, 0x0?, 0x0?})
github.com/regclient/regclient/cmd/regctl/image.go:1651 +0x77f
github.com/spf13/cobra.(*Command).execute(0xc000360608, {0xc00031e0e0, 0x7, 0x7})
github.com/spf13/cobra@v1.8.0/command.go:983 +0xaca
github.com/spf13/cobra.(*Command).ExecuteC(0xc000320008)
github.com/spf13/cobra@v1.8.0/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/cobra@v1.8.0/command.go:1039
github.com/spf13/cobra.(*Command).ExecuteContext(...)
github.com/spf13/cobra@v1.8.0/command.go:1032
main.main()
github.com/regclient/regclient/cmd/regctl/main.go:29 +0x14e
Expected Behavior
Won't panic
Steps To Reproduce
regctl -v error image mod fluent/fluent-bit:1.8 --layer-compress none --create ocidir://fluent-bit:1.8
- Press control+c
Version
VCSTag: v0.6.1
VCSRef: 766ee6291f882778207ff42207f9ca8b1da54e57
VCSCommit: 766ee6291f882778207ff42207f9ca8b1da54e57
VCSState: clean
VCSDate: 2024-05-14T13:18:19Z
Platform: linux/amd64
GoVer: go1.22.3
GoCompiler: gc
Environment
- Running as binary or container: binary
- Host platform: linux/amd64
- Registry description: dockerhub
Anything else
nope
Brandon Mitchell commented
Thank you for the report! This should be resolved by #746.