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 13 8.84%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 134 91.1%
All colors 147 100

Fuzz blockers

The following nodes represent call sites where fuzz blockers occur.

Amount of callsites blocked Calltree index Parent function Callsite Largest blocked function
5 129 pugi::impl::(anonymous namespace)::xml_parser::parse_tree(char*, pugi::xml_node_struct*, unsigned int, char) call site: 00129 __assert_fail
1 9 pugi::impl::(anonymous namespace)::xml_document_struct::xml_document_struct(pugi::impl::(anonymous namespace)::xml_memory_page*) call site: 00009 __assert_fail
1 23 pugi::impl::(anonymous namespace)::get_buffer_encoding(pugi::xml_encoding, void const*, unsigned long) call site: 00023
1 32 pugi::impl::(anonymous namespace)::auto_deleter ::~auto_deleter() call site: 00032 __cxa_begin_catch
1 77 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**) call site: 00077
1 82 pugi::impl::(anonymous namespace)::xml_parser::parse_tree(char*, pugi::xml_node_struct*, unsigned int, char) call site: 00082 __assert_fail
1 84 pugi::impl::(anonymous namespace)::xml_parser::parse_tree(char*, pugi::xml_node_struct*, unsigned int, char) call site: 00084 __assert_fail
1 95 pugi::impl::(anonymous namespace)::xml_allocator::allocate_page(unsigned long) call site: 00095 __assert_fail
1 138 pugi::impl::(anonymous namespace)::xml_parser::parse(char*, unsigned long, pugi::impl::(anonymous namespace)::xml_document_struct*, pugi::xml_node_struct*, unsigned int) call site: 00138

Runtime coverage analysis

Covered functions
85
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 95 6.58%
gold [1:9] 11 0.76%
yellow [10:29] 3 0.20%
greenyellow [30:49] 10 0.69%
lawngreen 50+ 1323 91.7%
All colors 1442 100

Fuzz blockers

The following nodes represent call sites where fuzz blockers occur.

Amount of callsites blocked Calltree index Parent function Callsite Largest blocked function
6 600 pugi::xml_node::parent() const call site: 00600
4 34 pugi::impl::(anonymous namespace)::xpath_query_impl::xpath_query_impl() call site: 00034 __cxa_allocate_exception
4 928 pugi::impl::(anonymous namespace)::xpath_ast_node::eval_node_set(pugi::impl::(anonymous namespace)::xpath_context const&, pugi::impl::(anonymous namespace)::xpath_stack const&, pugi::impl::(anonymous namespace)::nodeset_eval_t) call site: 00928 __cxa_guard_acquire
4 1415 pugi::xpath_node_set::_assign(pugi::xpath_node const*, pugi::xpath_node const*, pugi::xpath_node_set::type_t) call site: 01415 __cxa_allocate_exception
3 510 pugi::impl::(anonymous namespace)::xml_parser::parse_tree(char*, pugi::xml_node_struct*, unsigned int, char) call site: 00510 __assert_fail
3 684 pugi::impl::(anonymous namespace)::string_value(pugi::xpath_node const&, pugi::impl::(anonymous namespace)::xpath_allocator*) call site: 00684
3 1349 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&) call site: 01349 __cxa_allocate_exception
3 1362 pugi::xpath_query::evaluate_number(pugi::xpath_node const&) const call site: 01362 __cxa_allocate_exception
3 1371 pugi::xpath_query::evaluate_string(pugi::xpath_node const&) const call site: 01371 __cxa_allocate_exception
3 1392 pugi::xpath_query::evaluate_node(pugi::xpath_node const&) const call site: 01392 __cxa_allocate_exception
3 1404 pugi::xpath_query::evaluate_node_set(pugi::xpath_node const&) const call site: 01404 __cxa_allocate_exception
2 18 pugi::xpath_node_set::xpath_node_set() call site: 00018

Runtime coverage analysis

Covered functions
376
Functions that are reachable but not covered
37
Reachable functions
778
Percentage of reachable functions covered
95.24%
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 76 11 10 144 0 349 313
pugi::xml_text::operator=(unsignedlonglong) /src/pugixml/src/pugixml.cpp 2 ['N/A', 'size_t'] 10 0 18 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 33 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 20 3 2 15 0 68 43
pugi::impl::(anonymousnamespace)::strconv_pcdata_impl ::parse(char*) /src/pugixml/src/pugixml.cpp 1 ['N/A'] 3 0 269 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 25 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 269 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 / 821
Cyclomatic complexity statically reachable by fuzzers
71.0%
3431 / 4813

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)', 'pugi::impl::(anonymous namespace)::xml_document_struct::xml_document_struct(pugi::impl::(anonymous namespace)::xml_memory_page*)', '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)::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)', 'pugi::impl::(anonymous namespace)::xml_parser::parse(char*, unsigned long, pugi::impl::(anonymous namespace)::xml_document_struct*, pugi::xml_node_struct*, unsigned int)']

/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::impl::(anonymous namespace)::xpath_ast_node::eval_node_set(pugi::impl::(anonymous namespace)::xpath_context const&, pugi::impl::(anonymous namespace)::xpath_stack const&, pugi::impl::(anonymous namespace)::nodeset_eval_t)', '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']

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>) 143 22 15.38% ['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>) 60 20 33.33% ['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>) 143 23 16.08% ['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>) 60 21 35.0% ['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>) 143 14 9.790% ['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>) 143 14 9.790% ['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>) 143 30 20.97% ['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>) 143 31 21.67% ['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>) 60 13 21.66% ['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>) 143 32 22.37% ['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>) 60 28 46.66% ['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>) 143 14 9.790% ['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>) 143 11 7.692% ['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>) 60 10 16.66% ['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>) 143 35 24.47% ['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>) 60 10 16.66% ['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>) 143 14 9.790% ['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>) 143 10 6.993% ['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>) 60 11 18.33% ['fuzz_xpath']