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

Fuzzer details

Fuzzer: 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 386 29.2%
gold [1:9] 98 7.41%
yellow [10:29] 56 4.23%
greenyellow [30:49] 4 0.30%
lawngreen 50+ 777 58.8%
All colors 1321 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 10 4 :

['__cxa_throw', '__cxa_free_exception', '__cxa_allocate_exception', 'spirv_cross::CompilerError::CompilerError(char const*)']

6 16 spirv_cross::ParsedIR::add_typed_id(spirv_cross::Types,spirv_cross::TypedID<(spirv_cross::Types)0>) call site: 00000 /src/spirv-cross/spirv_cross_parsed_ir.cpp:936
6 10 4 :

['__cxa_throw', '__cxa_free_exception', '__cxa_allocate_exception', 'spirv_cross::CompilerError::CompilerError(char const*)']

6 10 spirv_cross::SPIRTypeconst&spirv_cross::Variant::get ()const call site: 00000 /src/spirv-cross/spirv_common.hpp:1563
6 10 4 :

['__cxa_throw', '__cxa_free_exception', '__cxa_allocate_exception', 'spirv_cross::CompilerError::CompilerError(char const*)']

6 10 spirv_cross::Parser::stream(spirv_cross::Instructionconst&)const call site: 00000 /src/spirv-cross/spirv_parser.cpp:156
6 10 4 :

['__cxa_throw', '__cxa_free_exception', '__cxa_allocate_exception', 'spirv_cross::CompilerError::CompilerError(char const*)']

6 10 spirv_cross::Parser::parse(spirv_cross::Instructionconst&) call site: 00000 /src/spirv-cross/spirv_parser.cpp:261
6 6 1 :

['spirv_cross::Meta::Decoration::~Decoration()']

6 6 spirv_cross::SmallVector ::resize(unsignedlong) call site: 00000 /src/spirv-cross/spirv_cross_containers.hpp:513
2 4 3 :

['spirv_cross::VectorView >::end()', 'spirv_cross::TypedID<(spirv_cross::Types)0>* std::__1::move[abi:ne180100] *, spirv_cross::TypedID<(spirv_cross::Types)0>*>(spirv_cross::TypedID<(spirv_cross::Types)0>*, spirv_cross::TypedID<(spirv_cross::Types)0>*, spirv_cross::TypedID<(spirv_cross::Types)0>*)', '__clang_call_terminate']

2 26 spirv_cross::SmallVector ,8ul>::erase(spirv_cross::TypedID<(spirv_cross::Types)0>*,spirv_cross::TypedID<(spirv_cross::Types)0>*) call site: 00000 /src/spirv-cross/spirv_cross_containers.hpp:499
2 2 2 :

['std::__1::unique_ptr >::operator->[abi:ne180100]() const', '__clang_call_terminate']

2 2 spirv_cross::Variant::operator=(spirv_cross::Variant&&) call site: 00000 /src/spirv-cross/spirv_common.hpp:1484
0 42 5 :

['spirv_cross::SmallVector ::push_back(spirv_cross::SPIRConstant*&&)', 'malloc', 'void spirv_cross::SmallVector ::MallocDeleter>, 8ul>::emplace_back (spirv_cross::SPIRConstant*&)', 'spirv_cross::SmallVector ::reserve(unsigned long)', 'spirv_cross::VectorView ::MallocDeleter> >::size() const']

0 127 spirv_cross::SPIRConstant*spirv_cross::ObjectPool ::allocate (unsignedint&,unsignedintconst*&&,unsignedint&&,bool&&) call site: 00000 /src/spirv-cross/spirv_cross_containers.hpp:572
0 29 1 :

['spirv_cross::SPIRConstantOp& spirv_cross::Parser::get (unsigned int)']

0 29 spirv_cross::SPIRConstantOp*spirv_cross::Parser::maybe_get (unsignedint) call site: 00000 /src/spirv-cross/spirv_parser.hpp:73
0 29 1 :

['spirv_cross::SPIRUndef& spirv_cross::Parser::get (unsigned int)']

0 29 spirv_cross::SPIRUndef*spirv_cross::Parser::maybe_get (unsignedint) call site: 00000 /src/spirv-cross/spirv_parser.hpp:73
0 16 2 :

['spirv_cross::TypedID<(spirv_cross::Types)0>::TypedID()', 'spirv_cross::SmallVector , 8ul>::reserve(unsigned long)']

0 16 spirv_cross::SmallVector ,8ul>::resize(unsignedlong) call site: 00000 /src/spirv-cross/spirv_cross_containers.hpp:513
0 16 1 :

['spirv_cross::SmallVector ::push_back(spirv_cross::Instruction const&)']

0 16 spirv_cross::Parser::parse(spirv_cross::Instructionconst&) call site: 00000 /src/spirv-cross/spirv_parser.cpp:1268

Runtime coverage analysis

Covered functions
635
Functions that are reachable but not covered
60
Reachable functions
1117
Percentage of reachable functions covered
94.63%
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/parser_fuzzer.cpp 1
/src/spirv-cross/spirv_parser.cpp 11
/src/spirv-cross/spirv_cross_parsed_ir.cpp 23
/src/spirv-cross/spirv_cross_containers.hpp 363
/src/spirv-cross/spirv_common.hpp 120
/src/spirv-cross/spirv_cross_parsed_ir.hpp 5
/src/spirv-cross/spirv_parser.hpp 29
/src/spirv-cross/spirv_cross_error_handling.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
spirv_cross::Parser::variable_storage_is_aliased(spirv_cross::SPIRVariableconst&)const /src/spirv-cross/spirv_parser.cpp 2 ['N/A', 'N/A'] 6 0 164 23 6 64 0 140 87
spirv_cross::SPIRFunction::clone(spirv_cross::ObjectPoolBase*) /src/spirv-cross/spirv_common.hpp 2 ['N/A', 'N/A'] 7 0 20 3 2 114 0 191 66
spirv_cross::ParsedIR::fixup_reserved_names() /src/spirv-cross/spirv_cross_parsed_ir.cpp 1 ['N/A'] 6 0 123 16 6 45 0 99 43
spirv_cross::Meta::Meta(spirv_cross::Metaconst&) /src/spirv-cross/spirv_common.hpp 2 ['N/A', 'N/A'] 6 0 55 6 6 36 0 70 42
spirv_cross::SPIRBlock::clone(spirv_cross::ObjectPoolBase*) /src/spirv-cross/spirv_common.hpp 2 ['N/A', 'N/A'] 7 0 20 3 2 114 0 192 41
spirv_cross::ParsedIR::ParsedIR(spirv_cross::ParsedIR&&) /src/spirv-cross/spirv_cross_parsed_ir.cpp 2 ['N/A', 'N/A'] 7 0 85 8 9 76 0 155 38

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

Functions statically reachable by fuzzers
76.0%
625 / 824
Cyclomatic complexity statically reachable by fuzzers
82.0%
2400 / 2928

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