Fuzz introspector
For issues and ideas: https://github.com/ossf/fuzz-introspector/issues

Fuzzer details

Fuzzer: fuzz_db

Call tree

The calltree shows the control flow of the fuzzer. This is overlaid with coverage information to display how much of the potential code a fuzzer can reach is in fact covered at runtime. In the following there is a link to a detailed calltree visualisation as well as a bitmap showing a high-level view of the calltree. For further information about these topics please see the glossary for full calltree and calltree overview

Call tree overview bitmap:

The distribution of callsites in terms of coloring is
Color Runtime hitcount Callsite count Percentage
red 0 263 21.2%
gold [1:9] 11 0.88%
yellow [10:29] 4 0.32%
greenyellow [30:49] 1 0.08%
lawngreen 50+ 961 77.5%
All colors 1240 100

Fuzz blockers

The followings are the branches where fuzzer fails to bypass.

Unique non-covered Complexity Unique Reachable Complexities Unique Reachable Functions All non-covered Complexity All Reachable Complexity Function Name Function Callsite Blocked Branch
134 307 18 :

['leveldb::BytewiseComparator()', 'std::__1::basic_string , std::__1::allocator >::append(char const*)', 'leveldb::operator==(leveldb::Slice const&, leveldb::Slice const&)', 'operator new(unsigned long)', 'leveldb::Block::Block(leveldb::BlockContents const&)', 'leveldb::ReadBlock(leveldb::RandomAccessFile*, leveldb::ReadOptions const&, leveldb::BlockHandle const&, leveldb::BlockContents*)', 'leveldb::Table::ReadFilter(leveldb::Slice const&)', 'leveldb::ReadOptions::ReadOptions()', 'leveldb::Status::~Status()', 'leveldb::Block::~Block()', 'leveldb::Slice::Slice(std::__1::basic_string , std::__1::allocator > const&)', 'std::__1::basic_string , std::__1::allocator >::basic_string (char const*)', 'std::__1::basic_string , std::__1::allocator >::~basic_string()', 'leveldb::Block::NewIterator(leveldb::Comparator const*)', 'leveldb::Footer::metaindex_handle() const', 'leveldb::Status::ok() const', 'operator delete(void*)', 'leveldb::BlockContents::BlockContents()']

134 307 leveldb::Table::ReadMeta(leveldb::Footerconst&) call site: 00000 /src/leveldb/table/table.cc:83
120 202 6 :

['std::__1::basic_string , std::__1::allocator >::assign(char const*, unsigned long)', 'std::__1::basic_string , std::__1::allocator >::empty() const', 'std::__1::basic_string , std::__1::allocator >::clear()', 'std::__1::basic_string , std::__1::allocator >::size() const', 'leveldb::log::Reader::ReadPhysicalRecord(leveldb::Slice*)', 'leveldb::log::Reader::ReportCorruption(unsigned long, char const*)']

120 226 leveldb::log::Reader::ReadRecord(leveldb::Slice*,std::__1::basic_string ,std::__1::allocator >*) call site: 00000 /src/leveldb/db/log_reader.cc:133
42 56 2 :

['leveldb::VersionSet::NumLevelFiles(int) const', 'leveldb::VersionSet::NumLevelBytes(int) const']

42 60 leveldb::DBImpl::GetProperty(leveldb::Sliceconst&,std::__1::basic_string ,std::__1::allocator >*) call site: 00000 /src/leveldb/db/db_impl.cc:1423
39 105 10 :

['leveldb::log::Writer::Writer(leveldb::WritableFile*, unsigned long)', 'leveldb::Log(leveldb::Logger*, char const*, ...)', 'std::__1::basic_string , std::__1::allocator >::~basic_string()', 'operator new(unsigned long)', 'leveldb::Status::ok() const', 'leveldb::ParseFileName(std::__1::basic_string , std::__1::allocator > const&, unsigned long*, leveldb::FileType*)', 'leveldb::TargetFileSize(leveldb::Options const*)', 'std::__1::basic_string , std::__1::allocator >::c_str() const', 'leveldb::Status::ToString() const', 'leveldb::Status::~Status()']

39 105 leveldb::VersionSet::ReuseManifest(std::__1::basic_string ,std::__1::allocator >const&,std::__1::basic_string ,std::__1::allocator >const&) call site: 00000 /src/leveldb/db/version_set.cc:996
21 30 5 :

['leveldb::NewErrorIterator(leveldb::Status const&)', 'leveldb::Slice::Slice(char const*)', 'leveldb::Slice::Slice()', 'leveldb::Status::Corruption(leveldb::Slice const&, leveldb::Slice const&)', 'leveldb::Status::~Status()']

