Repository navigation
Conversation
When n = 2*Nint < 8, the bound (n >= 8 ? n - 8 : -1) is converted to size_t, so that -1 becomes SIZE_MAX and the loop reads out of bounds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Segmentation fault in
get_excitation_degree_con AVX-512 machinesIn the AVX-512 path, the loop bound is
nandiaresize_t, so forn = 2*Nint < 8(Nint < 4) the-1is converted toSIZE_MAX: the loop never ends and reads out of bounds. The remainder is already handled by the masked operation after the loop, so the bound can be writteni + 8 <= n.Found when running on Intel Xeon 6952P nodes (GCC 12.3,
-march=native) withNint = 2: segmentation fault inget_excitation_degree_c, called byi_H_j.Check with a small test program on that machine (GCC 12.3,
-O2 -march=native), comparing with a scalar popcount forNint= 1 to 12 and 2000 random pairs each: the current code crashes, the fixed code gives no error in 24000 comparisons. The full test suite was not run.🤖 Generated with Claude Code