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

Project functions overview

The following table shows data about each function in the project. The functions included in this table correspond to all functions that exist in the executables of the fuzzers. As such, there may be functions that are from third-party libraries.

For further technical details on the meaning of columns in the below table, please see the Glossary .

Func name Functions filename Args Function call depth Reached by Fuzzers Runtime reached by Fuzzers Combined 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

Fuzzer details

Fuzzer: fuzz_parse

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 15 10.2%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 132 89.7%
All colors 147 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
0 42 2 :

['pugi::impl::(anonymous namespace)::strconv_escape(char*, pugi::impl::(anonymous namespace)::gap&)', 'pugi::impl::(anonymous namespace)::gap::push(char*&, unsigned long)']

0 52 pugi::impl::(anonymousnamespace)::strconv_pcdata_impl ::parse(char*) call site: 00000 /src/pugixml/src/pugixml.cpp:2744
0 0 None 12 345 pugi::impl::(anonymousnamespace)::xml_parser::parse_tree(char*,pugi::xml_node_struct*,unsignedint,char) call site: 00000 /src/pugixml/src/pugixml.cpp:3483
0 0 None 0 4 pugi::impl::(anonymousnamespace)::xml_parser::parse(char*,unsignedlong,pugi::impl::(anonymousnamespace)::xml_document_struct*,pugi::xml_node_struct*,unsignedint) call site: 00000 /src/pugixml/src/pugixml.cpp:3579
0 0 None 0 4 pugi::impl::(anonymousnamespace)::xml_parser::parse(char*,unsignedlong,pugi::impl::(anonymousnamespace)::xml_document_struct*,pugi::xml_node_struct*,unsignedint) call site: 00000 /src/pugixml/src/pugixml.cpp:3604
0 0 None 0 0 pugi::impl::(anonymousnamespace)::xml_allocator::allocate_memory_oob(unsignedlong,pugi::impl::(anonymousnamespace)::xml_memory_page*&) call site: 00000 /src/pugixml/src/pugixml.cpp:753
0 0 None 0 0 pugi::impl::(anonymousnamespace)::convert_buffer(char*&,unsignedlong&,pugi::xml_encoding,voidconst*,unsignedlong,bool) call site: 00000 /src/pugixml/src/pugixml.cpp:2323
0 0 None 0 0 pugi::impl::(anonymousnamespace)::get_mutable_buffer(char*&,unsignedlong&,voidconst*,unsignedlong,bool) call site: 00000 /src/pugixml/src/pugixml.cpp:2095
0 0 None 0 0 pugi::impl::(anonymousnamespace)::get_mutable_buffer(char*&,unsignedlong&,voidconst*,unsignedlong,bool) call site: 00000 /src/pugixml/src/pugixml.cpp:2105

Runtime coverage analysis

Covered functions
88
Functions that are reachable but not covered
8
Reachable functions
161
Percentage of reachable functions covered
95.03%
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.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
/src/pugixml/tests/fuzz_parse.cpp 1
/src/pugixml/src/pugixml.cpp 78

Fuzzer: fuzz_xpath

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 93 6.47%
gold [1:9] 11 0.76%
yellow [10:29] 4 0.27%
greenyellow [30:49] 8 0.55%
lawngreen 50+ 1320 91.9%
All colors 1436 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
6 6 3 :

['__cxa_allocate_exception', 'std::bad_alloc::bad_alloc()', '__cxa_throw']

6 20 pugi::xpath_query::evaluate_boolean(pugi::xpath_nodeconst&)const call site: 00000 /src/pugixml/src/pugixml.cpp:13297
6 6 3 :

['__cxa_allocate_exception', 'std::bad_alloc::bad_alloc()', '__cxa_throw']

6 20 pugi::xpath_query::evaluate_number(pugi::xpath_nodeconst&)const call site: 00000 /src/pugixml/src/pugixml.cpp:13318
6 6 3 :

['__cxa_allocate_exception', 'std::bad_alloc::bad_alloc()', '__cxa_throw']

6 20 pugi::xpath_query::evaluate_string(pugi::xpath_nodeconst&)const call site: 00000 /src/pugixml/src/pugixml.cpp:13340
6 6 3 :

['__cxa_allocate_exception', 'std::bad_alloc::bad_alloc()', '__cxa_throw']

6 20 pugi::xpath_query::evaluate_node_set(pugi::xpath_nodeconst&)const call site: 00000 /src/pugixml/src/pugixml.cpp:13393
6 6 3 :

['__cxa_allocate_exception', 'std::bad_alloc::bad_alloc()', '__cxa_throw']

6 20 pugi::xpath_query::evaluate_node(pugi::xpath_nodeconst&)const call site: 00000 /src/pugixml/src/pugixml.cpp:13415
0 42 2 :

