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

Fuzzer details

Fuzzer: 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 12 27.2%
gold [1:9] 1 2.27%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 31 70.4%
All colors 44 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
8 8 10 :

['std::__1::basic_string , std::__1::allocator > std::__1::operator+ , std::__1::allocator >(char const*, std::__1::basic_string , std::__1::allocator > const&)', 'std::__1::__wrap_iter , std::__1::allocator >*>::operator*() const', 'Fatal(char const*, ...)', 'std::__1::basic_string , std::__1::allocator >::c_str() const', 'std::__1::vector , std::__1::allocator >, std::__1::allocator , std::__1::allocator > > >::end()', 'std::__1::basic_string , std::__1::allocator >::append(std::__1::basic_string , std::__1::allocator > const&)', 'bool std::__1::operator!= , std::__1::allocator >*>(std::__1::__wrap_iter , std::__1::allocator >*> const&, std::__1::__wrap_iter , std::__1::allocator >*> const&)', 'std::__1::basic_string , std::__1::allocator > std::__1::operator+ , std::__1::allocator >(std::__1::basic_string , std::__1::allocator > const&, char const*)', 'std::__1::basic_string , std::__1::allocator >::basic_string()', 'std::__1::__wrap_iter , std::__1::allocator >*>::operator++()']

8 8 EdgeEnv::LookupVariable(std::__1::basic_string ,std::__1::allocator >const&) call site: 00000 /src/ninja/src/graph.cc:447
0 141 5 :

['Lexer::DescribeLastError()', 'Lexer::EatWhitespace()', 'StringPiece::StringPiece(char const*, unsigned long)', 'EvalString::AddText(StringPiece)', 'EvalString::AddSpecial(StringPiece)']

0 177 Lexer::ReadEvalString(EvalString*,bool,std::__1::basic_string ,std::__1::allocator >*) call site: 00000 /src/ninja/src/lexer.cc:794
0 80 3 :

['std::__1::vector >::push_back(EvalString const&)', 'Lexer::ReadPath(EvalString*, std::__1::basic_string , std::__1::allocator >*)', 'EvalString::empty() const']

46 1276 ManifestParser::ParseEdge(std::__1::basic_string ,std::__1::allocator >*) call site: 00000 /src/ninja/src/manifest_parser.cc:292
0 14 3 :

['Lexer::DescribeLastError()', 'Lexer::Error(std::__1::basic_string , std::__1::allocator > const&, std::__1::basic_string , std::__1::allocator >*)', 'std::__1::basic_string , std::__1::allocator >::~basic_string()']

0 14 Lexer::ReadEvalString(EvalString*,bool,std::__1::basic_string ,std::__1::allocator >*) call site: 00000 /src/ninja/src/lexer.cc:709
0 12 2 :

['std::__1::basic_string , std::__1::allocator >::basic_string (char const*)', 'Lexer::Error(std::__1::basic_string , std::__1::allocator > const&, std::__1::basic_string , std::__1::allocator >*)']

0 12 ManifestParser::ParsePool(std::__1::basic_string ,std::__1::allocator >*) call site: 00000 /src/ninja/src/manifest_parser.cc:125
0 10 5 :

['_ZNSt3__111__wrap_iterIPKP4NodeEC2IPS2_EERKNS0_IT_EEPNS_9enable_ifIXsr14is_convertibleIS8_S4_EE5valueEvE4typeE', 'Node::path() const', 'std::__1::vector >::erase(std::__1::__wrap_iter , std::__1::__wrap_iter )', 'std::__1::basic_string , std::__1::allocator >::c_str() const', 'Warning(char const*, ...)']

0 186 ManifestParser::ParseEdge(std::__1::basic_string ,std::__1::allocator >*) call site: 00000 /src/ninja/src/manifest_parser.cc:395
0 8 1 :

['BindingEnv::LookupRule(std::__1::basic_string , std::__1::allocator > const&)']

