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

Fuzzer details

Fuzzer: gdbm_fuzzer

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 361 71.9%
gold [1:9] 2 0.39%
yellow [10:29] 0 0.0%
greenyellow [30:49] 1 0.19%
lawngreen 50+ 138 27.4%
All colors 502 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
712 712 3 :

['free', 'gdbm_open', 'tildexpand']

712 1118 opendb call site: 00000 /src/gdbm/tools/gdbmshell.c:140
238 238 1 :

['_gdbm_avail_list_size']

238 238 avail_begin call site: 00000 /src/gdbm/tools/gdbmshell.c:807
236 236 1 :

['gdbm_avail_verify']

240 244 gdbm_fd_open call site: 00000 /src/gdbm/src/gdbmopen.c:677
236 236 3 :

['strtoul', 'lerror', 'strcmp']

238 1404 recover_handler call site: 00000 /src/gdbm/tools/gdbmshell.c:674
176 382 3 :

['cache_tab_lookup_slot', 'cache_lru_free', 'cache_tab_resize']

176 553 cache_lookup call site: 00000 /src/gdbm/src/bucket.c:319
118 118 2 :

['fputc', 'format_arg']

167 252 run_command call site: 00273 /src/gdbm/tools/gdbmshell.c:3099
56 164 8 :

['__errno_location', 'ioctl', 'fchmod', '_gdbmsync_done.1388', 'gdbm_errno_location', 'gdbm_set_errno', 'fsync', '_gdbmsync_init.1389']

56 164 _gdbm_snapshot call site: 00446 /src/gdbm/src/gdbmsync.c:82
44 44 5 :

['strcmp', 'strlen', 'strtok', 'terror', 'str2errcode']

44 44 errormask_sethook call site: 00000 /src/gdbm/tools/var.c:750
33 33 4 :

['terror', '__errno_location', 'strerror', 'popen']

35 115 run_command call site: 00298 /src/gdbm/tools/gdbmshell.c:3122
27 32 2 :

['lerror', 'interactive']

27 32 command_lookup call site: 00125 /src/gdbm/tools/gdbmshell.c:2546
27 27 1 :

['lerror']

27 27 dsconv call site: 00000 /src/gdbm/tools/datconv.c:382
27 27 1 :

['lerror']

27 27 print_bucket_begin call site: 00000 /src/gdbm/tools/gdbmshell.c:890

Runtime coverage analysis

Covered functions
269
Functions that are reachable but not covered
81
Reachable functions
179
Percentage of reachable functions covered
54.75%
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
fuzz/gdbm_fuzzer.c 1
tools/var.c 9
tools/gdbmshell.c 35
tools/datconv.c 5
tools/lex.l 24
tools/./gdbmtool.h 7
tools/gram.y 3
tools/lex.c 19
tools/mem.c 6
tools/err.c 3
tools/gram.c 5
src/gdbmerrno.c 4
src/gdbmclose.c 1
src/gdbmsync.c 2
src/mmap.c 2
src/./proto.h 2
src/lock.c 1
src/bucket.c 4

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
import_handler /src/gdbm/tools/gdbmshell.c 2 ['struct.command_param *', 'struct.command_environ *'] 14 0 258 34 10 199 0 1455 1222
export_handler /src/gdbm/tools/gdbmshell.c 2 ['struct.command_param *', 'struct.command_environ *'] 13 0 172 22 7 104 0 635 178
recover_handler /src/gdbm/tools/gdbmshell.c 2 ['struct.command_param *', 'struct.command_environ *'] 13 0 426 58 21 153 0 1189 141
help_handler /src/gdbm/tools/gdbmshell.c 2 ['struct.command_param *', 'struct.command_environ *'] 3 0 154 18 6 35 0 134 110
snapshot_handler /src/gdbm/tools/gdbmshell.c 2 ['struct.command_param *', 'struct.command_environ *'] 9 0 138 15 6 124 0 790 62
gdbm_failure_atomic /src/gdbm/src/gdbmsync.c 3 ['struct.gdbm_file_info *', 'char *', 'char *'] 1 0 489 102 27 15 0 108 38

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

