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

PackageFromDirectory segfault #308

Closed
howardjohn opened this issue Jun 23, 2023 · 2 comments · Fixed by #312
Closed

PackageFromDirectory segfault #308

howardjohn opened this issue Jun 23, 2023 · 2 comments · Fixed by #312
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@howardjohn
Copy link

We seemed to get a flake in the bom generation in one of our runs:

https://prow.istio.io/view/gs/istio-prow/logs/release_istio_postsubmit/1672283647324983296

2023-06-23T17:00:38.941316Z	info	Running command: bom --log-level error generate --name Istio Source 1.19-alpha.e472f349a52e8721616b3863831b0c30485715f2 --namespace https://storage.googleapis.com/istio-release/releases/1.19-alpha.e472f349a52e8721616b3863831b0c30485715f2/istio-source.spdx --dirs /tmp/tmp.tyao4dBCD0/build/work/src/istio.io/istio --output /tmp/tmp.tyao4dBCD0/build/out/istio-source.spdx
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0x8bcb58]
goroutine 1129 [running]:
sigs.k8s.io/bom/pkg/spdx.(*spdxDefaultImplementation).PackageFromDirectory.func1({0xc0002c4d00, 0x33}, 0xc0016b0680)
	/tmp/go/pkg/mod/sigs.k8s.io/bom@v0.5.1/pkg/spdx/implementation.go:1032 +0x378
created by sigs.k8s.io/bom/pkg/spdx.(*spdxDefaultImplementation).PackageFromDirectory
	/tmp/go/pkg/mod/sigs.k8s.io/bom@v0.5.1/pkg/spdx/implementation.go:1047 +0x995
Error: failed to build: failed to generate sbom: couldn't generate sbom for istio source: exit status 2

As far as I can tell there is nothing special about this specific run, so I am not sure why its failing now.

@howardjohn
Copy link
Author

Huh. no clue how this can happen:

f.LicenseConcluded = lic.LicenseID

lic is not nil per L1028 and f is not nil per L1027

@puerco puerco added the kind/bug Categorizes issue or PR as related to a bug. label Jul 5, 2023
@puerco
Copy link
Member

puerco commented Jul 5, 2023

Mmh it looks like a combo of scope creep and and a race conditions. I'll try a fix.

Thanks for the report @howardjohn !
/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants