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: pybind_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 335 49.6%
gold [1:9] 90 13.3%
yellow [10:29] 6 0.88%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 244 36.1%
All colors 675 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
116 155 pybind11::detail::error_fetch_and_normalize::error_fetch_and_normalize(char const*) call site: 00155 _ZN8pybind114castINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEETnNS1_9enable_ifIXaantsr6detail11is_pyobjectIT_EE5valuentsr6detail22is_same_ignoring_cvrefIS9_P7_objectEE5valueEiE4typeELi0EEES9_RKNS_6handleE
38 272 pybind11::error_already_set::error_already_set() call site: 00272 _ZN8pybind113strC2INS_6handleETnNSt3__19enable_ifIXaantsr3std10is_base_ofINS_6objectENS_6detail12remove_cvrefIT_E4typeEEE5valuesr3std16is_constructibleIS2_S8_EE5valueEiE4typeELi0EEEOS8_
16 99 pybind11::detail::get_python_state_dict() call site: 00099 PyErr_Fetch
8 141 pybind11::detail::error_fetch_and_normalize::error_fetch_and_normalize(char const*) call site: 00141 PyObject_Str
8 559 pybind11::object::release() call site: 00559 PySequence_Tuple
7 28 pybind11::initialize_interpreter(PyConfig*, int, char const* const*, bool) call site: 00028 PyConfig_Clear
7 357 pybind11::detail::dict_setdefaultstring(_object*, char const*, _object*) call site: 00357 __cxa_allocate_exception
7 466 pybind11::object pybind11::eval<(pybind11::eval_mode)2>(pybind11::str const&, pybind11::object, pybind11::object) call site: 00466 _ZN8pybind116handleC2IP7_objectTnNSt3__19enable_ifIXsr6detail25is_pyobj_ptr_or_nullptr_tIT_EE5valueEiE4typeELi0EEES6_
6 12 pybind11::detail::precheck_interpreter() call site: 00012 __cxa_allocate_exception
6 20 pybind11::initialize_interpreter(PyConfig*, int, char const* const*, bool) call site: 00020 PyConfig_Clear
6 120 pybind11::detail::error_fetch_and_normalize::error_fetch_and_normalize(char const*) call site: 00120 __cxa_allocate_exception
6 552 pybind11::typing::Tuple , std::__1::allocator > const&, pybind11::none> pybind11::make_tuple<(pybind11::return_value_policy)1, std::__1::basic_string , std::__1::allocator > const&, pybind11::none>(std::__1::basic_string , std::__1::allocator > const&, pybind11::none&&) call site: 00552

Runtime coverage analysis

