Repository navigation
fix(build): scope UBSAN flags to kvrocks targets and fix C flags typo - #3783
Open
zbyyehyehyeh wants to merge 1 commit into
Open
zbyyehyehyeh wants to merge 1 commit into
zbyyehyehyeh wants to merge 1 commit into
Conversation
|
Hi @zbyyehyehyeh, Thank you for your pull request. Please review our Contributing Guide. Please make sure you understand your changes and explain your reasoning in this pull request. Low-quality pull requests may be closed. |
zbyyehyehyeh
force-pushed
the
fix/ubsan-scope
branch
from
November 12, 2026 13:50
b5c08f1 to
50d7267
Compare
Contributor
Author
|
Responding to the checklist above.
|
6 of 13 tasks
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.
Closes #3781.
ENABLE_UBSANappends-fsanitize=undefinedto the globalCMAKE_CXX_FLAGS, and dependencies are pulled in viaFetchContent_MakeAvailableWithArgs(i.e.add_subdirectory), so theyinherit the flags and get instrumented too. Combined with
-fno-sanitize-recover=all, a single UB report in a vendored dependencyaborts the whole process: under GCC 13.4, rocksdb's
PerfStepTimertrips-fsanitize=nullon the firstSeek, so the server cannot serve a singleread (repro in #3781).
The CI UBSAN job is clang-only, so this GCC-only report has never been
caught.
This change keeps the sanitizer flags in a variable and applies them per
target, so kvrocks' own code stays instrumented while vendored
dependencies do not. ASan/TSan are intentionally left as-is (full
instrumentation): unlike UBSAN here, they can report and continue, and
kvrocks already has suppression files for them.
Also fixes a pre-existing typo in the GNU branch that built
CMAKE_C_FLAGSfrom${CMAKE_CXX_FLAGS}.Verified locally on GCC 13.4:
AI assistance
Produced with qwen3.7max. I reviewed every line and verified the build and startup locally.