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

Fuzzer details

Fuzzer: xml_parser_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 25 30.1%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 58 69.8%
All colors 83 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
135 1716 13 :

['lookup', 'processInternalEntity', 'reportComment', 'poolClear', 'storeAtts', 'getContext', 'memcmp', 'reportDefault', 'XmlUtf8Encode', 'doCdataSection', 'poolStoreString', 'freeBindings', 'reportProcessingInstruction']

135 1860 doContent call site: 00000 /src/CMake/Utilities/cmexpat/lib/xmlparse.c:2999
135 1716 13 :

['lookup', 'processInternalEntity', 'reportComment', 'poolClear', 'storeAtts', 'getContext', 'memcmp', 'reportDefault', 'XmlUtf8Encode', 'doCdataSection', 'poolStoreString', 'freeBindings', 'reportProcessingInstruction']

135 1860 doContent call site: 00000 /src/CMake/Utilities/cmexpat/lib/xmlparse.c:3060
7 73 3 :

['poolStoreString', 'normalizeLines', 'poolClear']

7 73 reportProcessingInstruction call site: 00000 /src/CMake/Utilities/cmexpat/lib/xmlparse.c:6146
7 42 3 :

['poolStoreString', 'normalizeLines', 'poolClear']

7 42 reportComment call site: 00000 /src/CMake/Utilities/cmexpat/lib/xmlparse.c:6171
4 4 2 :

['__errno_location', 'strtoul']

4 4 getDebugLevel call site: 00016 /src/CMake/Utilities/cmexpat/lib/xmlparse.c:8241
0 180 2 :

['lookup', 'poolGrow']

0 180 getAttributeId call site: 00000 /src/CMake/Utilities/cmexpat/lib/xmlparse.c:6344
0 124 1 :

['little2_prologTok']

0 124 initScan call site: 00000 /src/CMake/Utilities/cmexpat/lib/xmltok.c:1625
0 34 1 :

['XML_ParserFree']

0 34 parserCreate call site: 00000 /src/CMake/Utilities/cmexpat/lib/xmlparse.c:1068
0 0 None 589 1178 cdataSectionProcessor call site: 00000 /src/CMake/Utilities/cmexpat/lib/xmlparse.c:3869
0 0 None 135 1860 doContent call site: 00000 /src/CMake/Utilities/cmexpat/lib/xmlparse.c:2831
0 0 None 135 1860 doContent call site: 00000 /src/CMake/Utilities/cmexpat/lib/xmlparse.c:2853
0 0 None 135 1860 doContent call site: 00000 /src/CMake/Utilities/cmexpat/lib/xmlparse.c:2865

Runtime coverage analysis

Covered functions
192
Functions that are reachable but not covered
21
Reachable functions
66
Percentage of reachable functions covered
68.18%
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/CMake/Tests/Fuzzing/xml_parser_fuzzer.cc 1
/src/CMake/Source/cmXMLParser.cxx 6
/src/CMake/Utilities/cmexpat/lib/xmlparse.c 32
/src/CMake/Utilities/cmexpat/lib/siphash.h 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
XML_ExternalEntityParserCreate /src/CMake/Utilities/cmexpat/lib/xmlparse.c 3 ['struct.XML_ParserStruct *', 'char *', 'char *'] 14 0 248 22 9 153 0 1647 1439
normal_contentTok /src/CMake/Utilities/cmexpat/lib/xmltok_impl.c 4 ['struct.encoding *', 'char *', 'char *', 'char **'] 2 0 434 88 25 10 0 220 220
big2_contentTok /src/CMake/Utilities/cmexpat/lib/xmltok_impl.c 4 ['struct.encoding *', 'char *', 'char *', 'char **'] 3 0 464 93 27 11 0 184 167
little2_contentTok /src/CMake/Utilities/cmexpat/lib/xmltok_impl.c 4 ['struct.encoding *', 'char *', 'char *', 'char **'] 3 0 460 93 27 11 0 184 126
normal_prologTok /src/CMake/Utilities/cmexpat/lib/xmltok_impl.c 4 ['struct.encoding *', 'char *', 'char *', 'char **'] 1 0 809 165 34 7 0 155 89
big2_prologTok /src/CMake/Utilities/cmexpat/lib/xmltok_impl.c 4 ['struct.encoding *', 'char *', 'char *', 'char **'] 2 0 807 162 30 8 0 124 66
cmXMLParser::Parse(charconst*) /src/CMake/Source/cmXMLParser.cxx 2 ['class.cmXMLParser *', 'char *'] 12 0 56 8 4 192 0 1734 39

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

Functions statically reachable by fuzzers
66.0%
225 / 341
Cyclomatic complexity statically reachable by fuzzers
79.0%
2483 / 3163

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