21 30 leveldb::Block::NewIterator(leveldb::Comparatorconst*) call site: 00000 /src/leveldb/table/block.cc:281
16 16 1 :

['leveldb::log::Reader::SkipToInitialBlock()']

136 246 leveldb::log::Reader::ReadRecord(leveldb::Slice*,std::__1::basic_string ,std::__1::allocator >*) call site: 00000 /src/leveldb/db/log_reader.cc:57
15 15 1 :

['leveldb::NewEmptyIterator()']

15 15 leveldb::Block::NewIterator(leveldb::Comparatorconst*) call site: 00000 /src/leveldb/table/block.cc:285
15 15 1 :

['leveldb::NewEmptyIterator()']

15 15 leveldb::NewMergingIterator(leveldb::Comparatorconst*,leveldb::Iterator**,int) call site: 00000 /src/leveldb/table/merger.cc:182
10 18 4 :

['leveldb::Status::operator=(leveldb::Status&&)', 'leveldb::Slice::Slice(char const*)', 'leveldb::Slice::Slice()', 'leveldb::Status::Corruption(leveldb::Slice const&, leveldb::Slice const&)']

10 250 leveldb::VersionSet::Recover(bool*) call site: 00000 /src/leveldb/db/version_set.cc:955
10 14 2 :

['leveldb::Slice::Slice(char const*)', 'leveldb::Status::Corruption(leveldb::Slice const&, leveldb::Slice const&)']

10 16 leveldb::Table::Open(leveldb::Optionsconst&,leveldb::RandomAccessFile*,unsignedlong,leveldb::Table**) call site: 00000 /src/leveldb/table/table.cc:41
4 29 5 :

['close', 'leveldb::(anonymous namespace)::PosixError(std::__1::basic_string , std::__1::allocator > const&, int)', 'std::__1::basic_string , std::__1::allocator > std::__1::operator+ , std::__1::allocator >(char const*, std::__1::basic_string , std::__1::allocator > const&)', '__errno_location', 'leveldb::(anonymous namespace)::PosixLockTable::Remove(std::__1::basic_string , std::__1::allocator > const&)']

4 29 leveldb::(anonymousnamespace)::PosixEnv::LockFile(std::__1::basic_string ,std::__1::allocator >const&,leveldb::FileLock**) call site: 00000 /src/leveldb/util/env_posix.cc:669
4 28 5 :

['leveldb::Status::operator=(leveldb::Status&&)', 'read', 'leveldb::(anonymous namespace)::PosixError(std::__1::basic_string , std::__1::allocator > const&, int)', '__errno_location', 'leveldb::Status::~Status()']

4 30 leveldb::(anonymousnamespace)::PosixSequentialFile::Read(unsignedlong,leveldb::Slice*,char*) call site: 00000 /src/leveldb/util/env_posix.cc:146

Runtime coverage analysis

