Skip to content
New issue

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

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

Already on GitHub? # to your account

Always return a cleanup function from scope #183

Merged
merged 1 commit into from
Sep 25, 2020
Merged

Conversation

wagoodman
Copy link
Contributor

Should prevent panics on malformed input to scope:

grype -vv -o json --fail-on medium dir://tests/python
[0000] DEBUG Application config:
configpath: ""
presenteropt: 1
output: json
scopeopt: 1
scope: Squashed
quiet: false
log:
  structured: false
  levelopt: debug
  level: ""
  filelocation: ""
clioptions:
  configpath: ""
  verbosity: 2
db:
  dir: /Users/alfredo/Library/Caches/grype/db
  updateurl: https://toolbox-data.anchore.io/grype/databases/listing.json
  autoupdate: true
dev:
  profilecpu: false
checkforappupdate: true
failon: medium
failonseverity: 3
[0000] DEBUG No new grype update available
[0000]  INFO cataloging image from-lib=syft
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1a1b756]
goroutine 16 [running]:
github.com/anchore/syft/syft.Catalog(0x7ffeefbff8e3, 0x12, 0x1, 0x0, 0x0, 0x0, 0x20a8ac0, 0xc00029d0a0)
	/Users/alfredo/go/pkg/mod/github.com/anchore/syft@v0.1.0-beta.4.0.20200925185305-576fbc898b98/syft/lib.go:37 +0x3d6
github.com/anchore/grype/cmd.startWorker.func1.2(0xc000225ee0, 0x7ffeefbff8e3, 0x12, 0xc0001402a0, 0xc0001402a8, 0xc0001402b0, 0xc0001e93d0, 0xc00010ab40)
	/Users/alfredo/python/grype/cmd/root.go:183 +0x82
created by github.com/anchore/grype/cmd.startWorker.func1
	/Users/alfredo/python/grype/cmd/root.go:181 +0x227`

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
@wagoodman wagoodman added the bug Something isn't working label Sep 25, 2020
@wagoodman wagoodman self-assigned this Sep 25, 2020
Copy link
Contributor

@luhring luhring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:khannnnnn:

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants