-
Notifications
You must be signed in to change notification settings - Fork 10
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
Simple test to do clang/asan builds on gz-utils #161
Closed
+77
−6
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
sh_binary( | ||
name = "asan", | ||
srcs = ["asan.sh"], | ||
data = ["asan.supp"], | ||
) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
me=$(python3 -c 'import os; print(os.path.realpath("'"$0"'"))') | ||
mydir=$(dirname "$me") | ||
export ASAN_OPTIONS="$ASAN_OPTIONS:check_initialization_order=1:detect_container_overflow=0:detect_invalid_pointer_pairs=1:detect_stack_use_after_return=1:strict_init_order=1:strict_string_checks=1:strip_path_prefix=/proc/self/cwd/:suppressions=$mydir/asan.supp" | ||
# LSan is run with ASan by default, ASAN_OPTIONS can't be used to suppress LSan | ||
# errors | ||
export LSAN_OPTIONS="$LSAN_OPTIONS:strip_path_prefix=/proc/self/cwd/:suppressions=$mydir/lsan.supp" | ||
# Ensure executable named llvm-symbolizer is on the PATH. | ||
export PATH="$PATH:/usr/lib/llvm-14/bin:/usr/lib/llvm-12/bin:/usr/local/opt/llvm/bin" | ||
"$@" |
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
common:clang --repo_env=CC=clang-15 | ||
common:clang --repo_env=CXX=clang++-15 | ||
build:clang --action_env=CC=clang-15 | ||
build:clang --action_env=CXX=clang++-15 | ||
build:clang --host_action_env=CC=clang-15 | ||
build:clang --host_action_env=CXX=clang++-15 | ||
|
||
### ASan build. Clang only. ### | ||
build:asan --build_tests_only | ||
build:asan --copt=-g | ||
# https://github.com/google/sanitizers/wiki/AddressSanitizer#faq | ||
build:asan --copt=-fno-common | ||
build:asan --copt=-fsanitize=address | ||
build:asan --copt=-fsanitize-address-use-after-scope | ||
build:asan --copt=-fstandalone-debug | ||
build:asan --copt=-O0 | ||
build:asan --copt=-fno-omit-frame-pointer | ||
build:asan --linkopt=-fsanitize=address | ||
build:asan --linkopt=-fsanitize-address-use-after-scope | ||
build:asan --run_under=//tools:asan | ||
build:asan --test_env=ASAN_OPTIONS | ||
build:asan --test_env=LSAN_OPTIONS | ||
build:asan --test_env=ASAN_SYMBOLIZER_PATH | ||
build:asan --test_env=LSAN_SYMBOLIZER_PATH | ||
# LSan is run with ASan by default | ||
build:asan --test_tag_filters=-gurobi,-mosek,-snopt,-no_asan,-no_lsan | ||
build:asan --test_lang_filters=-sh,-py | ||
# Typical slowdown introduced by AddressSanitizer is 2x. | ||
# See https://clang.llvm.org/docs/AddressSanitizer.html | ||
build:asan --test_timeout=150,750,2250,9000 # 2.5x | ||
build:asan --define=USING_SANITIZER=ON | ||
# Due to https://sourceware.org/bugzilla/show_bug.cgi?id=25975, we see ... | ||
# ld.gold: warning: Cannot export local symbol __asan_extra_spill_area | ||
# ... spammed millions of times in ASan builds. The only way to silence that | ||
# warning is to silence ALL WARNINGS AT ALL EVER in ASan builds. | ||
build:asan --auto_output_filter=all |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: consider adding a docstring on how this can be run locally
bazel run --config asan --config clang tools:asan
?