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

Fuzzer details

Fuzzer: re2_fuzzer

Call tree

The following is the call tree with color coding for which functions are hit/not hit. This info is based on the coverage achieved of all fuzzers together and not just this specific fuzzer. We use the following coloring scheme where min/max is an interval [min:max) (max non-inclusive) to color the callsite based on how many times the callsite is covered at run time.
Min Max Color
0 1 red
1 10 gold
10 30 yellow
30 50 greenyellow
50 1000000000000 lawngreen

For further technical details on the call tree overview, please see the Glossary .

The distribution of callsites in terms of coloring is
Color Callsite count Percentage
red 220 12.3%
gold 16 0.89%
yellow 24 1.34%
greenyellow 18 1.01%
lawngreen 1503 84.3%
All colors 1781 100

Full call tree

The following link provides a visualisation of the full call tree overlaid with coverage information: full call tree

For further technical details on how the call tree is generated, please see the Glossary .

Fuzz blockers

The followings nodes represent call sites where fuzz blockers occur.

Amount of callsites blocked Calltree index Parent function Callsite Largest blocked function
9 740 re2::RE2::Init(re2::StringPiece const&, re2::RE2::Options const&) call site _ZNK3re211StringPiececvNSt3__112basic_stringIcNS1_11char_traitsIcEET_EEINS1_9allocatorIcEEEEv
8 914 re2::SparseSetT ::InsertInternal(bool, int) call site
8 1682 re2::NFA::Step(re2::SparseArray *, re2::SparseArray *, int, re2::StringPiece const&, char const*) call site
7 315 re2::CharClassBuilder::AddRangeFlags(int, int, re2::Regexp::ParseFlags) call site
7 1408 re2::DFA::WorkqToCachedState(re2::DFA::Workq*, re2::DFA::Workq*, unsigned int) call site
7 1456 re2::RE2::Match(re2::StringPiece const&, unsigned long, unsigned long, re2::RE2::Anchor, re2::StringPiece*, int) const call site
7 1742 re2::RE2::Rewrite(std::__1::basic_string , std::__1::allocator >*, re2::StringPiece const&, re2::StringPiece const*, int) const call site
6 253 re2::Regexp::nrunes() call site memcmp
5 188 re2::Regexp::AlternateNoFactor(re2::Regexp**, int, re2::Regexp::ParseFlags) call site
5 907 re2::SparseSetT ::insert(int) call site
5 1443 re2::Prog::SearchDFA(re2::StringPiece const&, re2::StringPiece const&, re2::Prog::Anchor, re2::Prog::MatchKind, re2::StringPiece*, bool*, re2::SparseSetT *) call site
5 1449 re2::RE2::Match(re2::StringPiece const&, unsigned long, unsigned long, re2::RE2::Anchor, re2::StringPiece*, int) const call site

Runtime coverage analysis