0 8 BindingEnv::LookupRule(std::__1::basic_string ,std::__1::allocator >const&) call site: 00000 /src/ninja/src/eval_env.cc:50
0 0 None 74 2272 ManifestParser::ParseEdge(std::__1::basic_string ,std::__1::allocator >*) call site: 00000 /src/ninja/src/manifest_parser.cc:214
0 0 None 70 2093 ManifestParser::ParseEdge(std::__1::basic_string ,std::__1::allocator >*) call site: 00000 /src/ninja/src/manifest_parser.cc:230
0 0 None 64 1857 ManifestParser::ParseEdge(std::__1::basic_string ,std::__1::allocator >*) call site: 00000 /src/ninja/src/manifest_parser.cc:242
0 0 None 64 1833 ManifestParser::ParseEdge(std::__1::basic_string ,std::__1::allocator >*) call site: 00000 /src/ninja/src/manifest_parser.cc:246
0 0 None 58 1634 ManifestParser::ParseEdge(std::__1::basic_string ,std::__1::allocator >*) call site: 00000 /src/ninja/src/manifest_parser.cc:268

Runtime coverage analysis

Covered functions
92
Functions that are reachable but not covered
27
Reachable functions
67
Percentage of reachable functions covered
59.7%
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/ninja/misc/manifest_fuzzer.cc 1
/src/ninja/src/disk_interface.h 5
/src/ninja/src/state.cc 3
/src/ninja/src/eval_env.h 5
/src/ninja/src/eval_env.cc 2
/src/ninja/src/state.h 2
/src/ninja/src/manifest_parser.h 1
/src/ninja/src/manifest_parser.cc 1
/src/ninja/src/parser.h 1
/src/ninja/src/lexer.h 1
/src/ninja/src/string_piece.h 2
/src/ninja/src/parser.cc 1
/src/ninja/src/metrics.cc 3
/src/ninja/src/metrics.h 1
/src/ninja/src/lexer.cc 1

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
ManifestParser::Parse(std::__1::basic_string ,std::__1::allocator >const&,std::__1::basic_string ,std::__1::allocator >const&,std::__1::basic_string ,std::__1::allocator >*) /src/ninja/src/manifest_parser.cc 4 ['struct.ManifestParser *', 'class.std::__1::basic_string *', 'class.std::__1::basic_string *', 'class.std::__1::basic_string *'] 6 0 298 54 52 201 0 1009 905
DependencyScan::RecomputeNodeDirty(Node*,std::__1::vector >*,std::__1::vector >*,std::__1::basic_string ,std::__1::allocator >*) /src/ninja/src/graph.cc 5 ['struct.DependencyScan *', 'struct.Node *', 'class.std::__1::vector.49 *', 'class.std::__1::vector.49 *', 'class.std::__1::basic_string *'] 5 0 549 103 37 188 2 703 465
DyndepParser::Parse(std::__1::basic_string ,std::__1::allocator >const&,std::__1::basic_string ,std::__1::allocator >const&,std::__1::basic_string ,std::__1::allocator >*) /src/ninja/src/dyndep_parser.cc 4 ['struct.DyndepParser *', 'class.std::__1::basic_string *', 'class.std::__1::basic_string *', 'class.std::__1::basic_string *'] 3 0 263 41 37 80 0 531 234
DepsLog::Recompact(std::__1::basic_string ,std::__1::allocator >const&,std::__1::basic_string ,std::__1::allocator >*) /src/ninja/src/deps_log.cc 3 ['struct.DepsLog *', 'class.std::__1::basic_string *', 'class.std::__1::basic_string *'] 4 0 331 60 61 100 2 361 219
ParseMountInfo(std::__1::map ,std::__1::allocator >,CGroupSubSys,std::__1::less ,std::__1::allocator >>,std::__1::allocator ,std::__1::allocator >const,CGroupSubSys>>>&) /src/ninja/src/util.cc 2 ['class.std::__1::map.31 *', 'class.std::__1::map.31 *'] 2 0 299 61 52 28 2 122 111
BuildLog::Restat(StringPiece,DiskInterfaceconst&,int,char**,std::__1::basic_string ,std::__1::allocator >*) /src/ninja/src/build_log.cc 7 ['struct.BuildLog *', 'char *', 'size_t ', 'class.std::bad_alloc *', 'int ', 'char **', 'class.std::__1::basic_string *'] 3 0 426 76 68 37 0 139 81
BuildLog::OpenForWrite(std::__1::basic_string ,std::__1::allocator >const&,BuildLogUserconst&,std::__1::basic_string ,std::__1::allocator >*) /src/ninja/src/build_log.cc 4 ['struct.BuildLog *', 'class.std::__1::basic_string *', 'class.std::exception *', 'class.std::__1::basic_string *'] 4 0 68 13 4 38 0 136 66
DiskInterface::MakeDirs(std::__1::basic_string ,std::__1::allocator >const&) /src/ninja/src/disk_interface.cc 2 ['class.std::bad_alloc *', 'class.std::__1::basic_string *'] 3 0 125 19 20 10 1 53 49
ParseSelfCGroup() /src/ninja/src/util.cc 1 ['class.std::__1::map.31 *'] 2 0 198 39 36 20 2 72 42

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