Covered functions
583
Functions that are reachable but not covered
61
Reachable functions
390
Percentage of reachable functions covered
84.36%
NB: The sum of covered functions and functions that are reachable but not covered need not be equal to Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation of our static analysis capabilities.
Warning: The number of covered functions are larger than the number of reachable functions. This means that there are more functions covered at runtime than are extracted using static analysis. This is likely a result of the static analysis component failing to extract the right call graph or the coverage runtime being compiled with sanitizers in code that the static analysis has not analysed. This can happen if lto/gold is not used in all places that coverage instrumentation is used.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
/src/leveldb/build/../fuzz_db.cc 3
/src/leveldb/util/options.cc 1
/src/leveldb/util/comparator.cc 3
/src/leveldb/./util/no_destructor.h 1
/src/leveldb/include/leveldb/comparator.h 2
/src/leveldb/util/env_posix.cc 6
/src/leveldb/util/env.cc 5
/src/leveldb/./port/port_stdcxx.h 10
/src/leveldb/db/db_impl.cc 30
/src/leveldb/include/leveldb/db.h 2
/src/leveldb/./db/dbformat.h 17
/src/leveldb/include/leveldb/filter_policy.h 1
/src/leveldb/include/leveldb/status.h 13
/src/leveldb/db/filename.cc 11
/src/leveldb/util/cache.cc 6
/src/leveldb/include/leveldb/cache.h 1
/src/leveldb/db/table_cache.cc 6
/src/leveldb/db/write_batch.cc 9
/src/leveldb/./db/snapshot.h 4
/src/leveldb/db/version_set.cc 52
/src/leveldb/./db/version_set.h 14
/src/leveldb/./db/version_edit.h 13
/src/leveldb/./db/db_impl.h 3
/src/leveldb/db/version_edit.cc 5
/src/leveldb/include/leveldb/slice.h 11
/src/leveldb/db/log_writer.cc 6
/src/leveldb/./util/crc32c.h 3
/src/leveldb/util/crc32c.cc 4
/src/leveldb/./util/coding.h 5
/src/leveldb/util/coding.cc 12
/src/leveldb/util/status.cc 3
/src/leveldb/./db/log_reader.h 1
/src/leveldb/db/log_reader.cc 7
/src/leveldb/util/logging.cc 3
/src/leveldb/db/memtable.cc 5
/src/leveldb/./db/memtable.h 5
/src/leveldb/util/arena.cc 4
/src/leveldb/./db/skiplist.h 6
/src/leveldb/./util/random.h 1
/src/leveldb/include/leveldb/write_batch.h 1
/src/leveldb/./util/arena.h 1
/src/leveldb/table/iterator.cc 5
/src/leveldb/db/builder.cc 1
/src/leveldb/table/table_builder.cc 13
/src/leveldb/table/block_builder.cc 5
/src/leveldb/table/filter_block.cc 6
/src/leveldb/./table/format.h 11
/src/leveldb/include/leveldb/table_builder.h 1
/src/leveldb/table/format.cc 5
/src/leveldb/./table/block_builder.h 2
/src/leveldb/./table/filter_block.h 1
/src/leveldb/include/leveldb/options.h 2
/src/leveldb/table/table.cc 11
/src/leveldb/table/block.cc 5
/src/leveldb/include/leveldb/table.h 1
/src/leveldb/table/two_level_iterator.cc 2
/src/leveldb/./table/iterator_wrapper.h 4
/src/leveldb/./table/block.h 1
/src/leveldb/include/leveldb/iterator.h 1
/src/leveldb/db/dbformat.cc 5
/src/leveldb/./util/mutexlock.h 2
/src/leveldb/table/merger.cc 2

Analyses and suggestions

Optimal target analysis

Remaining optimal interesting functions

The following table shows a list of functions that are optimal targets. Optimal targets are identified by finding the functions that in combination, yield a high code coverage.

Func name Functions filename Arg count Args Function depth hitcount instr count bb count cyclomatic complexity Reachable functions Incoming references total cyclomatic complexity Unreached complexity
leveldb::DBImpl::Get(leveldb::ReadOptionsconst&,leveldb::Sliceconst&,std::__1::basic_string ,std::__1::allocator >*) /src/leveldb/db/db_impl.cc 5 ['class.std::__1::__libcpp_refstring *', 'class.leveldb::DBImpl *', 'struct.leveldb::ReadOptions *', 'class.FuzzedDataProvider *', 'class.std::__1::basic_string *'] 9 0 144 25 10 330 0 1273 102
leveldb::DBImpl::Write(leveldb::WriteOptionsconst&,leveldb::WriteBatch*) /src/leveldb/db/db_impl.cc 4 ['class.std::__1::__libcpp_refstring *', 'class.leveldb::DBImpl *', 'struct.std::__1::default_delete *', 'class.std::__1::__fs::filesystem::path *'] 10 0 275 44 17 344 0 1297 63
leveldb::(anonymousnamespace)::MemTableInserter::Delete(leveldb::Sliceconst&) /src/leveldb/db/write_batch.cc 2 ['class.leveldb::(anonymous namespace)::MemTableInserter *', 'class.FuzzedDataProvider *'] 5 0 26 3 2 31 0 114 42
leveldb::DBImpl::GetProperty(leveldb::Sliceconst&,std::__1::basic_string ,std::__1::allocator >*) /src/leveldb/db/db_impl.cc 3 ['class.leveldb::DBImpl *', 'class.FuzzedDataProvider *', 'class.std::__1::basic_string *'] 5 0 501 69 26 33 0 111 40
leveldb::Block::Iter::Seek(leveldb::Sliceconst&) /src/leveldb/table/block.cc 2 ['class.leveldb::Block::Iter *', 'class.FuzzedDataProvider *'] 2 0 221 36 14 19 0 77 40
leveldb::(anonymousnamespace)::DBIter::Prev() /src/leveldb/db/db_iter.cc 1 ['class.leveldb::(anonymous namespace)::DBIter *'] 8 0 135 12 5 315 0 1232 37

Implementing fuzzers that target the above functions will improve reachability such that it becomes:

Functions statically reachable by fuzzers
56.3%
460/817
Cyclomatic complexity statically reachable by fuzzers
64.6%
1834 / 2837

All functions overview

If you implement fuzzers for these functions, the status of all functions in the project will be:

Func name Functions filename Args Function call depth Reached by Fuzzers Fuzzers runtime hit Func lines hit % I Count BB Count Cyclomatic complexity Functions reached Reached by functions Accumulated cyclomatic complexity Undiscovered complexity

