Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.88.0 - runtime error: index out of range [0] #2073

Closed
blacktop opened this issue Aug 28, 2023 · 1 comment · Fixed by #2078
Closed

v0.88.0 - runtime error: index out of range [0] #2073

blacktop opened this issue Aug 28, 2023 · 1 comment · Fixed by #2078
Assignees
Labels
bug Something isn't working good-first-issue Good for newcomers

Comments

@blacktop
Copy link

blacktop commented Aug 28, 2023

What happened:
Trying to run my goreleaser pipeline after updating syft it fails with:

  ⨯ release failed after 1m17s               error=cataloging artifacts: syft failed: exit status 1: 2023/08/27 14:12:42 error during command execution: 1 error occurred:
	* runtime error: index out of range [0] with length 0 at:
goroutine 41 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:24 +0x64
github.com/anchore/syft/syft/pkg/cataloger.runCataloger.func1()
	github.com/anchore/syft/syft/pkg/cataloger/catalog.go:57 +0x3c
panic({0x1045a52e0?, 0x140009ce270?})
	runtime/panic.go:914 +0x218
github.com/anchore/syft/syft/pkg/cataloger/golang.(*goBinaryCataloger).parseGoBinary(0x59?, {0x104654088, 0x14000850090}, 0x0?, {{{{{...}, {...}}, {0x0, 0x0}, {0xc3, {...}}}, ...}, ...})
	github.com/anchore/syft/syft/pkg/cataloger/golang/parse_go_binary.go:64 +0x2b0
github.com/anchore/syft/syft/pkg/cataloger/generic.(*Cataloger).Catalog(0x1400148f920, {0x104654088, 0x14000850090})
	github.com/anchore/syft/syft/pkg/cataloger/generic/cataloger.go:129 +0x62c
github.com/anchore/syft/syft/pkg/cataloger/golang.(*progressingCataloger).Catalog(0x140004a9c20?, {0x104654088?, 0x14000850090?})
	github.com/anchore/syft/syft/pkg/cataloger/golang/cataloger.go:50 +0x70
github.com/anchore/syft/syft/pkg/cataloger.runCataloger({0x104647578, 0x14000288810}, {0x104654088?, 0x14000850090})
	github.com/anchore/syft/syft/pkg/cataloger/catalog.go:65 +0x184
github.com/anchore/syft/syft/pkg/cataloger.Catalog.func1()
	github.com/anchore/syft/syft/pkg/cataloger/catalog.go:146 +0xc8
created by github.com/anchore/syft/syft/pkg/cataloger.Catalog in goroutine 135
	github.com/anchore/syft/syft/pkg/cataloger/catalog.go:141 +0x298

What you expected to happen:
Work perfectly like it always does

Steps to reproduce the issue:

git clone https://github.com/blacktop/ipsw.git
cd ipsw
make build-deps
make snapshot

Anything else we need to know?:
Part of my pipeline that uses syft

https://github.com/blacktop/ipsw/blob/master/.goreleaser.yml#L490

Environment:

  • Output of syft version:
- ❯ syft version
Application:        syft
Version:            0.88.0
JsonSchemaVersion:  10.0.1
BuildDate:          2023-08-25T20:45:04Z
GitCommit:          Homebrew
GitDescription:     [not provided]
Platform:           darwin/arm64
GoVersion:          go1.21.0
Compiler:           gc
  • OS (e.g: cat /etc/os-release or similar):
macOS14beta6
@blacktop blacktop added the bug Something isn't working label Aug 28, 2023
@willmurphyscode willmurphyscode self-assigned this Aug 29, 2023
@kzantow kzantow added the good-first-issue Good for newcomers label Aug 29, 2023
@kzantow kzantow moved this to Backlog in OSS Aug 29, 2023
@willmurphyscode
Copy link
Contributor

willmurphyscode commented Aug 29, 2023

Hi @blacktop thanks very much for the bug report. We are actively working on a fix.

Here's a shorter repro:

wget https://github.com/blacktop/ipsw/releases/download/v3.1.383/ipsw_3.1.383_macOS_universal.tar.gz
syft ipsw_3.1.383_macOS_universal.tar.gz

produces:

No packages discovered
2023/08/29 15:39:49 error during command execution: 1 error occurred:
	* runtime error: index out of range [0] with length 0 at:
goroutine 120 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:24 +0x64
github.com/anchore/syft/syft/pkg/cataloger.runCataloger.func1()
	github.com/anchore/syft/syft/pkg/cataloger/catalog.go:57 +0x3c
panic({0x10228d2e0?, 0x14000a438f0?})
	runtime/panic.go:914 +0x218
github.com/anchore/syft/syft/pkg/cataloger/golang.(*goBinaryCataloger).parseGoBinary(0x59?, {0x10233c088, 0x14000113200}, 0x0?, {{{{{...}, {...}}, {0x0, 0x0}, {0xc, {...}}}, ...}, ...})
	github.com/anchore/syft/syft/pkg/cataloger/golang/parse_go_binary.go:64 +0x2b0
github.com/anchore/syft/syft/pkg/cataloger/generic.(*Cataloger).Catalog(0x14000410210, {0x10233c088, 0x14000113200})
	github.com/anchore/syft/syft/pkg/cataloger/generic/cataloger.go:129 +0x62c
github.com/anchore/syft/syft/pkg/cataloger/golang.(*progressingCataloger).Catalog(0x14000447a60?, {0x10233c088?, 0x14000113200?})
	github.com/anchore/syft/syft/pkg/cataloger/golang/cataloger.go:50 +0x70
github.com/anchore/syft/syft/pkg/cataloger.runCataloger({0x10232f578, 0x140006d6fa0}, {0x10233c088?, 0x14000113200})
	github.com/anchore/syft/syft/pkg/cataloger/catalog.go:65 +0x184
github.com/anchore/syft/syft/pkg/cataloger.Catalog.func1()
	github.com/anchore/syft/syft/pkg/cataloger/catalog.go:146 +0xc8
created by github.com/anchore/syft/syft/pkg/cataloger.Catalog in goroutine 118
	github.com/anchore/syft/syft/pkg/cataloger/catalog.go:141 +0x298

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good-first-issue Good for newcomers
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants