Run fuzz testing test cases (bitcoin-core/qa-assets) under valgrind.
This would have caught util: Avoid potential uninitialized read in FormatISO8601DateTime(int64_t) by checking gmtime_s/gmtime_r return value (#18162) and similar cases.
Run fuzz testing test cases (bitcoin-core/qa-assets) under valgrind.
This would have caught util: Avoid potential uninitialized read in FormatISO8601DateTime(int64_t) by checking gmtime_s/gmtime_r return value (#18162) and similar cases.
Failing as intended in Travis:
…
Run integer with args ['valgrind', '--quiet', '--error-exitcode=1', '/home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/integer', '-runs=1', '-detect_leaks=0', '/home/travis/build/bitcoin/bitcoin/ci/scratch//qa-assets/fuzz_seed_corpus/integer']
Output: INFO: Seed: 3664174428
INFO: Loaded 1 modules (154709 inline 8-bit counters): 154709 [0xea0bc8, 0xec681d),
INFO: Loaded 1 PC tables (154709 PCs): 154709 [0xec6820,0x1122d70),
INFO: 79 files found in /home/travis/build/bitcoin/bitcoin/ci/scratch//qa-assets/fuzz_seed_corpus/integer
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
INFO: seed corpus: files: 79 min: 1b max: 83b total: 5116b rss: 129Mb
==26395== Conditional jump or move depends on uninitialised value(s)
==26395== at 0x4F43C0A: std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_int<long>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, long) const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25)
==26395== by 0x4F501A4: std::ostream& std::ostream::_M_insert<long>(long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25)
==26395== by 0x543C1C: formatValue<int> (tinyformat.h:358)
==26395== by 0x543C1C: void tinyformat::detail::FormatArg::formatImpl<int>(std::ostream&, char const*, char const*, int, void const*) (tinyformat.h:543)
==26395== by 0x532D1F: format (tinyformat.h:528)
==26395== by 0x532D1F: tinyformat::detail::formatImpl(std::ostream&, char const*, tinyformat::detail::FormatArg const*, int) (tinyformat.h:907)
==26395== by 0x5EE190: vformat (tinyformat.h:1054)
==26395== by 0x5EE190: format<int, int, int> (tinyformat.h:1064)
==26395== by 0x5EE190: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > tinyformat::format<int, int, int>(char const*, int const&, int const&, int const&) (tinyformat.h:1073)
==26395== by 0x5EE0C0: FormatISO8601Date[abi:cxx11](long) (time.cpp:112)
…
Will fail until #18162 is merged.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
0 | @@ -0,0 +1,18 @@ 1 | +#!/usr/bin/env bash 2 | +# 3 | +# Copyright (c) 2019 The Bitcoin Core developers 4 | +# Distributed under the MIT software license, see the accompanying 5 | +# file COPYING or http://www.opensource.org/licenses/mit-license.php. 6 | + 7 | +export LC_ALL=C.UTF-8 8 | + 9 | +export CONTAINER_NAME=ci_native_fuzz
export CONTAINER_NAME=ci_native_fuzz_valgrind
Fixed!
ACK
@MarcoFalke Thanks for reviewing! CONTAINER_NAME now changed. Please re-review :)
It could make sense to add an --exclude argument to the test_runner to skip a test target (in this case --exclude integer).
149 | @@ -150,7 +150,7 @@ def run_once(*, corpus, test_list, build_dir, export_coverage, use_valgrind):
150 | corpus_path,
Unrelated to this pull, but it why is detect_leaks disabled?
I'd suggest to include this commit:
commit ffff1245c11428968b71454e4ef85417d33c9893 (HEAD)
Author: MarcoFalke <falke.marco@gmail.com>
Date: Fri Jan 3 10:27:04 2020 -0800
test: Enable leak detection for fuzzers
This has been disabled in 16f0a186dcee563bb1000e1ffc51da87e7623bc6 for
no given reason.
diff --git a/test/fuzz/test_runner.py b/test/fuzz/test_runner.py
index b638e6bac6..5174e21e2a 100755
--- a/test/fuzz/test_runner.py
+++ b/test/fuzz/test_runner.py
@@ -146,7 +146,6 @@ def run_once(*, corpus, test_list, build_dir, export_coverage, use_valgrind):
args = [
os.path.join(build_dir, 'src', 'test', 'fuzz', t),
'-runs=1',
- '-detect_leaks=0',
corpus_path,
]
if use_valgrind:
-detect_leaks=0 was required at some points to make test/fuzz/test_runner.py pass. If that is not required any more that is great news! I'll try if Travis is happy without it.
ACK f2472f64604a0c583f950c56e8753d0bee246388 👼
<details><summary>Show signature and timestamp</summary>
Signature:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
ACK f2472f64604a0c583f950c56e8753d0bee246388 👼
-----BEGIN PGP SIGNATURE-----
iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUiMtgv/eLFsfqh9fC/1+Xam7Wy9imO1pDZigPBciBNC65SfSHx8iOWLFaN/AoNs
CcCvOSnjd6yPsja6uajgjiz2q83DjCGBLNKph8D03yJ+WMQt2DcLJUF52EZffSVq
XU7w+81kmxtQMmpFQOYFb/re1ScaGJ4U1bUeISsVeHlWhljw6XinSuLFFyJW4OA0
ahD9Wrs1VF8zypuIPEKwNTzkCjyj6eeUsZLyE7JCvJ3LXhPn/HX7dt18ErekvTFV
7IHr3shTot5aMhmDnugjmLJ/NeMO1ynFBFjFioNNzU4Ztf/PaUtTt3jxe/umfPyK
4kp4ntEOGTzSBW2WDN+qXGNwrBmToIolOnRcVyYTgwLn3kMC3x/952Om2+D8m1WI
9up5/fEd5UEHLv5GVi3BXXFwVI/qZcCvpy3IqxnDMSwi3juhIJ5QonmsIEpqv2yo
KWriT4nvULRhFBpfmlHaDoWLIQkl5nJTeJZLlEt2/t5/ioT/hkz8Ig7wNjAowRaQ
K3ltYj3u
=adP/
-----END PGP SIGNATURE-----
Timestamp of file with hash 70c5ad8b8dd4b65a0d243dba35a2ed1c733a95d5036423b9984096ba45d53f36 -
</details>