Covered functions
658
Functions that are reachable but not covered
61
Reachable functions
503
Percentage of reachable functions covered
87.87%
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/re2/re2/fuzzing/re2_fuzzer.cc 4
/src/re2/./re2/re2.h 43
/src/re2/./re2/stringpiece.h 10
/src/re2/re2/parse.cc 62
/src/re2/re2/re2.cc 30
/src/re2/./re2/regexp.h 35
/src/re2/./util/logging.h 3
/src/re2/util/rune.cc 3
/src/re2/re2/regexp.cc 35
/src/re2/./util/mutex.h 9
/src/re2/re2/simplify.cc 4
/src/re2/./re2/pod_array.h 55
/src/re2/re2/tostring.cc 2
/src/re2/./re2/walker-inl.h 15
/src/re2/re2/stringpiece.cc 2
/usr/include/ctype.h 1
/src/re2/re2/compile.cc 16
/src/re2/re2/prog.cc 26
/src/re2/./re2/prog.h 38
/src/re2/./re2/sparse_set.h 13
/src/re2/./re2/sparse_array.h 31
/src/re2/./re2/bitmap256.h 6
/src/re2/re2/dfa.cc 24
/src/re2/re2/onepass.cc 6
/src/re2/re2/nfa.cc 11
/src/re2/re2/bitstate.cc 8

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
re2::Compiler::PostVisit(re2::Regexp*,re2::Frag,re2::Frag,re2::Frag*,int) /src/re2/re2/compile.cc 8 ['class.re2::Compiler *', 'class.re2::Regexp *', 'size_t ', 'size_t ', 'size_t ', 'size_t ', 'struct.re2::Frag *', 'int '] 8 0 817 90 20 72 0 269 177
re2::SimplifyWalker::PostVisit(re2::Regexp*,re2::Regexp*,re2::Regexp*,re2::Regexp**,int) /src/re2/re2/simplify.cc 6 ['class.re2::SimplifyWalker *', 'class.re2::Regexp *', 'class.re2::Regexp *', 'class.re2::Regexp *', 'class.re2::Regexp **', 'int '] 11 0 319 60 4 87 0 545 107
re2::DFA::SearchTFF(re2::DFA::SearchParams*) /src/re2/re2/dfa.cc 2 ['class.re2::DFA *', 'struct.re2::DFA::SearchParams *'] 7 0 14 3 2 66 0 261 100
re2::Prog::DumpUnanchored() /src/re2/re2/prog.cc 2 ['class.std::__1::basic_string *', 'class.re2::Prog *'] 5 0 51 9 9 33 0 155 93
re2::Prog::CompileSet(re2::Regexp*,re2::RE2::Anchor,long) /src/re2/re2/compile.cc 3 ['class.re2::Regexp *', 'int ', 'size_t '] 8 0 15 3 2 198 0 838 75
re2::CoalesceWalker::PostVisit(re2::Regexp*,re2::Regexp*,re2::Regexp*,re2::Regexp**,int) /src/re2/re2/simplify.cc 6 ['class.re2::SimplifyWalker *', 'class.re2::Regexp *', 'class.re2::Regexp *', 'class.re2::Regexp *', 'class.re2::Regexp **', 'int '] 7 0 383 73 22 44 0 194 48
re2::DFA::DumpState(re2::DFA::State*) /src/re2/re2/dfa.cc 2 ['class.std::__1::basic_string *', 'struct.re2::DFA::State *'] 3 0 184 40 40 3 0 53 40
re2::ToStringWalker::PostVisit(re2::Regexp*,int,int,int*,int) /src/re2/re2/tostring.cc 6 ['class.re2::ToStringWalker *', 'class.re2::Regexp *', 'int ', 'int ', 'int *', 'int '] 6 0 570 101 19 26 0 96 39
re2::Prog::GetDFA(re2::Prog::MatchKind)::$_2::operator()(re2::Prog*)const /src/re2/re2/dfa.cc 1 ['class.re2::Prog *'] 5 0 55 11 11 18 0 68 39
boolre2::RE2::Arg::DoParse4ary (charconst*,unsignedlong,void*) /src/re2/./re2/re2.h 3 ['char *', 'size_t ', 'char *'] 5 0 16 3 2 7 2 39 37

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

Functions statically reachable by fuzzers
71.34%
595/834
Cyclomatic complexity statically reachable by fuzzers
77.62%
3195 / 4116

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

Runtime coverage analysis

This section shows analysis of runtime coverage data.

For futher technical details on how this section is generated, please see the Glossary .

Complex functions with low coverage