['pugi::impl::(anonymous namespace)::strconv_escape(char*, pugi::impl::(anonymous namespace)::gap&)', 'pugi::impl::(anonymous namespace)::gap::push(char*&, unsigned long)']

0 52 pugi::impl::(anonymousnamespace)::strconv_pcdata_impl ::parse(char*) call site: 00000 /src/pugixml/src/pugixml.cpp:2744
0 9 2 :

['pugi::xml_attribute::next_attribute() const', 'pugi::xml_attribute::operator==(pugi::xml_attribute const&) const']

0 97 pugi::impl::(anonymousnamespace)::document_order_comparator::operator()(pugi::xpath_nodeconst&,pugi::xpath_nodeconst&)const call site: 00000 /src/pugixml/src/pugixml.cpp:8684
0 9 1 :

['pugi::impl::(anonymous namespace)::node_is_before_sibling(pugi::xml_node_struct*, pugi::xml_node_struct*)']

0 9 pugi::impl::(anonymousnamespace)::node_is_before(pugi::xml_node_struct*,pugi::xml_node_struct*) call site: 00000 /src/pugixml/src/pugixml.cpp:8620
0 0 None 12 501 pugi::xpath_query::xpath_query(charconst*,pugi::xpath_variable_set*) call site: 00000 /src/pugixml/src/pugixml.cpp:13212
0 0 None 4 82 pugi::impl::(anonymousnamespace)::xpath_parser::parse_primary_expression() call site: 00000 /src/pugixml/src/pugixml.cpp:12017
0 0 None 0 345 pugi::impl::(anonymousnamespace)::xml_parser::parse_tree(char*,pugi::xml_node_struct*,unsignedint,char) call site: 00000 /src/pugixml/src/pugixml.cpp:3483
0 0 None 0 154 pugi::impl::(anonymousnamespace)::string_value(pugi::xpath_nodeconst&,pugi::impl::(anonymousnamespace)::xpath_allocator*) call site: 00000 /src/pugixml/src/pugixml.cpp:8533

Runtime coverage analysis

Covered functions
376
Functions that are reachable but not covered
33
Reachable functions
774
Percentage of reachable functions covered
95.74%
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.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
/src/pugixml/tests/fuzz_xpath.cpp 1
/src/pugixml/src/pugixml.cpp 373
/usr/local/bin/../include/c++/v1/__exception/exception.h 1
/src/pugixml/src/pugixml.hpp 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
pugi::xml_document::save_file(wchar_tconst*,charconst*,unsignedint,pugi::xml_encoding)const /src/pugixml/src/pugixml.cpp 5 ['N/A', 'N/A', 'N/A', 'int', 'int'] 15 0 82 11 10 144 0 349 313
pugi::xml_text::operator=(unsignedlonglong) /src/pugixml/src/pugixml.cpp 2 ['N/A', 'size_t'] 10 0 20 3 2 64 0 120 78
pugi::xpath_variable_set::operator=(pugi::xpath_variable_setconst&) /src/pugixml/src/pugixml.cpp 2 ['N/A', 'N/A'] 9 0 35 6 3 86 0 187 56
pugi::as_wide(std::__1::basic_string ,std::__1::allocator >const&) /src/pugixml/src/pugixml.cpp 2 ['N/A', 'N/A'] 3 0 21 3 2 15 0 68 43
pugi::impl::(anonymousnamespace)::strconv_pcdata_impl ::parse(char*) /src/pugixml/src/pugixml.cpp 1 ['N/A'] 3 0 275 42 15 15 0 57 42
pugi::xml_document::load(std::__1::basic_istream >&,unsignedint) /src/pugixml/src/pugixml.cpp 4 ['N/A', 'N/A', 'N/A', 'int'] 12 0 28 3 2 170 0 665 39
pugi::xml_node::first_element_by_path(charconst*,char)const /src/pugixml/src/pugixml.cpp 3 ['N/A', 'N/A', 'char'] 3 0 279 46 18 17 1 56 36

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

Functions statically reachable by fuzzers
57.9%
479 / 823
Cyclomatic complexity statically reachable by fuzzers
71.0%
3430 / 4816

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 Runtime reached by Fuzzers Combined 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

Fuzz engine guidance

This sections provides heuristics that can be used as input to a fuzz engine when running a given fuzz target. The current focus is on providing input that is usable by libFuzzer.

/src/pugixml/tests/fuzz_parse.cpp

Dictionary

Use this with the libFuzzer -dict=DICT.file flag


Fuzzer function priority

Use one of these functions as input to libfuzzer with flag: -focus_function name

