Skip to content

Adopt sanitizers from @score_cpp_policies#182

Open
RSingh1511 wants to merge 5 commits intoeclipse-score:mainfrom
RSingh1511:rs/swp-249901
Open

Adopt sanitizers from @score_cpp_policies#182
RSingh1511 wants to merge 5 commits intoeclipse-score:mainfrom
RSingh1511:rs/swp-249901

Conversation

@RSingh1511
Copy link

No description provided.

cc_test(
name = "tsan_fail_data_race",
srcs = ["tsan_fail_data_race.cpp"],
# Re-package suppressions from @score_cpp_policies for integration testing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why re-package here?
OK in case the repo has its own suppressions..?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-packaging is needed for integration tests running in Docker so the suppression files from @score_cpp_policies are available at /sanitizers/suppressions/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a way to specify our suppressions in this repository. There might be some that can be centralized (stdlib ones for example) but we will likely have some here that are exlusive to this repository.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added repo-specific suppression files that merge with centralized ones from @score_cpp_policies in integration tests

test:tsan --linkopt -fsanitize-link-c++-runtime
test:tsan --platform_suffix=tsan
test:tsan --cxxopt=-O1
test:tsan --test_tag_filters=-no-tsan
Copy link
Contributor

@LittleHuba LittleHuba Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should decide on one way:
Either tagging or target_compatible_with.

I prefer the latter since it is more expressive in the targets and is not susceptible to typos.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. replaced all --test_tag_filters in .bazelrc with target_compatible_with

@RSingh1511 RSingh1511 requested a review from LittleHuba March 25, 2026 11:29
@RSingh1511 RSingh1511 force-pushed the rs/swp-249901 branch 2 times, most recently from 5be026d to 6372e0a Compare March 25, 2026 12:02
test:tsan --linkopt -fsanitize=thread
test:tsan --linkopt -fsanitize-link-c++-runtime
test:tsan --platform_suffix=tsan
test:tsan --cxxopt=-O1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also go to the central feature. It is a recommended setting of Clang for ThreadSanitizer runs.
See usage section here: https://clang.llvm.org/docs/ThreadSanitizer.html

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment on lines +18 to 20
# Debug symbols for sanitizer stack traces
test:with_debug_symbols --cxxopt=-g1
test:with_debug_symbols --strip=never
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also go to the central cc_feature.
Without this sanitizer outputs are without symbol resolution. Debugging is then nearly impossible.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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.

3 participants