slimtoolkit / slimtoolkit/slim
💣 Nil pointer dereference in xray/handler.go:1004 (v1.40.11 - linux/amd64)
Open
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.4k
- Forks
- 840
- PR merge metrics
- No merged PRs in 30d
Description
🔍 Details
Crash in master/command/xray/handler.go, line 1004
Command run: xray --target bitplane1/uh-halp-data-binaries:ubuntu-500-x86_64
Stack trace:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb8 pc=0x1a9b32a]
goroutine 1 [running]:
github.com/slimtoolkit/slim/pkg/app/master/command/xray.printImagePackage(0xc0006624c8, 0xc000641520, {0x0?, 0x0?}, {0x0?, 0x0?}, 0x0?, 0x0?, 0xc000612420, 0xffffffffffffffff, ...)
github.com/slimtoolkit/slim/pkg/app/master/command/xray/handler.go:1004 +0x6c6a
github.com/slimtoolkit/slim/pkg/app/master/command/xray.OnCommand(0xc0006624c8, 0xc00061c3f0, 0xc0006624e8, {_, _}, _, {_, _}, {0x0, 0x0}, ...)
github.com/slimtoolkit/slim/pkg/app/master/command/xray/handler.go:521 +0x32c8
github.com/slimtoolkit/slim/pkg/app/master/command/xray.glob..func1(0xc000694cc0)
github.com/slimtoolkit/slim/pkg/app/master/command/xray/cli.go:337 +0x1d98
github.com/urfave/cli/v2.(*Command).Run(0x33a8f00, 0xc000694cc0, {0xc0006122a0, 0x3, 0x3})
github.com/urfave/cli/v2@v2.27.1/command.go:279 +0x9dd
github.com/urfave/cli/v2.(*Command).Run(0xc000478420, 0xc000694740, {0xc000694680, 0x4, 0x4})
github.com/urfave/cli/v2@v2.27.1/command.go:272 +0xc2e
github.com/urfave/cli/v2.(*App).RunContext(0xc00025c200, {0x23470c8?, 0x341e0a0}, {0xc000694680, 0x4, 0x4})
github.com/urfave/cli/v2@v2.27.1/app.go:337 +0x5db
github.com/urfave/cli/v2.(*App).Run(...)
github.com/urfave/cli/v2@v2.27.1/app.go:311
github.com/slimtoolkit/slim/pkg/app/master/command.(*InteractiveApp).execute(0xc0006a2600, {0xc000a08140?, 0x1?})
github.com/slimtoolkit/slim/pkg/app/master/command/cliprompt.go:108 +0x37e
github.com/c-bata/go-prompt.(*Prompt).Run(0xc000696200)
github.com/c-bata/go-prompt@v0.2.3/prompt.go:85 +0x846
github.com/slimtoolkit/slim/pkg/app/master/command.(*InteractiveApp).Run(...)
github.com/slimtoolkit/slim/pkg/app/master/command/cliprompt.go:273
github.com/slimtoolkit/slim/pkg/app/master.newCLI.func4(0xc000694100?)
github.com/slimtoolkit/slim/pkg/app/master/cli.go:187 +0x45
github.com/urfave/cli/v2.(*Command).Run(0xc000478160, 0xc000694100, {0xc0000500a0, 0x1, 0x1})
github.com/urfave/cli/v2@v2.27.1/command.go:279 +0x9dd
github.com/urfave/cli/v2.(*App).RunContext(0xc00025c200, {0x23470c8?, 0x341e0a0}, {0xc0000500a0, 0x1, 0x1})
github.com/urfave/cli/v2@v2.27.1/app.go:337 +0x5db
github.com/urfave/cli/v2.(*App).Run(...)
github.com/urfave/cli/v2@v2.27.1/app.go:311
github.com/slimtoolkit/slim/pkg/app/master.Run()
github.com/slimtoolkit/slim/pkg/app/master/app.go:15 +0x45
main.main()
github.com/slimtoolkit/slim/cmd/slim/main.go:15 +0x187
👣 Steps
$ docker pull bitplane1/uh-halp-data-binaries:ubuntu-500-x86_64
$ slim
>>> xray --target bitplane1/uh-halp-data-binaries:ubuntu-500-x86_64
🕶️ Specs
$ slim --version
slim version linux/amd64|Transformer|1.40.11|1b271555882eacdfb4e6598d6d0552e9b9b1449b|2024-02-02_01:36:22PM
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 in pkg/app/master/command/xray/handler.go at printImagePackage line 1004, then trace the call from OnCommand. Reproduce with the documented Docker image and xray command, using the stack trace to inspect the nil value. Done means the command handles this target without a nil pointer panic and includes a regression test if the repository has a suitable test entry point.
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
- 35/100