-focus_function=['pugi::impl::(anonymous namespace)::xml_parser::parse_tree(char*, pugi::xml_node_struct*, unsigned int, char)', 'LLVMFuzzerTestOneInput', 'pugi::impl::(anonymous namespace)::get_buffer_encoding(pugi::xml_encoding, void const*, unsigned long)', 'pugi::impl::(anonymous namespace)::auto_deleter::~auto_deleter()', 'pugi::impl::(anonymous namespace)::convert_buffer(char*&, unsigned long&, pugi::xml_encoding, void const*, unsigned long, bool)', 'pugi::impl::(anonymous namespace)::convert_buffer_latin1(char*&, unsigned long&, void const*, unsigned long, bool)', 'pugi::impl::(anonymous namespace)::load_buffer_impl(pugi::impl::(anonymous namespace)::xml_document_struct*, pugi::xml_node_struct*, void*, unsigned long, unsigned int, pugi::xml_encoding, bool, bool, char**)', 'pugi::impl::(anonymous namespace)::xml_parser::parse_tree(char*, pugi::xml_node_struct*, unsigned int, char)', 'pugi::impl::(anonymous namespace)::xml_parser::parse_tree(char*, pugi::xml_node_struct*, unsigned int, char)', 'pugi::impl::(anonymous namespace)::xml_allocator::allocate_page(unsigned long)']

/src/pugixml/tests/fuzz_xpath.cpp

Dictionary

Use this with the libFuzzer -dict=DICT.file flag


Fuzzer function priority

Use one of these functions as input to libfuzzer with flag: -focus_function name

-focus_function=['pugi::xml_node::parent() const', 'pugi::impl::(anonymous namespace)::xpath_query_impl::xpath_query_impl()', 'pugi::xpath_node_set::_assign(pugi::xpath_node const*, pugi::xpath_node const*, pugi::xpath_node_set::type_t)', 'pugi::impl::(anonymous namespace)::xml_parser::parse_tree(char*, pugi::xml_node_struct*, unsigned int, char)', 'pugi::impl::(anonymous namespace)::string_value(pugi::xpath_node const&, pugi::impl::(anonymous namespace)::xpath_allocator*)', 'bool pugi::impl::(anonymous namespace)::xpath_ast_node::compare_eq(pugi::impl::(anonymous namespace)::xpath_ast_node*, pugi::impl::(anonymous namespace)::xpath_ast_node*, pugi::impl::(anonymous namespace)::xpath_context const&, pugi::impl::(anonymous namespace)::xpath_stack const&, pugi::impl::(anonymous namespace)::equal_to const&)', 'pugi::xpath_query::evaluate_number(pugi::xpath_node const&) const', 'pugi::xpath_query::evaluate_string(pugi::xpath_node const&) const', 'pugi::xpath_query::evaluate_node(pugi::xpath_node const&) const', 'pugi::xpath_query::evaluate_node_set(pugi::xpath_node const&) const']

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
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)0>) 144 22 15.27% ['fuzz_xpath']
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_attribute_struct*,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)0>) 61 20 32.78% ['fuzz_xpath']
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)1>) 144 23 15.97% ['fuzz_xpath']
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_attribute_struct*,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)1>) 61 21 34.42% ['fuzz_xpath']
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)2>) 144 14 9.722% ['fuzz_xpath']
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)3>) 144 14 9.722% ['fuzz_xpath']
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)4>) 144 30 20.83% ['fuzz_xpath']
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)5>) 144 31 21.52% ['fuzz_xpath']
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_attribute_struct*,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)5>) 61 13 21.31% ['fuzz_xpath']
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)6>) 144 32 22.22% ['fuzz_xpath']
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_attribute_struct*,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)6>) 61 28 45.90% ['fuzz_xpath']
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)7>) 144 14 9.722% ['fuzz_xpath']
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)9>) 144 11 7.638% ['fuzz_xpath']
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_attribute_struct*,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)9>) 61 10 16.39% ['fuzz_xpath']
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)10>) 144 35 24.30% ['fuzz_xpath']
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_attribute_struct*,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)10>) 61 10 16.39% ['fuzz_xpath']
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)11>) 144 14 9.722% ['fuzz_xpath']
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)12>) 144 10 6.944% ['fuzz_xpath']
voidpugi::impl::(anonymousnamespace)::xpath_ast_node::step_fill >(pugi::impl::(anonymousnamespace)::xpath_node_set_raw&,pugi::xml_attribute_struct*,pugi::xml_node_struct*,pugi::impl::(anonymousnamespace)::xpath_allocator*,bool,pugi::impl::(anonymousnamespace)::axis_to_type<(pugi::impl::(anonymousnamespace)::axis_t)12>) 61 11 18.03% ['fuzz_xpath']