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

Fix remaining UB sanitizer errors #2417

Merged
merged 5 commits into from
Nov 6, 2024
Merged

Conversation

brian-kelley
Copy link
Contributor

@brian-kelley brian-kelley commented Nov 6, 2024

Fix errors with ubsan. Now all tests pass in a configuration like the new ubuntu-asan-ubsan-ci build.

  • replaceSumInto tests: initialize bool atomic_ member
  • Fix some issues with create_reverse_map
    • Avoid shifting by negative number of bits (works in practice on tested architectures, but it's technically UB)
    • Use Kokkos::log2 to simplify an expression
    • Avoid computing log2(0)
    • Take out redundant fences
  • Graph coarsening: Initialize bool member of struct. If uninitialized, its memory can contain any 8-bit value, not just 0 or 1.
  • D2 coloring, VBBIT: fix color interval test. The forbidden colors considered at a time should be [color_offset, color_offset+64) with an exclusive upper bound. This matches the logic in VB.

Initialize bool member of struct. If uninitialized
its memory can contain any 8-bit value, not just 0 or 1.

Signed-off-by: Brian Kelley <[email protected]>
- Avoid shifting by negative number of bits
  - It works in practice on tested architectures but it's technically UB
- Use Kokkos::log2 to simplify an expression
- Avoid computing log2(0)
- Take out redundant fences

Signed-off-by: Brian Kelley <[email protected]>
Signed-off-by: Brian Kelley <[email protected]>
@brian-kelley brian-kelley requested a review from lucbv November 6, 2024 01:27
@brian-kelley brian-kelley self-assigned this Nov 6, 2024
@brian-kelley brian-kelley merged commit 043c4b4 into kokkos:develop Nov 6, 2024
20 of 21 checks passed
@brian-kelley brian-kelley deleted the FixUB branch November 6, 2024 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants