Skip to content
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

Add optional sanitizer build configurations #185

Merged
merged 1 commit into from
Jul 15, 2023

Conversation

aaronmondal
Copy link
Member

@aaronmondal aaronmondal commented Jul 15, 2023

Detecting data races and memory issues in unsafe code can be difficult and time consuming.

To aid with this, add an optional nightly toolchain which exposes experimental -Zsanitizer flags. This lets us run builds and test with --config=asan and --config=tsan to enable AddressSanitizer and ThreadSanitizer. These sanitizers incur heavy performance penalties and shouldn't be enabled in production builds.

We can't enable these in CI yet, since ref_store_test fails under asan and all runtime tests fail under tsan.

The changed rust files fix issues that trigger nightly clippy.


This change is Reviewable

Detecting data races and memory issues in unsafe code can be difficult
and time consuming.

To aid with this, add an optional nightly toolchain which exposes
experimental `-Zsanitizer` flags. This lets us run builds and test with
`--config=asan` and `--config=tsan` to enable AddressSanitizer and
ThreadSanitizer. These sanitizers incur heavy performance penalties and
shouldn't be enabled in production builds.

We can't enable these in CI yet, since ref_store_test fails under asan
and all runtime tests fail under tsan.

The changed rust files fix issues that trigger nightly clippy.
Copy link
Member Author

@aaronmondal aaronmondal left a comment

Choose a reason for hiding this comment

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

@allada @chrisstaite-menlo FYI this doesn't enable MemorySanitizer because that would require everything to be sanitized (including C++ dependendcies). It does't enable LeakSanitizer because leak detection on amd64 is already enabled via asan and standalone lsan appears to be bugged and requires additional workarounds (rust-lang/rust#111073).

Reviewable status: 0 of 4 files reviewed, all discussions resolved

Copy link
Member

@allada allada left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @aaronmondal)

Copy link
Member

@allada allada left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @aaronmondal)

@aaronmondal aaronmondal merged commit a428e23 into TraceMachina:master Jul 15, 2023
@aaronmondal aaronmondal deleted the add-sanitizer-configs branch October 16, 2023 09:06
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.

2 participants