bitcoin/src/test/fuzz
MarcoFalke 8bb40d5f56
Merge #20560: fuzz: Link all targets once
fa13e1b0c5 build: Add option --enable-danger-fuzz-link-all (MarcoFalke)
44444ba759 fuzz: Link all targets once (MarcoFalke)

Pull request description:

  Currently the linker is invoked more than 150 times when compiling with `--enable-fuzz`. This is problematic for several reasons:

  * It wastes disk space north of 20 GB, as all libraries and sanitizers are linked more than 150 times
  * It wastes CPU time, as the link step can practically not be cached (similar to ccache for object files)
  * It makes it a blocker to compile the fuzz tests by default for non-fuzz builds #19388, for the aforementioned reasons
  * The build file is several thousand lines of code, without doing anything meaningful except listing each fuzz target in a highly verbose manner
  * It makes writing new fuzz tests unnecessarily hard, as build system knowledge is required; Compare that to boost unit tests, which can be added by simply editing an existing cpp file
  * It encourages fuzz tests that re-use the `buffer` or assume the `buffer` to be concatenations of seeds, which increases complexity of seeds and complexity for the fuzz engine to explore; Thus reducing the effectiveness of the affected fuzz targets

  Fixes #20088

ACKs for top commit:
  practicalswift:
    Tested ACK fa13e1b0c5
  sipa:
    ACK fa13e1b0c5. Reviewed the code changes, and tested the 3 different test_runner.py modes (run once, merge, generate). I also tested building with the new --enable-danger-fuzz-link-all

Tree-SHA512: 962ab33269ebd51810924c51266ecc62edd6ddf2fcd9a8c359ed906766f58c3f73c223f8d3cc49f2c60f0053f65e8bdd86ce9c19e673f8c2b3cd676e913f2642
2020-12-15 19:00:36 +01:00
..
addition_overflow.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
addrdb.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
addrman.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
asmap.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
asmap_direct.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
autofile.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
banman.cpp Merge #20560: fuzz: Link all targets once 2020-12-15 19:00:36 +01:00
base_encode_decode.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
bech32.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
block.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
block_header.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
blockfilter.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
bloom_filter.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
buffered_file.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
chain.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
checkqueue.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
coins_view.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
connman.cpp Merge #20560: fuzz: Link all targets once 2020-12-15 19:00:36 +01:00
crypto.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
crypto_aes256.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
crypto_aes256cbc.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
crypto_chacha20.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
crypto_chacha20_poly1305_aead.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
crypto_common.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
crypto_hkdf_hmac_sha256_l32.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
crypto_poly1305.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
cuckoocache.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
danger_link_all.sh build: Add option --enable-danger-fuzz-link-all 2020-12-14 16:55:56 +01:00
decode_tx.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
descriptor_parse.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
deserialize.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
eval_script.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
fee_rate.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
fees.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
flatfile.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
float.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
fuzz.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
fuzz.h fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
FuzzedDataProvider.h tests: Update FuzzedDataProvider.h from upstream (LLVM) 2020-01-27 21:31:42 +00:00
golomb_rice.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
hex.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
http_request.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
integer.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
key.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
key_io.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
kitchen_sink.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
load_external_block_file.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
locale.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
merkleblock.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
message.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
multiplication_overflow.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
net.cpp Merge #20560: fuzz: Link all targets once 2020-12-15 19:00:36 +01:00
net_permissions.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
netaddress.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
p2p_transport_deserializer.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
parse_hd_keypath.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
parse_iso8601.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
parse_numbers.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
parse_script.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
parse_univalue.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
policy_estimator.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
policy_estimator_io.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
pow.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
prevector.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
primitives_transaction.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
process_message.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
process_messages.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
protocol.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
psbt.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
random.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
rbf.cpp Merge #20560: fuzz: Link all targets once 2020-12-15 19:00:36 +01:00
rolling_bloom_filter.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
script.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
script_assets_test_minimizer.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
script_bitcoin_consensus.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
script_descriptor_cache.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
script_flags.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
script_interpreter.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
script_ops.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
script_sigcache.cpp Merge #20560: fuzz: Link all targets once 2020-12-15 19:00:36 +01:00
script_sign.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
scriptnum_ops.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
secp256k1_ec_seckey_import_export_der.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
secp256k1_ecdsa_signature_parse_der_lax.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
signature_checker.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
signet.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
span.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
spanparsing.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
string.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
strprintf.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
system.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
timedata.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
transaction.cpp Merge #20560: fuzz: Link all targets once 2020-12-15 19:00:36 +01:00
tx_in.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
tx_out.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
txrequest.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
util.h Merge #20425: fuzz: Make CAddrMan fuzzing harness deterministic 2020-12-01 14:04:10 +01:00