-
Notifications
You must be signed in to change notification settings - Fork 25
Add tsan sanitizer #236
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
Open
VukPavicRTRK
wants to merge
14
commits into
eclipse-score:main
Choose a base branch
from
VukPavicRTRK:issue-50-tsan-sanitizer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add tsan sanitizer #236
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a06a471
Implement sanitizers from score_cpp_policies
VukPavicRTRK 2feb0b8
Merge branch 'main' into issue-50-use-sanitizers
VukPavicRTRK b3d06a8
fix: sanitizers failing in ci
VukPavicRTRK 38739cc
Use score_cpp_policies release
VukPavicRTRK 253a46c
fix: bazel dependency issue
VukPavicRTRK fafa305
Merge branch 'main' into issue-50-use-sanitizers
VukPavicRTRK 9f26999
fix: update README
VukPavicRTRK d25d533
fix: update tests for sanitizers
VukPavicRTRK c0c3796
merge main into issue-50-tsan-sanitizer
VukPavicRTRK 4194399
merge main into issue-50-tsan-sanitizer
VukPavicRTRK ca8fe6f
fix: tsan ASLR
VukPavicRTRK 0f203e1
Merge branch 'main' into issue-50-tsan-sanitizer
VukPavicRTRK 283b892
Merge branch 'main' into issue-50-tsan-sanitizer
NicolasFussberger caeb0e8
Merge branch 'main' into issue-50-tsan-sanitizer
VukPavicRTRK 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 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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
| load(":wrapper.bzl", "expand_executable_template") | ||
|
|
||
| expand_executable_template( | ||
| name = "tsan_setarch_wrapper_sh", | ||
| out = "tsan_setarch_wrapper.sh", | ||
| template = "tsan_setarch_wrapper.sh.tpl", | ||
| wrapper = "@score_cpp_policies//sanitizers:wrapper", | ||
| ) | ||
|
|
||
| sh_binary( | ||
| name = "tsan_setarch_wrapper", | ||
| srcs = [":tsan_setarch_wrapper_sh"], | ||
| data = [ | ||
| "@bazel_tools//tools/bash/runfiles", | ||
| "@score_cpp_policies//sanitizers:wrapper", | ||
| ], | ||
| target_compatible_with = ["@platforms//os:linux"], | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #!/usr/bin/env bash | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
| # --- begin runfiles.bash initialization v3 --- | ||
| set -uo pipefail | ||
| f=bazel_tools/tools/bash/runfiles/runfiles.bash | ||
| source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \ | ||
| source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \ | ||
| source "$0.runfiles/$f" 2>/dev/null || \ | ||
| source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ | ||
| source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ | ||
| { echo >&2 "ERROR: cannot find $f"; exit 1; }; f= | ||
| # --- end runfiles.bash initialization v3 --- | ||
|
|
||
| exec setarch "$(uname -m)" -R -- "$(rlocation %WRAPPER_RLOCATION%)" "$@" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
| """Generates an executable script from a template, with the runfiles path of | ||
| another executable target baked in as a substitution.""" | ||
|
|
||
| def _expand_executable_template_impl(ctx): | ||
| out = ctx.actions.declare_file(ctx.attr.out) | ||
| wrapper_label = ctx.attr.wrapper.label | ||
| ctx.actions.expand_template( | ||
| template = ctx.file.template, | ||
| output = out, | ||
| substitutions = { | ||
| "%WRAPPER_RLOCATION%": "{}/{}/{}".format( | ||
| wrapper_label.workspace_name, | ||
| wrapper_label.package, | ||
| wrapper_label.name, | ||
| ), | ||
| }, | ||
| is_executable = True, | ||
| ) | ||
| return [DefaultInfo(files = depset([out]))] | ||
|
|
||
| expand_executable_template = rule( | ||
| implementation = _expand_executable_template_impl, | ||
| attrs = { | ||
| "out": attr.string(mandatory = True), | ||
| "template": attr.label(allow_single_file = True, mandatory = True), | ||
| "wrapper": attr.label(mandatory = True), | ||
| }, | ||
| ) |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
I really appreciate your effort to narrow the scope of ASLR disabling just for the test run.
Does this binary need to be public or can this stay repo-private?