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

make: Add an option to compile with address sanitizer #2285

Merged
merged 1 commit into from
Feb 3, 2019

Conversation

cdecker
Copy link
Member

@cdecker cdecker commented Jan 21, 2019

Currently only works with gcc due to google/sanitizers#1028, so
configure makes sure we warn if clang with ASAN is attempted.

According to my benchmarks the performance degradation
is small enough to have it active always.

Would be nice to eventually get clang working as well, since it has some additional sanitizers, such as the memory sanitizer which guards uninitialized values.

Fixes #2277

Signed-off-by: Christian Decker decker.christian@gmail.com

@practicalswift
Copy link
Contributor

practicalswift commented Jan 21, 2019

Concept ACK

What ASAN runtime errors have you observed when running the tests? Perhaps we should add a suppressions file in order to be able to guard against new ones using a Travis ASAN job?

FWIW I managed to get the project to build under Clang 7's ASAN. Which Clang version did you test against?

From a configure perspective should ASAN and Valgrind be mutually exclusive options?

@cdecker
Copy link
Member Author

cdecker commented Jan 22, 2019

I'm using clang v6.0.0, so maybe they addressed it recently?

From a configure perspective should ASAN and Valgrind be mutually exclusive options?

I think they should be exclusive, yes. I'll amend to error out in case both are configured

What ASAN runtime errors have you observed when running the tests? Perhaps we should add a suppressions file in order to be able to guard against new ones using a Travis ASAN job?

I haven't observed any, which is motivating. I had to turn off at-exit leak detection though since there seems to be something there, but couldn't figure out what.

Currently only works with `gcc` due to google/sanitizers#1028, so
configure makes sure we warn if clang with ASAN is attempted.

According to [my benchmarks][benchmarks] the performance degradation
is small enough to have it active always.

[benchmarks]: #2277 (comment)

Signed-off-by: Christian Decker <decker.christian@gmail.com>
@cdecker
Copy link
Member Author

cdecker commented Jan 30, 2019

Ping @rustyrussell

Copy link
Contributor

@rustyrussell rustyrussell left a comment

Choose a reason for hiding this comment

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

Ack 3af00d5

@rustyrussell rustyrussell merged commit 7eaf5b5 into master Feb 3, 2019
@rustyrussell rustyrussell deleted the sanitizers branch August 15, 2022 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants