Uh oh!
There was an error while loading. Please reload this page.
Re-enable ASAN when building with clang - #4013
Conversation
Detected a use-after-free :-) See: |
darosior
commented
Sep 7, 2020
Special-cased it too as (it's a well-known race and) i don't see how we could prevent it. |
rustyrussell
commented
Sep 8, 2020
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). |
darosior
commented
Sep 8, 2020
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. |
darosior
commented
Sep 8, 2020
(Also for the record by "well-known" i meant the functionality race, so we might have expected the data race: that was nonsensical) |
darosior
commented
Sep 8, 2020
Travis really does not like the 100 nodes of test_funding_cancel_race under ASAN.. |
rustyrussell
commented
Sep 9, 2020
Hmm, if ASAN isn't going in, can you open a PR for the others? Be nice to have them in 0.9.1... |
darosior
commented
Sep 9, 2020
via email
Sure
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Le mercredi, septembre 9, 2020 1:19 PM, Rusty Russell <notifications@github.com> 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
3307d7fComparedarosior
commented
Sep 10, 2020
Trying only on the clang job now (for some reason the gcc ones produce errors..) |
cdecker
commented
Sep 19, 2020
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 <darosior@protonmail.com>Rebased on #4076 and moved the sanitizers suppressions in contrib/ |
rustyrussell
commented
Sep 22, 2020
Oh, can we have a Changelog-Added: build: clang build now supports |
rustyrussell
commented
Sep 22, 2020
Ack 9910e5f |
darosior
commented
Sep 22, 2020
Sure, but i doubt that Travis is going to pass anyways :/ (going to wait for it then amend) |
darosior
commented
Sep 22, 2020
Travis still ooms on |
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 <darosior@protonmail.com>
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.