Functions statically reachable by fuzzers
67.0%
191 / 285
Cyclomatic complexity statically reachable by fuzzers
82.0%
2132 / 2613

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
[] []
/usr/local/bin/../include/c++/v1/stdexcept [] []
/src/ninja/src/depfile_parser.h [] []
/src/ninja/src/dyndep_parser.cc [] []
/src/ninja/src/parser.h ['fuzzer'] ['fuzzer']
/src/ninja/src/deps_log.cc [] []
/src/ninja/src/eval_env.cc ['fuzzer'] ['fuzzer']
/src/ninja/src/metrics.cc ['fuzzer'] ['fuzzer']
/src/ninja/src/hash_map.h [] []
/src/ninja/src/string_piece_util.h [] []
/src/ninja/src/disk_interface.cc [] []
/src/ninja/src/lexer.h ['fuzzer'] ['fuzzer']
/src/ninja/src/util.cc [] []
/src/ninja/src/build_log.cc [] []
/src/ninja/src/dyndep.cc [] []
/src/ninja/src/depfile_parser.cc [] []
/src/ninja/src/metrics.h ['fuzzer'] []
/src/ninja/src/lexer.cc ['fuzzer'] ['fuzzer']
/src/ninja/misc/manifest_fuzzer.cc ['fuzzer'] ['fuzzer']
/src/ninja/src/version.cc [] []
/src/ninja/src/string_piece_util.cc [] []
/src/ninja/src/graph.h [] []
/src/ninja/src/deps_log.h [] []
/src/ninja/src/state.cc ['fuzzer'] ['fuzzer']
/src/ninja/src/graph.cc [] []
/src/ninja/src/parser.cc ['fuzzer'] ['fuzzer']
/src/ninja/src/dyndep.h [] []
/src/ninja/src/edit_distance.cc [] []
/src/ninja/src/string_piece.h ['fuzzer'] ['fuzzer']
/usr/local/bin/../include/c++/v1/math.h [] []
/src/ninja/src/state.h ['fuzzer'] ['fuzzer']
/src/ninja/src/manifest_parser.h ['fuzzer'] ['fuzzer']
/src/ninja/src/eval_env.h ['fuzzer'] ['fuzzer']
/src/ninja/src/dyndep_parser.h [] []
/src/ninja/src/manifest_parser.cc ['fuzzer'] ['fuzzer']
/src/ninja/src/disk_interface.h ['fuzzer'] ['fuzzer']

Directories in report

Directory
/usr/local/bin/../include/c++/v1/
/src/ninja/src/
/src/ninja/misc/