fix: remove race when writing errors in generic cataloger#3875
Merged
fix: remove race when writing errors in generic cataloger#3875
Conversation
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
kzantow
reviewed
May 9, 2025
kzantow
reviewed
May 9, 2025
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
kzantow
approved these changes
May 9, 2025
Contributor
kzantow
left a comment
There was a problem hiding this comment.
LGTM 👍 Thanks for jumping on this!
spiffcs
added a commit
that referenced
this pull request
May 13, 2025
* main: Translate Portage license strings to SPDX expressions (#1763) fix: stop emitting redis redis CPE for PHP PECL redis (#3881) feat: Add PURL list input/output format (#3853) chore(deps): update CPE dictionary index (#3877) chore(deps): update tools to latest versions (#3878) do not search binary contents for version for go package (#3874) fix: remove race when writing errors in generic cataloger (#3875) clear devel version for go packages (#3873) Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm seeing partial values referenced in the issue traceback and a nil dereference:
Which:
github.com/anchore/syft/internal/unknown.visitErrors({0x6168732f7273752f, 0x656e746f642f6572}, 0xc002f29d70)when decoded appears to beentod/erahs/rsu/, when flipped/usr/share/dotne, I don't think I should be seeing partial values herevisitErrors, it seems that the address of the error after type assertion is assigned out of band to 0 (which would not be possible without multiple concurrent writers)I think a reproduction without concurrent writers of this would be something akin to (but not exactly the same as what the traceback is):
The fix is to ensure that the errors being processed are only written within the
Collect()closure, and not to a variable on the stack of the caller.Type of change
Checklist