feat(c++): add sanitizer configuration in bazel build and CI#3458
Open
BaldDemian wants to merge 1 commit intoapache:mainfrom
Open
feat(c++): add sanitizer configuration in bazel build and CI#3458BaldDemian wants to merge 1 commit intoapache:mainfrom
BaldDemian wants to merge 1 commit intoapache:mainfrom
Conversation
Author
|
Results Local testing:
CI testing: |
Author
|
This sole failed CI job seems to be a network issue 🤔. It passed in my local fork, so simply rerunning it may solve the problem. |
Contributor
pushing an empty commit would re-run the ci, try |
Author
|
After some investigation, I can confirm that the misaligned address access UB mentioned above is caused by the way Lines 885 to 892 in ed586af In this method, int16 requires 2 byte alignment, but reinterpret_cast cannot guarantee or check this requirement.I am preparing a PR to fix this issue. |
2 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.
Why?
Close #1203
What does this PR do?
Add ASan and UBSan integration in
.bazelrc.I noticed that directly running
bazel test $(bazel query //cpp/...)triggers compilation errors because the--config=x86_64flag is not provided. In the new CI Python scriptrun_ci.py, thecpp.pytask invoked by it indeed contains a check for this flag:fory/ci/tasks/cpp.py
Lines 40 to 41 in af6e8b2
The
run_ci.shscript does not contain this check. Although this script appears to no longer be used, I still added the corresponding flag check there.Similarly, I also added documentation about this flag in
AGENTS.md.In
ci.yml, I added a new job to enable tests with sanitizers in CI. Currently, this job only runs on ubuntu-latest.Related issues
#1203
Benchmark
I believe this feature only introduces extra burden during testing.