Add ASan Travis build.
tests: Add AddressSanitizer (ASan) Travis build #14794
pull practicalswift wants to merge 3 commits into bitcoin:master from practicalswift:asan-in-travis changing 5 files +23 −6-
practicalswift commented at 3:51 PM on November 23, 2018: contributor
-
in .travis.yml:105 in 99aa5fd0c8 outdated
101 | @@ -102,6 +102,16 @@ jobs: 102 | RUN_FUNCTIONAL_TESTS=false # Disabled for now. TODO identify suppressions or exclude specific tests 103 | GOAL="install" 104 | BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER --with-sanitizers=thread --disable-hardening --disable-asm CC=clang CXX=clang++" 105 | +# x86_64 Linux (xenial, no depends, only system libs, sanitizers: address (ASAN))
MarcoFalke commented at 7:02 PM on November 23, 2018:Could this be combined with the bionic sanitizer build below instead (assuming that the functional tests pass)?
fanquake added the label Tests on Nov 23, 2018sipa commented at 12:31 PM on November 24, 2018: memberAny reason to not enable ASan and UBSan in the same test?
practicalswift force-pushed on Nov 25, 2018practicalswift force-pushed on Nov 25, 2018practicalswift force-pushed on Nov 25, 2018in test/functional/p2p_invalid_messages.py:73 in 38bff2be99 outdated
66 | @@ -66,7 +67,10 @@ def run_test(self): 67 | msg_at_size = msg_unrecognized("b" * valid_data_limit) 68 | assert len(msg_at_size.serialize()) == msg_limit 69 | 70 | - with node.assert_memory_usage_stable(perc_increase_allowed=0.03): 71 | + perc_increase_allowed = 0.03 72 | + if [s for s in os.environ.get("BITCOIN_CONFIG", "").split(" ") if "--with-sanitizers" in s and "address" in s]: 73 | + perc_increase_allowed = 3.5 74 | + with node.assert_memory_usage_stable(perc_increase_allowed=perc_increase_allowed):
MarcoFalke commented at 10:50 PM on November 25, 2018:I think the test fails unrelated to the sanitizer?
practicalswift commented at 10:55 PM on November 25, 2018:I'm not so sure about that: could it be that this failure is intermittent without ASan and consistent with ASan? :-) It appears to be consistently triggered under ASan for me.
in .travis/test_04_install.sh:10 in 38bff2be99 outdated
6 | @@ -7,9 +7,10 @@ 7 | export LC_ALL=C.UTF-8 8 | 9 | travis_retry docker pull "$DOCKER_NAME_TAG" 10 | +export ASAN_OPTIONS="leak_check_at_exit=0"
MarcoFalke commented at 10:52 PM on November 25, 2018:Could only suppress these for the gui and wallet?
practicalswift force-pushed on Nov 25, 2018practicalswift force-pushed on Nov 25, 2018practicalswift force-pushed on Nov 25, 2018practicalswift force-pushed on Nov 25, 2018practicalswift force-pushed on Nov 26, 2018practicalswift force-pushed on Nov 26, 2018practicalswift force-pushed on Nov 26, 2018practicalswift renamed this:[wip] Add ASan Travis build
Add ASan Travis build
on Nov 26, 2018practicalswift commented at 1:37 PM on November 26, 2018: contributor@sipa I was afraid the combined runtime would be too long, but it appears to work. The two Travis jobs have now been merged. Please review. @MarcoFalke Now running also with LSan (LeakSanitizer). Please review :-)
MarcoFalke commented at 4:30 PM on November 26, 2018: memberCould squash everything except the changes in test/functional?
practicalswift renamed this:Add ASan Travis build
Add AddressSanitizer (ASan) Travis build
on Nov 26, 2018practicalswift force-pushed on Nov 26, 2018practicalswift commented at 4:48 PM on November 26, 2018: contributor@MarcoFalke Done! Please re-review :-)
in test/sanitizer_suppressions/lsan:2 in 20a67691d1 outdated
0 | @@ -0,0 +1,7 @@ 1 | +leak:addCoin
MarcoFalke commented at 5:00 PM on November 26, 2018:Could add a commit with some documentation about those (see my tsan file in this folder for example):
addCoinis some bench test that doesn't primarily care about leaks.- The lib* ones are likely upstream false-positives
- ...
MarcoFalke approvedMarcoFalke renamed this:Add AddressSanitizer (ASan) Travis build
tests: Add AddressSanitizer (ASan) Travis build
on Nov 26, 2018practicalswift commented at 9:07 PM on November 26, 2018: contributor@MarcoFalke Added comments as suggested. Please re-review :-)
practicalswift force-pushed on Nov 26, 2018Make test p2p_invalid_messages.py pass: Allow for expected Travis ASAN memory increase ebd3bf2590Add ASan Travis build ff7212ec32practicalswift force-pushed on Nov 26, 2018in test/sanitizer_suppressions/lsan:10 in 3f9b8243d7 outdated
5 | +leak:libcrypto 6 | +leak:libqminimal 7 | +leak:libQt5Core 8 | +leak:libQt5Gui 9 | +leak:libQt5Widgets 10 | +leak:new_allocator.h
MarcoFalke commented at 9:22 PM on November 26, 2018:Should suppress the specific benchmark where this is happening, not the gcc internal
practicalswift commented at 9:53 PM on November 26, 2018:This is the output I'm getting:
$ ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-6.0/bin/llvm-symbolizer ASAN_OPTIONS="" LSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/lsan" src/bench/bench_bitcoin -evals=1 -scaling=0 # Benchmark, evals, iterations, total, min, max, median … ================================================================= ==890==ERROR: LeakSanitizer: detected memory leaks Indirect leak of 40040 byte(s) in 1001 object(s) allocated from: [#0](/bitcoin-bitcoin/0/) 0x535d60 in operator new(unsigned long) (/…/bitcoin/src/bench/bench_bitcoin+0x535d60) [#1](/bitcoin-bitcoin/1/) 0x5cd895 in __gnu_cxx::new_allocator<CTxOut>::allocate(unsigned long, void const*) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/ext/new_allocator.h:111:27 [#2](/bitcoin-bitcoin/2/) 0x5cd895 in std::allocator_traits<std::allocator<CTxOut> >::allocate(std::allocator<CTxOut>&, unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/alloc_traits.h:436 [#3](/bitcoin-bitcoin/3/) 0x5cd895 in std::_Vector_base<CTxOut, std::allocator<CTxOut> >::_M_allocate(unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_vector.h:172 [#4](/bitcoin-bitcoin/4/) 0x5cd895 in std::vector<CTxOut, std::allocator<CTxOut> >::_M_default_append(unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/vector.tcc:571 ----------------------------------------------------- Suppressions used: count bytes template 2002 392392 addCoin ----------------------------------------------------- SUMMARY: AddressSanitizer: 40040 byte(s) leaked in 1001 allocation(s).Note the absence of the benchmark name in the symbolized stack trace.
practicalswift commented at 10:02 PM on November 26, 2018:I've now adjusted the suppressions file. Now using
leak:__gnu_cxx::new_allocator<CTxOut>::allocatewhich is a bit more specific. Please re-review :-)
MarcoFalke commented at 10:09 PM on November 26, 2018:Would
leak:src/benchwork?
practicalswift commented at 10:32 PM on November 26, 2018:Updated. Please re-review! :-)
MarcoFalke dismissedpracticalswift force-pushed on Nov 26, 2018practicalswift force-pushed on Nov 26, 2018Add LSan suppression warnings 6541d59ddcpracticalswift force-pushed on Nov 26, 2018MarcoFalke merged this on Nov 27, 2018MarcoFalke closed this on Nov 27, 2018MarcoFalke referenced this in commit 600b85bb41 on Nov 27, 2018deadalnix referenced this in commit a382f87da6 on May 21, 2020MarcoFalke referenced this in commit 7027c67cac on Jul 2, 2020ftrader referenced this in commit ab6e90f067 on Aug 17, 2020practicalswift deleted the branch on Apr 10, 2021kittywhiskers referenced this in commit fcdea84cce on Aug 5, 2021kittywhiskers referenced this in commit 8792cbb540 on Aug 5, 2021kittywhiskers referenced this in commit a5f8a41bbc on Aug 12, 2021kittywhiskers referenced this in commit 27a667e91a on Aug 22, 2021kittywhiskers referenced this in commit c6b107e8d9 on Aug 30, 2021vijaydasmp referenced this in commit 32a14213f2 on Sep 24, 2021vijaydasmp referenced this in commit 549d38d943 on Sep 25, 2021vijaydasmp referenced this in commit 7a1683891d on Sep 25, 2021vijaydasmp referenced this in commit c76671d664 on Sep 27, 2021vijaydasmp referenced this in commit 77ddb4b4ac on Sep 28, 2021vijaydasmp referenced this in commit 075c93be11 on Sep 28, 2021vijaydasmp referenced this in commit 8f513ef90d on Sep 30, 2021vijaydasmp referenced this in commit 007d993084 on Oct 1, 2021vijaydasmp referenced this in commit 8b879c0c9f on Oct 1, 2021vijaydasmp referenced this in commit 3d9ac56e04 on Oct 2, 2021vijaydasmp referenced this in commit 0a5485a9a4 on Oct 2, 2021vijaydasmp referenced this in commit dfa262c93f on Oct 4, 2021Munkybooty referenced this in commit 4a8fed46d2 on Dec 28, 2021Munkybooty referenced this in commit 787b098c05 on Dec 28, 2021Munkybooty referenced this in commit ef37894012 on Dec 28, 2021Munkybooty referenced this in commit 4a1ded4a10 on Dec 28, 2021Munkybooty referenced this in commit d63f010db6 on Dec 28, 2021Munkybooty referenced this in commit 6a9b1e88a7 on Jan 3, 2022Munkybooty referenced this in commit b58970ab1d on Feb 1, 2022Munkybooty referenced this in commit eb1ddaf832 on Feb 16, 2022Munkybooty referenced this in commit 3a2135f171 on Feb 24, 2022Munkybooty referenced this in commit 1bed846dc3 on Feb 24, 2022Munkybooty referenced this in commit e7efb9482b on Mar 6, 2022Munkybooty referenced this in commit 99ef216933 on Mar 20, 2022kittywhiskers referenced this in commit 8b6ae1eb59 on Mar 25, 2022kittywhiskers referenced this in commit 274d35dfb6 on Apr 7, 2022Munkybooty referenced this in commit 81578b35ee on Apr 21, 2022Munkybooty referenced this in commit b03cd828bf on Apr 26, 2022Munkybooty referenced this in commit b3ceb1ae47 on Apr 29, 2022Munkybooty referenced this in commit 10d3657d25 on May 10, 2022Munkybooty referenced this in commit 6b2a408890 on May 12, 2022Munkybooty referenced this in commit bf18695b42 on May 12, 2022Munkybooty referenced this in commit f6ddf04345 on May 17, 2022Munkybooty referenced this in commit 22ae9fde91 on May 23, 2022kittywhiskers referenced this in commit 0730f629bb on Jun 22, 2022kittywhiskers referenced this in commit e22b5b7a5f on Jul 1, 2022UdjinM6 referenced this in commit ef8cf4bfea on Jul 2, 2022DrahtBot locked this on Aug 18, 2022
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 18:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me