Func name Function total lines Lines covered at runtime percentage covered Reached by fuzzers
re2::BitState::Search(re2::StringPiececonst&,re2::StringPiececonst&,bool,bool,re2::StringPiece*,int) 64 27 42.18% ['re2_fuzzer']
re2::Compiler::PostVisit(re2::Regexp*,re2::Frag,re2::Frag,re2::Frag*,int) 144 77 53.47% []
re2::DFA::DFA(re2::Prog*,re2::Prog::MatchKind,long) 42 23 54.76% []
re2::DFA::WorkqToCachedState(re2::DFA::Workq*,re2::DFA::Workq*,unsignedint) 131 68 51.90% ['re2_fuzzer']
re2::DFA::RunStateOnByte(re2::DFA::State*,int) 92 46 50.0% []
re2::DFA::Search(re2::StringPiececonst&,re2::StringPiececonst&,bool,bool,bool,bool*,charconst**,re2::SparseSetT *) 44 21 47.72% ['re2_fuzzer']
re2::DFA::PossibleMatchRange(std::__1::basic_string ,std::__1::allocator >*,std::__1::basic_string ,std::__1::allocator >*,int) 135 68 50.37% []
boolre2::DFA::InlinedSearchLoop (re2::DFA::SearchParams*) 222 76 34.23% []
boolre2::DFA::InlinedSearchLoop (re2::DFA::SearchParams*) 222 82 36.93% []
boolre2::DFA::InlinedSearchLoop (re2::DFA::SearchParams*) 222 79 35.58% []
boolre2::DFA::InlinedSearchLoop (re2::DFA::SearchParams*) 222 70 31.53% []
boolre2::DFA::InlinedSearchLoop (re2::DFA::SearchParams*) 222 88 39.63% []
boolre2::DFA::InlinedSearchLoop (re2::DFA::SearchParams*) 222 76 34.23% []
re2::NFA::Step(re2::SparseArray *,re2::SparseArray *,int,re2::StringPiececonst&,charconst*) 99 51 51.51% ['re2_fuzzer']
re2::NFA::Search(re2::StringPiececonst&,re2::StringPiececonst&,bool,bool,re2::StringPiece*,int) 180 80 44.44% ['re2_fuzzer']
re2::ParseUnicodeGroup(re2::StringPiece*,re2::Regexp::ParseFlags,re2::CharClassBuilder*,re2::RegexpStatus*) 84 45 53.57% ['re2_fuzzer']
re2::Prog::PrefixAccel_FrontAndBack(voidconst*,unsignedlong) 44 13 29.54% ['re2_fuzzer']
re2::BuildShiftDFA(std::__1::basic_string ,std::__1::allocator >) 78 41 52.56% ['re2_fuzzer']
re2::RE2::QuoteMeta(re2::StringPiececonst&) 37 19 51.35% ['re2_fuzzer']
re2::RE2::Match(re2::StringPiececonst&,unsignedlong,unsignedlong,re2::RE2::Anchor,re2::StringPiece*,int)const 254 129 50.78% ['re2_fuzzer']
re2::RE2::Rewrite(std::__1::basic_string ,std::__1::allocator >*,re2::StringPiececonst&,re2::StringPiececonst*,int)const 31 5 16.12% ['re2_fuzzer']
re2::Regexp::ConcatOrAlternate(re2::RegexpOp,re2::Regexp**,int,re2::Regexp::ParseFlags,bool) 46 23 50.0% ['re2_fuzzer']
re2::Regexp::Equal(re2::Regexp*,re2::Regexp*) 79 35 44.30% ['re2_fuzzer']
re2::TopEqual(re2::Regexp*,re2::Regexp*) 64 30 46.87% ['re2_fuzzer']
re2::runetochar(char*,intconst*) 54 25 46.29% ['re2_fuzzer']

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/re2/./util/logging.h ['re2_fuzzer'] []
/src/re2/re2/regexp.cc ['re2_fuzzer'] ['re2_fuzzer']
/src/re2/./re2/walker-inl.h ['re2_fuzzer'] []
/src/re2/re2/nfa.cc ['re2_fuzzer'] ['re2_fuzzer']
/src/re2/util/strutil.cc [] []
/src/re2/./util/mix.h [] []
/src/re2/re2/dfa.cc ['re2_fuzzer'] ['re2_fuzzer']
/usr/local/bin/../include/c++/v1/exception [] []
/src/re2/re2/bitstate.cc ['re2_fuzzer'] ['re2_fuzzer']
/src/re2/./re2/bitmap256.h ['re2_fuzzer'] []
/src/re2/re2/simplify.cc ['re2_fuzzer'] ['re2_fuzzer']
/src/re2/re2/parse.cc ['re2_fuzzer'] ['re2_fuzzer']
/src/re2/./re2/prog.h ['re2_fuzzer'] []
/src/re2/re2/onepass.cc ['re2_fuzzer'] ['re2_fuzzer']
/src/re2/./re2/regexp.h ['re2_fuzzer'] []
/src/re2/./re2/sparse_set.h ['re2_fuzzer'] []
/src/re2/re2/stringpiece.cc ['re2_fuzzer'] ['re2_fuzzer']
/src/re2/./re2/pod_array.h ['re2_fuzzer'] []
/src/re2/./re2/re2.h ['re2_fuzzer'] []
/src/re2/./re2/sparse_array.h ['re2_fuzzer'] []
/src/re2/./util/mutex.h ['re2_fuzzer'] []
/src/re2/re2/compile.cc ['re2_fuzzer'] ['re2_fuzzer']
/usr/local/bin/../include/c++/v1/math.h [] []
/src/re2/re2/prog.cc ['re2_fuzzer'] ['re2_fuzzer']
/src/re2/re2/re2.cc ['re2_fuzzer'] ['re2_fuzzer']
/src/re2/./re2/stringpiece.h ['re2_fuzzer'] []
/src/re2/re2/tostring.cc ['re2_fuzzer'] []
/usr/include/ctype.h ['re2_fuzzer'] []
/src/re2/util/rune.cc ['re2_fuzzer'] ['re2_fuzzer']
/src/re2/re2/fuzzing/re2_fuzzer.cc ['re2_fuzzer'] ['re2_fuzzer']

Directories in report

Directory
/src/re2/./util/
/src/re2/re2/fuzzing/
/src/re2/./re2/
/src/re2/util/
/usr/include/
/usr/local/bin/../include/c++/v1/
/src/re2/re2/