Skip to content

build: add support to build with sanitization #287

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 1 commit into from
Aug 2, 2017

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Jul 29, 2017

Add support to configure the build to use sanitizers to aid in finding
issues. The DISPATCH_USE_SANIZITERS is a cmake option that defaults
to none, but can be one of Address, Memory, MemoryWithOrigins,
Undefined, Leaks, Address;Undefined. This allows for easily building
libdispatch and the tests with the sanitizers.

@compnerd
Copy link
Member Author

CC: @das @dgrove-oss

@compnerd
Copy link
Member Author

compnerd commented Aug 1, 2017

Since I put this up on a weekend, a gentle ping during the work week!

@das
Copy link
Contributor

das commented Aug 1, 2017

out of interest, do the sanitizers actually work with libdispatch on Linux ?

on Darwin, they depend on layers of the OS layered above libdispatch (or entangled with it) so we cannot use them for libdispatch at present

probably means you want to conditionalize this for linux

@compnerd
Copy link
Member Author

compnerd commented Aug 1, 2017

Yeah, I was able to build with them on Linux. I can certainly add a limitation to only allow them on Linux.

@das
Copy link
Contributor

das commented Aug 1, 2017

but do they run? (the problem on Darwin is not at build time FWIW)

Add support to configure the build to use sanitizers to aid in finding
issues.  The `DISPATCH_USE_SANIZITERS` is a cmake option that defaults
to none, but can be one of `Address, Memory, MemoryWithOrigins,
Undefined, Leaks, Address;Undefined`.  This allows for easily building
libdispatch and the tests with the sanitizers.
@compnerd
Copy link
Member Author

compnerd commented Aug 1, 2017

Yes, it did run as well for me :-). Helped find that div-by-zero bug in the test!

@das
Copy link
Contributor

das commented Aug 2, 2017

awesome!

@das das merged commit 80dd736 into swiftlang:master Aug 2, 2017
ktopley-apple pushed a commit that referenced this pull request Dec 6, 2018
build: add support to build with sanitization

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
@compnerd compnerd deleted the sanitize branch February 15, 2020 19:39
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