Repository navigation
Conversation
cpu_features v0.10.1 (and v0.11.0) read the CPUID vendor strings through unaligned uint32_t casts in IsVendor/SetVendor, which UBSan reports as a misaligned load from GetX86Info. Upstream fixed it with memcpy in google/cpu_features#458, which is not in any release yet, so pin that commit. The public API delta from v0.10.1 is additive only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Closing: VecSim now lives in RediSearch under |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1127 +/- ##
==========================================
- Coverage 97.56% 97.54% -0.02%
==========================================
Files 157 157
Lines 10019 10019
==========================================
- Hits 9775 9773 -2
- Misses 244 246 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Describe the changes in the pull request
cpu_featuresv0.10.1 reads the CPUID vendor strings inIsVendor/SetVendorby castingconst char*touint32_t*. The strings are not 4-byte aligned, so an UBSan build stops inGetX86Info(reached from every*_GetDistFunc) with:This blocks clean UBSan runs of anything that links VecSim. Upstream fixed it with
memcpyin google/cpu_features#458. That fix is not in any release yet (v0.11.0 still has the casts), so this PR pins the fix commita1c8a2fcand leaves a note to move to v0.12.0 once it is released.Going from v0.10.1 to
a1c8a2fconly adds to the public API: an aarch64poebit and theINTEL_LNL/INTEL_ARL/AMD_ZEN5microarchitecture enums. VecSim only callsGetX86Info/GetAarch64Infoand reads feature bits.Verification (x86, Release
-O3 -fsanitize=undefined -fno-sanitize-recover=all, alignment checking on): a small program calling onlyGetX86Info, built through thiscmake/cpu_features.cmake:a1c8a2fc: exit 0, no UBSan reportsWhich issues this PR fixes
IsVendorgoogle/cpu_features#456, Undefined Behavior (Alignment Error) inSetVendorgoogle/cpu_features#457 (upstream reports)Main objects this PR modified
cmake/cpu_features.cmake:GIT_TAGv0.10.1 →a1c8a2fcf49d534799b966c63e0b2124cd2f60aeMark if applicable
🤖 Generated with Claude Code
Note
Low Risk
Single CMake dependency pin change with a targeted upstream bugfix; VecSim continues to use only existing feature-detection entry points.
Overview
Updates the FetchContent pin for
google/cpu_featuresincmake/cpu_features.cmakefrom v0.10.1 to commita1c8a2fcf49d534799b966c63e0b2124cd2f60ae, with comments noting this is v0.11.0 plus upstream #458 (fixes misaligned loads inIsVendor/SetVendorthat break UBSan inGetX86Info) and a reminder to switch to v0.12.0 when released.This unblocks undefined-behavior sanitizer builds of VecSim code paths that detect CPU features via
GetX86Info/GetAarch64Info; the dependency bump only adds minor new public API surface (extra aarch64/x86 enums) beyond what VecSim currently reads.Reviewed by Cursor Bugbot for commit 7b869cc. Bugbot is set up for automated code reviews on this repo. Configure here.