Skip to content

Add support for the Scudo sanitizer. #2717

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

Merged
merged 2 commits into from
May 15, 2020

Conversation

Lukasa
Copy link
Contributor

@Lukasa Lukasa commented Apr 29, 2020

The Swift PR swiftlang/swift#28538 adds support for the Scudo hardened
allocator to swiftc. This patch adds support for it to Swift Package
Manager, allowing the Package Manager to correctly plumb Scudo through
the entire build pipeline.

See the aforementioned PR for more discussion on the value of supporting
Scudo.

This is a back port of #2438 to the 5.3 release branch. @rballard, is there any chance of us getting this landed?

(cherry picked from commit 594ccaa)

@Lukasa
Copy link
Contributor Author

Lukasa commented Apr 29, 2020

@swift-ci please smoke test

Copy link
Contributor

@rballard rballard left a comment

Choose a reason for hiding this comment

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

Discussed out-of-band; we're going to avoid adding an integration test that could fail SwiftPM's tests if scudo isn't working properly, and instead just test SwiftPM's behavior w/r/t passing sanitizer flags. (There is a separate repo for swift integration tests). @Lukasa also realized that this test would fail nondeterministically due to the way scudo works. Going back to revise tests.

@Lukasa Lukasa force-pushed the cb-backport-scudo branch from 711345a to 3887a6c Compare May 12, 2020 12:25
@Lukasa
Copy link
Contributor Author

Lukasa commented May 12, 2020

@swift-ci please smoke test

@Lukasa
Copy link
Contributor Author

Lukasa commented May 12, 2020

@swift-ci please test

@Lukasa
Copy link
Contributor Author

Lukasa commented May 13, 2020

@rballard Ok, I think this is good for re-review. The Linux smoke test failed for what seems to be an unrelated reason, and the full test passed.

@Lukasa Lukasa requested a review from rballard May 13, 2020 09:10
Lukasa added 2 commits May 15, 2020 17:13
The Swift PR swiftlang/swift#28538 adds support for the Scudo hardened
allocator to swiftc. This patch adds support for it to Swift Package
Manager, allowing the Package Manager to correctly plumb Scudo through
the entire build pipeline.

See the aforementioned PR for more discussion on the value of supporting
Scudo.

(cherry picked from commit 594ccaa)
The current tests for sanitizers in SwiftPM are essentially "live": they
build a package that will do something to trigger a sanitizer, and then
run it and confirm it fails. This is a pretty fragile way to test, and
it exposes SwiftPM to a number of possible test failures that don't
have anything to do with the core mission (exposing the sanitizer).

This patch replaces those tests with build plan tests that validate that
SwiftPM correctly invokes swiftc and clang. These tests are acceptable
because for now SwiftPM doesn't have any smarts with the sanitizers: it
just passes them all through to swiftc and clang.

This patch also deletes the current live tests, as they are no longer
necessary.

(cherry picked from commit 984618b)
@Lukasa Lukasa force-pushed the cb-backport-scudo branch from 3887a6c to 6aa8075 Compare May 15, 2020 16:14
@Lukasa
Copy link
Contributor Author

Lukasa commented May 15, 2020

@swift-ci please test

@Lukasa
Copy link
Contributor Author

Lukasa commented May 15, 2020

@swift-ci please smoke test

@Lukasa
Copy link
Contributor Author

Lukasa commented May 15, 2020

The linux platform failure is unrelated to this PR.

@Lukasa
Copy link
Contributor Author

Lukasa commented May 15, 2020

@swift-ci please smoke test

@Lukasa
Copy link
Contributor Author

Lukasa commented May 15, 2020

@swift-ci please test

Copy link
Contributor

@rballard rballard left a comment

Choose a reason for hiding this comment

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

Indeed the test failure looks unrelated. Changes are good to take; thank you!

@rballard rballard merged commit 3b65599 into swiftlang:release/5.3 May 15, 2020
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