Files and Directories in report

This section shows which files and directories are considered in this report. The main reason for showing this is fuzz introspector may include more code in the reasoning than is desired. This section helps identify if too many files/directories are included, e.g. third party code, which may be irrelevant for the threat model. In the event too much is included, fuzz introspector supports a configuration file that can exclude data from the report. See the following link for more information on how to create a config file: link

Files in report

Source file Reached by Covered by
[] []
/src/leveldb/./table/iterator_wrapper.h ['fuzz_db'] []
/src/leveldb/./table/filter_block.h ['fuzz_db'] []
/src/leveldb/./port/port_stdcxx.h ['fuzz_db'] []
/src/leveldb/./db/log_reader.h ['fuzz_db'] []
/src/leveldb/util/status.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/util/hash.cc [] []
/src/leveldb/db/db_impl.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/table/block.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/util/logging.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/util/cache.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/db/log_reader.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/table/format.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/db/version_set.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/db/dbformat.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/./db/memtable.h ['fuzz_db'] []
/src/leveldb/./table/format.h ['fuzz_db'] []
/src/leveldb/table/table.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/./util/crc32c.h ['fuzz_db'] []
/src/leveldb/util/crc32c.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/db/table_cache.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/include/leveldb/slice.h ['fuzz_db'] ['fuzz_db']
/src/leveldb/util/env_posix.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/./db/dbformat.h ['fuzz_db'] []
/src/leveldb/db/memtable.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/./db/version_set.h ['fuzz_db'] []
/src/leveldb/./util/arena.h ['fuzz_db'] []
/src/leveldb/util/filter_policy.cc [] []
/src/leveldb/./util/coding.h ['fuzz_db'] []
/src/leveldb/include/leveldb/db.h ['fuzz_db'] ['fuzz_db']
/src/leveldb/table/merger.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/include/leveldb/filter_policy.h ['fuzz_db'] []
/src/leveldb/include/leveldb/write_batch.h ['fuzz_db'] []
/src/leveldb/table/table_builder.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/./table/block_builder.h ['fuzz_db'] []
/src/leveldb/table/iterator.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/db/write_batch.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/include/leveldb/status.h ['fuzz_db'] ['fuzz_db']
/src/leveldb/util/coding.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/table/two_level_iterator.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/util/comparator.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/include/leveldb/env.h [] []
/src/leveldb/include/leveldb/table.h ['fuzz_db'] ['fuzz_db']
/usr/local/bin/../include/c++/v1/stdexcept [] []
/src/leveldb/table/block_builder.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/include/leveldb/comparator.h ['fuzz_db'] []
/src/leveldb/./db/snapshot.h ['fuzz_db'] []
/src/leveldb/./util/random.h ['fuzz_db'] []
/src/leveldb/db/version_edit.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/./table/block.h ['fuzz_db'] []
/src/leveldb/util/env.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/./util/posix_logger.h [] []
/src/leveldb/db/builder.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/./util/no_destructor.h ['fuzz_db'] []
/src/leveldb/db/db_iter.cc [] []
/src/leveldb/include/leveldb/table_builder.h ['fuzz_db'] ['fuzz_db']
/src/leveldb/build/../fuzz_db.cc ['fuzz_db'] []
/usr/include/x86_64-linux-gnu/sys/stat.h [] []
/src/leveldb/include/leveldb/options.h ['fuzz_db'] ['fuzz_db']
/src/leveldb/db/filename.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/./db/write_batch_internal.h [] []
/src/leveldb/db/log_writer.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/util/arena.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/./util/mutexlock.h ['fuzz_db'] []
/src/leveldb/util/options.cc ['fuzz_db'] ['fuzz_db']
/src/leveldb/./db/db_impl.h ['fuzz_db'] []
/src/leveldb/include/leveldb/cache.h ['fuzz_db'] ['fuzz_db']
/src/leveldb/table/filter_block.cc ['fuzz_db'] []
/src/leveldb/include/leveldb/iterator.h ['fuzz_db'] ['fuzz_db']
/src/leveldb/./db/skiplist.h ['fuzz_db'] []
/src/leveldb/./db/version_edit.h ['fuzz_db'] []

Directories in report

Directory
/src/leveldb/./port/
/src/leveldb/./db/
/src/leveldb/db/
/src/leveldb/include/leveldb/
/src/leveldb/build/../
/usr/include/x86_64-linux-gnu/sys/
/src/leveldb/./table/
/src/leveldb/util/
/usr/local/bin/../include/c++/v1/
/src/leveldb/./util/
/src/leveldb/table/