mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-18 21:35:13 +01:00
fuzz: Fix misplaced SeedRand::ZEROS
After commit fae63bf130
this must be
placed even before test_setup.
This commit is contained in:
parent
477b357460
commit
fadd568931
@ -24,12 +24,12 @@ struct CheckGlobalsImpl {
|
||||
"The current fuzz target used the global random state.\n\n"
|
||||
|
||||
"This is acceptable, but requires the fuzz target to call \n"
|
||||
"SeedRandomStateForTest(SeedRand::ZEROS) at the beginning \n"
|
||||
"of processing the fuzz input.\n\n"
|
||||
"SeedRandomStateForTest(SeedRand::ZEROS) in the first line \n"
|
||||
"of the FUZZ_TARGET function.\n\n"
|
||||
|
||||
"An alternative solution would be to avoid any use of globals.\n\n"
|
||||
|
||||
"Without a solution, fuzz stability and determinism can lead \n"
|
||||
"Without a solution, fuzz instability and non-determinism can lead \n"
|
||||
"to non-reproducible bugs or inefficient fuzzing.\n\n"
|
||||
<< std::endl;
|
||||
std::abort(); // Abort, because AFL may try to recover from a std::exit
|
||||
|
@ -21,6 +21,7 @@ using node::BlockAssembler;
|
||||
|
||||
FUZZ_TARGET(utxo_total_supply)
|
||||
{
|
||||
SeedRandomStateForTest(SeedRand::ZEROS);
|
||||
/** The testing setup that creates a chainman only (no chainstate) */
|
||||
ChainTestingSetup test_setup{
|
||||
ChainType::REGTEST,
|
||||
@ -28,7 +29,6 @@ FUZZ_TARGET(utxo_total_supply)
|
||||
.extra_args = {"-testactivationheight=bip34@2"},
|
||||
},
|
||||
};
|
||||
SeedRandomStateForTest(SeedRand::ZEROS); // Can not be done before test_setup
|
||||
// Create chainstate
|
||||
test_setup.LoadVerifyActivateChainstate();
|
||||
auto& node{test_setup.m_node};
|
||||
|
Loading…
Reference in New Issue
Block a user