mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-29 09:55:49 +02:00
fa51310121contrib: Warn about using libFuzzer for coverage check (MarcoFalke)fa17cdb191test: Avoid script check worker threads while fuzzing (MarcoFalke)fa900bb2dccontrib: Only print fuzz output on failure (MarcoFalke)fa82fe2c73contrib: Use -Xdemangler=llvm-cxxfilt in deterministic-*-coverage (MarcoFalke)fa7e931130contrib: Add optional parallelism to deterministic-fuzz-coverage (MarcoFalke) Pull request description: This should make the `partially_downloaded_block` fuzz target even more deterministic. Follow-up to https://github.com/bitcoin/bitcoin/pull/31841. Tracking issue: https://github.com/bitcoin/bitcoin/issues/29018. This bundles several changes: * First, speed up the `deterministic-fuzz-coverage` helper by introducing parallelism. * Then, a fix to remove spawned test threads or spawn them deterministically. (While testing this, high parallelism and thread contention may be needed) ### Testing It can be tested via (setting 32 parallel threads): ``` cargo run --manifest-path ./contrib/devtools/deterministic-fuzz-coverage/Cargo.toml -- $PWD/bld-cmake/ $PWD/../b-c-qa-assets/fuzz_corpora/ partially_downloaded_block 32 ``` Locally, on a failure, the output would look like: ```diff .... - 150| 0| m_worker_threads.emplace_back([this, n]() { - 151| 0| util::ThreadRename(strprintf("scriptch.%i", n)); + 150| 1| m_worker_threads.emplace_back([this, n]() { + 151| 1| util::ThreadRename(strprintf("scriptch.%i", n)); ... ``` This excerpt likely indicates that the script threads were started after the fuzz init function returned. Similarly, for the scheduler thread, it would look like: ```diff ... 227| 0| m_node.scheduler = std::make_unique<CScheduler>(); - 228| 1| m_node.scheduler->m_service_thread = std::thread(util::TraceThread, "scheduler", [&] { m_node.scheduler->serviceQueue(); }); + 228| 0| m_node.scheduler->m_service_thread = std::thread(util::TraceThread, "scheduler", [&] { m_node.scheduler->serviceQueue(); }); 229| 0| m_node.validation_signals = ... ``` ACKs for top commit: Prabhat1308: re-ACK [`fa51310`](fa51310121) hodlinator: re-ACKfa51310121janb84: Re-ACK [fa51310](fa51310121) Tree-SHA512: 1a935eb19da98c7c3810b8bcc5287e5649ffb55bf50ab78c414a424fef8e703839291bb24040a552c49274a4a0292910a00359bdff72fa29a4f53ad36d7a8720