-
Notifications
You must be signed in to change notification settings - Fork 901
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
Re-enable ASAN when building with clang #4013
Conversation
Detected a use-after-free :-) See:
|
Special-cased it too as (it's a well-known race and) i don't see how we could prevent it. |
Woah, a well-known use-after free? That's not good! What's happening here? Looks like the cc should be owned by NULL, so that freeing the cmd doesn't destroy it. (we'll still get a memleak if the bcli plugin crashes, but hard to care). |
Spent half an hour writing about how i already tried this and this doesn't work, but actually you are right. Pushed a fix and removed the suppression. |
(Also for the record by "well-known" i meant the functionality race, so we might have expected the data race: that was nonsensical) |
Travis really does not like the 100 nodes of test_funding_cancel_race under ASAN.. |
Hmm, if ASAN isn't going in, can you open a PR for the others? Be nice to have them in 0.9.1... |
Sure
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Le mercredi, septembre 9, 2020 1:19 PM, Rusty Russell <[email protected]> a écrit :
… Hmm, if ASAN isn't going in, can you open a PR for the others? Be nice to have them in 0.9.1...
—
You are receiving this because you authored the thread.
Reply to this email directly, [view it on GitHub](#4013 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AFLK3F3TEEDXRJTI3L3QXKLSE5QC5ANCNFSM4Q6KQAFA).
|
d137f36
to
3307d7f
Compare
Trying only on the clang job now (for some reason the gcc ones produce errors..) |
Very nice, it'd be a major improvement to be able to run lightweight sanitizers in production ( However I wonder why the suppressions are located in |
clang did the hard work here: openingd/dualopend.c:958:42: error: result of comparison of constant 'WIRE_DUAL_OPEN_FAIL' (7003) with expression of type 'u8' (aka 'unsigned char') is always false [-Werror,-Wtautological-constant-out-of-range-compare] if ((msg_type = fromwire_peektype(msg)) == WIRE_DUAL_OPEN_FAIL) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~ Co-Authored-by: the clang compiler Signed-off-by: Antoine Poinsot <[email protected]>
3307d7f
to
9910e5f
Compare
Rebased on #4076 and moved the sanitizers suppressions in contrib/ |
Oh, can we have a Changelog-Added: build: clang build now supports |
Ack 9910e5f |
Sure, but i doubt that Travis is going to pass anyways :/ (going to wait for it then amend) |
Travis still ooms on |
9910e5f
to
43ca777
Compare
Added the Changelog line. diff --git a/.travis.yml b/.travis.yml
index 6fdf5d1b5..3ac97a873 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,7 +16,7 @@ env:
- ARCH=64 TEST_CMD="make check-source check-units installcheck" DEVELOPER=1 EXPERIMENTAL_FEATURES=1
# All of the following will just run `make pytest`
- - VALGRIND=0 ARCH=64 DEVELOPER=1 COMPILER=clang
+ - VALGRIND=0 ARCH=64 DEVELOPER=1 COMPILER=clang ASAN=1 LSAN_OPTIONS="suppressions=$PWD/contrib/sanitizer_suppressions/lsan"
- VALGRIND=0 ARCH=64 DEVELOPER=1 COMPILER=gcc
- VALGRIND=0 ARCH=64 DEVELOPER=0 COMPILER=gcc COMPAT=0 TEST_GROUP=1 TEST_GROUP_COUNT=2
- VALGRIND=0 ARCH=64 DEVELOPER=0 COMPILER=gcc COMPAT=0 TEST_GROUP=2 TEST_GROUP_COUNT=2 |
Prefer adding LSAN_OPTIONS="suppressions=$PWD/tests/sanitizer_suppressions/lsan" when CC=clang instead. Changelog-Added: build: clang build now supports --enable-address-sanitizer . Signed-off-by: Antoine Poinsot <[email protected]>
43ca777
to
ad06763
Compare
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.
Ack ad06763
I'm looking at including some fuzz targets, and will probably use clang along with its address sanitizer (and hopefully many others!).
This removes the restriction on only using gcc with ASAN, by using suppressions instead when using clang (see #2285 for the reason).
This also enables ASAN on non-already-under-valgrind Travis jobs.