Covered functions
151
Functions that are reachable but not covered
196
Reachable functions
458
Percentage of reachable functions covered
57.21%
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/pybind11/tests/fuzz/pybind_fuzzer.cpp 4
/src/pybind11/tests/fuzz/fuzz_input.h 3
/src/pybind11/include/pybind11/embed.h 6
/src/pybind11/include/pybind11/detail/common-inl.h 2
/src/pybind11/include/pybind11/detail/internals-inl.h 6
/src/pybind11/include/pybind11/detail/internals.h 22
/src/pybind11/include/pybind11/gil_simple.h 2
/src/pybind11/include/pybind11/detail/common.h 5
/src/pybind11/include/pybind11/pytypes.h 64
/usr/local/include/python3.11/object.h 10
/src/pybind11/include/pybind11/pytypes-inl.h 6
/src/pybind11/include/pybind11/pybind11-inl.h 3
/usr/local/bin/../include/c++/v1/__exception/exception.h 1
/src/pybind11/include/pybind11/cast.h 28
/src/pybind11/include/pybind11/pybind11.h 1
/src/pybind11/include/pybind11/eval.h 4
/usr/local/include/python3.11/cpython/tupleobject.h 1
/src/pybind11/include/pybind11/detail/argument_vector.h 27

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
pybind11::cpp_function::dispatcher(_object*,_object*const*,unsignedlong,_object*) /src/pybind11/include/pybind11/pybind11-inl.h 4 ['N/A', 'N/A', 'size_t', 'N/A'] 23 0 2100 474 460 674 0 2596 1734
pybind11::detail::translate_exception(std::exception_ptr) /src/pybind11/include/pybind11/detail/internals-inl.h 1 ['N/A'] 26 0 388 87 64 185 11 692 164
pybind11::detail::function_record_PyTypeObject_methods::reduce_ex_impl(_object*,_object*,_object*) /src/pybind11/include/pybind11/detail/function_record_pyobject.h 3 ['N/A', 'N/A', 'N/A'] 22 0 259 53 46 329 0 1029 156
pybind11_object_dealloc /src/pybind11/include/pybind11/detail/class-inl.h 1 ['N/A'] 20 0 28 6 3 515 0 1855 85
pybind11::error_already_set::m_fetched_error_deleter(pybind11::detail::error_fetch_and_normalize*) /src/pybind11/include/pybind11/pybind11-inl.h 1 ['N/A'] 18 0 41 8 9 274 0 888 50
pybind11::cpp_function::initialize (pybind11::detail::all_type_info_get_cache(_typeobject*)::{lambda(pybind11::handle)#1}&&,void(*)(pybind11::handle))::{lambda(pybind11::detail::function_call&)#1}::__invoke(pybind11::detail::function_call&) /src/pybind11/include/pybind11/pybind11.h 1 ['N/A'] 8 0 13 3 2 83 0 108 46
pybind11::capsule::initialize_with_void_ptr_destructor(voidconst*,charconst*,void(*)(void*))::{lambda(_object*)#1}::__invoke(_object*) /src/pybind11/include/pybind11/pytypes.h 1 ['N/A'] 14 0 13 3 2 163 0 551 42

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

Functions statically reachable by fuzzers
87.0%
450 / 515
Cyclomatic complexity statically reachable by fuzzers
94.0%
3318 / 3523

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

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/pybind11/include/pybind11/pybind11-inl.h ['pybind_fuzzer'] ['pybind_fuzzer']
/usr/local/bin/../include/c++/v1/__exception/exception.h ['pybind_fuzzer'] []
/src/pybind11/include/pybind11/options.h [] []
/src/pybind11/include/pybind11/pybind11.h ['pybind_fuzzer'] ['pybind_fuzzer']
/usr/local/include/python3.11/object.h ['pybind_fuzzer'] []
/src/pybind11/include/pybind11/pytypes-inl.h ['pybind_fuzzer'] ['pybind_fuzzer']
/src/pybind11/include/pybind11/gil_simple.h ['pybind_fuzzer'] ['pybind_fuzzer']
/src/pybind11/include/pybind11/detail/function_ref.h [] []
/src/pybind11/include/pybind11/cast.h ['pybind_fuzzer'] ['pybind_fuzzer']
/src/pybind11/include/pybind11/detail/exception_translation-inl.h [] []
/src/pybind11/include/pybind11/detail/typeid.h [] []
/usr/local/bin/../include/c++/v1/__exception/exception_ptr.h [] []
/usr/local/include/python3.11/cpython/abstract.h [] []
/src/pybind11/include/pybind11/detail/value_and_holder.h [] []
/src/pybind11/include/pybind11/detail/native_enum_data.h [] []
/src/pybind11/include/pybind11/detail/typeid-inl.h [] []
/src/pybind11/include/pybind11/gil-inl.h [] []
/src/pybind11/include/pybind11/pytypes.h ['pybind_fuzzer'] ['pybind_fuzzer']
/usr/local/bin/../include/c++/v1/stdexcept [] []
/src/pybind11/include/pybind11/detail/class-inl.h [] []
/src/pybind11/include/pybind11/attr.h [] []
/usr/local/bin/../include/c++/v1/string [] []
/src/pybind11/include/pybind11/detail/argument_vector.h ['pybind_fuzzer'] ['pybind_fuzzer']
/src/pybind11/tests/fuzz/pybind_fuzzer.cpp ['pybind_fuzzer'] ['pybind_fuzzer']
/src/pybind11/include/pybind11/detail/type_caster_base.h [] []
/src/pybind11/include/pybind11/embed.h ['pybind_fuzzer'] ['pybind_fuzzer']
/src/pybind11/include/pybind11/detail/internals-inl.h ['pybind_fuzzer'] ['pybind_fuzzer']
/src/pybind11/include/pybind11/detail/function_record_pyobject.h [] []
/src/pybind11/tests/fuzz/fuzz_input.h ['pybind_fuzzer'] ['pybind_fuzzer']
/src/pybind11/include/pybind11/detail/common.h ['pybind_fuzzer'] ['pybind_fuzzer']
/src/pybind11/include/pybind11/gil.h [] []
/src/pybind11/include/pybind11/eval.h ['pybind_fuzzer'] ['pybind_fuzzer']
/usr/local/include/python3.11/cpython/tupleobject.h ['pybind_fuzzer'] []
/src/pybind11/include/pybind11/detail/type_caster_base-inl.h [] []
/src/pybind11/include/pybind11/detail/internals.h ['pybind_fuzzer'] ['pybind_fuzzer']
/src/pybind11/include/pybind11/detail/common-inl.h ['pybind_fuzzer'] ['pybind_fuzzer']

Directories in report

Directory
/src/pybind11/include/pybind11/detail/
/src/pybind11/tests/fuzz/
/usr/local/include/python3.11/
/usr/local/bin/../include/c++/v1/
/usr/local/bin/../include/c++/v1/__exception/
/src/pybind11/include/pybind11/
/usr/local/include/python3.11/cpython/