Functions statically reachable by fuzzers
57.9%
296 / 511
Cyclomatic complexity statically reachable by fuzzers
72.0%
2406 / 3328

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/gdbm/src/gdbmload.c [] []
/src/gdbm/src/gdbmsetopt.c [] []
/src/gdbm/tools/lex.l ['gdbm_fuzzer'] ['gdbm_fuzzer']
/src/gdbm/src/gdbmclose.c ['gdbm_fuzzer'] ['gdbm_fuzzer']
/src/gdbm/src/gdbmreorg.c [] []
/src/gdbm/src/gdbmopen.c [] []
/src/gdbm/src/hash.c [] []
/src/gdbm/tools/gdbmshell.c ['gdbm_fuzzer'] ['gdbm_fuzzer']
/src/gdbm/src/gdbmerrno.c ['gdbm_fuzzer'] ['gdbm_fuzzer']
/src/gdbm/src/base64.c [] []
/src/gdbm/tools/var.c ['gdbm_fuzzer'] ['gdbm_fuzzer']
/src/gdbm/tools/input-file.c [] []
/src/gdbm/tools/lex.c ['gdbm_fuzzer'] ['gdbm_fuzzer']
/src/gdbm/src/recover.c [] []
/src/gdbm/src/debug.c [] []
/src/gdbm/src/fullio.c [] []
/src/gdbm/src/./proto.h ['gdbm_fuzzer'] []
/src/gdbm/tools/gram.c ['gdbm_fuzzer'] ['gdbm_fuzzer']
/src/gdbm/src/findkey.c [] []
/src/gdbm/tools/datconv.c ['gdbm_fuzzer'] ['gdbm_fuzzer']
/src/gdbm/src/gdbmexp.c [] []
/src/gdbm/tools/gram.y ['gdbm_fuzzer'] ['gdbm_fuzzer']
/src/gdbm/src/gdbmdump.c [] []
/src/gdbm/src/gdbmcount.c [] []
/src/gdbm/src/gdbmfdesc.c [] []
/src/gdbm/tools/input-null.c [] []
/src/gdbm/src/lock.c ['gdbm_fuzzer'] ['gdbm_fuzzer']
/src/gdbm/tools/util.c [] []
/src/gdbm/src/gdbmseq.c [] []
/src/gdbm/src/mmap.c ['gdbm_fuzzer'] ['gdbm_fuzzer']
/src/gdbm/src/update.c [] []
/src/gdbm/tools/progname.c [] []
/src/gdbm/src/version.c [] []
/src/gdbm/src/gdbmfetch.c [] []
/src/gdbm/src/gdbmsync.c ['gdbm_fuzzer'] ['gdbm_fuzzer']
/src/gdbm/tools/./gdbmtool.h ['gdbm_fuzzer'] []
/src/gdbm/src/gdbmdelete.c [] []
/src/gdbm/fuzz/gdbm_fuzzer.c ['gdbm_fuzzer'] ['gdbm_fuzzer']
/src/gdbm/tools/wordwrap.c [] []
/src/gdbm/tools/err.c ['gdbm_fuzzer'] []
/src/gdbm/src/bucket.c ['gdbm_fuzzer'] ['gdbm_fuzzer']
/src/gdbm/src/gdbmstore.c [] []
/src/gdbm/src/./gdbmdefs.h [] []
/src/gdbm/src/avail.c [] []
/src/gdbm/src/gdbmimp.c [] []
/src/gdbm/tools/mem.c ['gdbm_fuzzer'] ['gdbm_fuzzer']
/src/gdbm/src/falloc.c [] []

Directories in report

Directory
/src/gdbm/fuzz/
/src/gdbm/src/
/src/gdbm/tools/
/src/gdbm/tools/./
/src/gdbm/src/./