slimtoolkit / slimtoolkit/slim
Nil pointer dereference in xray/handler.go:891 (mintoolkit v1.41.7 - linux/amd64)
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.4k
- Forks
- 840
- PR merge metrics
- No merged PRs in 30d
Description
Crash in github.com/mintoolkit/mint/pkg/app/master/command/xray, line 891
Command run: $ docker-slim xray docker.io/elyra/kernel-py:3.2.2 --target-type image --platform linux/amd64 --http-probe=false --report report.json
Stack trace:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x20 pc=0x104fcd5d0]
goroutine 1 [running]:
github.com/mintoolkit/mint/pkg/docker/dockerimage.TopObjects.Less(...)
github.com/mintoolkit/mint/pkg/docker/dockerimage/topobjects.go:20
container/heap.down({0x1073e5f00, 0x1400a880138}, 0x0, 0x3)
container/heap/heap.go:108 +0xa4
container/heap.Pop({0x1073e5f00, 0x1400a880138})
container/heap/heap.go:62 +0x60
github.com/mintoolkit/mint/pkg/docker/dockerimage.TopObjects.List({0x1400053e790, 0x4, 0x15})
github.com/mintoolkit/mint/pkg/docker/dockerimage/topobjects.go:44 +0xe8
github.com/mintoolkit/mint/pkg/app/master/command/xray.printImagePackage(0x14000431920, 0x14000764820, {0x0?, 0x140004305a8?}, {0x0?, 0x1400042ee30?}, 0x140004313d8, 0x140004312e0, 0x1400022b8c0, 0xffffffffffffffff, ...)
github.com/mintoolkit/mint/pkg/app/master/command/xray/handler.go:891 +0x1b1c
github.com/mintoolkit/mint/pkg/app/master/command/xray.OnCommand(0x14000431920, 0x14000528500, 0x14000431408, {0x16b66b669, 0x1f}, 0x1, {0x0, 0x0}, {0x0, 0x0}, ...)
github.com/mintoolkit/mint/pkg/app/master/command/xray/handler.go:605 +0x357c
github.com/mintoolkit/mint/pkg/app/master/command/xray.init.func1(0x14000714740)
github.com/mintoolkit/mint/pkg/app/master/command/xray/cli.go:343 +0x1868
github.com/urfave/cli/v2.(*Command).Run(0x1089e8b60, 0x14000714740, {0x140001dc360, 0x9, 0x9})
github.com/urfave/cli/v2@v2.27.1/command.go:279 +0x5f0
github.com/urfave/cli/v2.(*Command).Run(0x140004b5ce0, 0x14000714180, {0x14000206140, 0xa, 0xa})
github.com/urfave/cli/v2@v2.27.1/command.go:272 +0x828
github.com/urfave/cli/v2.(*App).RunContext(0x14000655000, {0x1073e0ec8, 0x108c455a8}, {0x14000206140, 0xa, 0xa})
github.com/urfave/cli/v2@v2.27.1/app.go:337 +0x514
github.com/urfave/cli/v2.(*App).Run(...)
github.com/urfave/cli/v2@v2.27.1/app.go:311
github.com/mintoolkit/mint/pkg/app/master.Run()
github.com/mintoolkit/mint/pkg/app/master/app.go:15 +0x4c
main.main()
github.com/mintoolkit/mint/cmd/mint/main.go:15 +0x194
Specs:
$ docker-slim --version mint version darwin/arm64|Aurora|1.41.7|latest|latest
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with pkg/app/master/command/xray/handler.go at printImagePackage (line 891), then trace the heap operations in pkg/docker/dockerimage/topobjects.go, especially TopObjects.Less and List. Reproduce the failure with the provided docker-slim xray command and linux/amd64 image; done means the command completes without the nil-pointer panic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100