Skip to content

Commit

Permalink
LevelDB leak repro
Browse files Browse the repository at this point in the history
  • Loading branch information
darosior committed Nov 13, 2023
1 parent e11b758 commit d015613
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ test_fuzz_fuzz_SOURCES = \
test/fuzz/key.cpp \
test/fuzz/key_io.cpp \
test/fuzz/kitchen_sink.cpp \
test/fuzz/leveldb_leak.cpp \
test/fuzz/load_external_block_file.cpp \
test/fuzz/locale.cpp \
test/fuzz/merkleblock.cpp \
Expand Down
24 changes: 24 additions & 0 deletions src/test/fuzz/leveldb_leak.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright (c) 2023 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <chainparams.h>
#include <node/blockstorage.h>
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>
#include <test/fuzz/util.h>
#include <util/thread.h>

void init_leak()
{
SelectParams(ChainType::MAIN);
}

FUZZ_TARGET(leak_test, .init = init_leak)
{
kernel::BlockTreeDB block_tree{DBParams{
.path = "", // Memory-only.
.cache_bytes = 0,
.memory_only = true,
}};
}

0 comments on commit d015613

Please sign in to comment.