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_gltf

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 1580 51.9%
gold [1:9] 103 3.38%
yellow [10:29] 39 1.28%
greenyellow [30:49] 31 1.01%
lawngreen 50+ 1289 42.3%
All colors 3042 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
466 1432 tinygltf::ParseExtrasProperty(tinygltf::Value*, nlohmann::basic_json , std::__1::allocator >, bool, long, unsigned long, double, std::__1::allocator, nlohmann::adl_serializer, std::__1::vector > > const&) call site: 01432 _ZN8nlohmann6detail10serializerINS_10basic_jsonINSt3__13mapENS3_6vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS9_NS_14adl_serializerENS5_IhNS9_IhEEEEEEE12dump_integerIlTnNS3_9enable_ifIXoooooosr3std11is_integralIT_EE5valuesr3std7is_sameISJ_mEE5valuesr3std7is_sameISJ_lEE5valuesr3std7is_sameISJ_hEE5valueEiE4typeELi0EEEvSJ_
81 587 nlohmann::detail::primitive_iterator_t::set_end() call site: 00587 _ZN8nlohmann10basic_jsonINSt3__13mapENS1_6vectorENS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEblmdS7_NS_14adl_serializerENS3_IhNS7_IhEEEEE5eraseINS_6detail9iter_implISD_EETnNS1_9enable_ifIXoosr3std7is_sameIT_SH_EE5valuesr3std7is_sameISJ_NSG_IKSD_EEEE5valueEiE4typeELi0EEESJ_SJ_
55 2949 tinygltf::TinyGLTF::LoadFromString(tinygltf::Model*, std::__1::basic_string , std::__1::allocator >*, std::__1::basic_string , std::__1::allocator >*, char const*, unsigned int, std::__1::basic_string , std::__1::allocator > const&, unsigned int) call site: 02949 _ZNK8nlohmann6detail9iter_implIKNS_10basic_jsonINSt3__13mapENS3_6vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS9_NS_14adl_serializerENS5_IhNS9_IhEEEEEEEneISH_TnNS3_9enable_ifIXoosr3std7is_sameIT_SH_EE5valuesr3std7is_sameISK_NS1_ISF_EEEE5valueEDnE4typeELDn0EEEbRKSK_
48 2123 tinygltf::ParseNumberArrayProperty(std::__1::vector >*, std::__1::basic_string , std::__1::allocator >*, nlohmann::basic_json , std::__1::allocator >, bool, long, unsigned long, double, std::__1::allocator, nlohmann::adl_serializer, std::__1::vector > > const&, std::__1::basic_string , std::__1::allocator > const&, bool, std::__1::basic_string , std::__1::allocator > const&) call site: 02123 __asan_report_store8
42 534 nlohmann::basic_json , std::__1::allocator >, bool, long, unsigned long, double, std::__1::allocator, nlohmann::adl_serializer, std::__1::vector > >::json_value::json_value(double) call site: 00534 __asan_memcpy
39 2903 tinygltf::TinyGLTF::LoadFromString(tinygltf::Model*, std::__1::basic_string , std::__1::allocator >*, std::__1::basic_string , std::__1::allocator >*, char const*, unsigned int, std::__1::basic_string , std::__1::allocator > const&, unsigned int) call site: 02903 _ZNK8nlohmann6detail9iter_implIKNS_10basic_jsonINSt3__13mapENS3_6vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS9_NS_14adl_serializerENS5_IhNS9_IhEEEEEEEneISH_TnNS3_9enable_ifIXoosr3std7is_sameIT_SH_EE5valuesr3std7is_sameISK_NS1_ISF_EEEE5valueEDnE4typeELDn0EEEbRKSK_
37 278 nlohmann::detail::lexer , std::__1::allocator >, bool, long, unsigned long, double, std::__1::allocator, nlohmann::adl_serializer, std::__1::vector > >, nlohmann::detail::iterator_input_adapter >::scan_string() call site: 00278 __asan_report_store8
34 2837 tinygltf::ParseCamera(tinygltf::Camera*, std::__1::basic_string , std::__1::allocator >*, nlohmann::basic_json , std::__1::allocator >, bool, long, unsigned long, double, std::__1::allocator, nlohmann::adl_serializer, std::__1::vector > > const&, bool) call site: 02837 __asan_report_store8
33 446 nlohmann::basic_json , std::__1::allocator >, bool, long, unsigned long, double, std::__1::allocator, nlohmann::adl_serializer, std::__1::vector > >::operator=(nlohmann::basic_json , std::__1::allocator >, bool, long, unsigned long, double, std::__1::allocator, nlohmann::adl_serializer, std::__1::vector > >) call site: 00446 __asan_report_load8
33 1927 tinygltf::TinyGLTF::LoadFromString(tinygltf::Model*, std::__1::basic_string , std::__1::allocator >*, std::__1::basic_string , std::__1::allocator >*, char const*, unsigned int, std::__1::basic_string , std::__1::allocator > const&, unsigned int) call site: 01927 _ZNK8nlohmann10basic_jsonINSt3__13mapENS1_6vectorENS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEblmdS7_NS_14adl_serializerENS3_IhNS7_IhEEEEE3getImmEEDTcldtclL_ZNS1_7declvalB8ne220000IRKSD_EEDTclsr3stdE9__declvalIT_ELi0EEEvEE8get_implIT0_EtlNS_6detail12priority_tagILj4EEEEEEv
32 2053 tinygltf::TinyGLTF::LoadFromString(tinygltf::Model*, std::__1::basic_string , std::__1::allocator >*, std::__1::basic_string , std::__1::allocator >*, char const*, unsigned int, std::__1::basic_string , std::__1::allocator > const&, unsigned int) call site: 02053 __asan_report_load8
31 2781 tinygltf::TinyGLTF::LoadFromString(tinygltf::Model*, std::__1::basic_string , std::__1::allocator >*, std::__1::basic_string , std::__1::allocator >*, char const*, unsigned int, std::__1::basic_string , std::__1::allocator > const&, unsigned int) call site: 02781 __asan_report_load8

Runtime coverage analysis

Covered functions
451
Functions that are reachable but not covered
340
Reachable functions
994
Percentage of reachable functions covered
65.79%
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/tinygltf/tests/fuzzer/build/../fuzz_gltf.cc 2
/src/tinygltf/tests/fuzzer/build/../../../tiny_gltf.h 218
/src/tinygltf/tests/fuzzer/build/../../../json.hpp 281
/usr/local/bin/../include/c++/v1/__exception/exception.h 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
tinygltf::LoadImageData(tinygltf::Image*,int,std::__1::basic_string ,std::__1::allocator >*,std::__1::basic_string ,std::__1::allocator >*,int,int,unsignedcharconst*,int,void*) /src/tinygltf/tests/fuzzer/build/../../../tiny_gltf.h 9 ['N/A', 'int', 'N/A', 'N/A', 'int', 'int', 'N/A', 'int', 'N/A'] 15 0 1647 185 14 339 0 3078 3029
tinygltf::TinyGLTF::WriteGltfSceneToFile(tinygltf::Modelconst*,std::__1::basic_string ,std::__1::allocator >const&,bool,bool,bool,bool) /src/tinygltf/tests/fuzzer/build/../../../tiny_gltf.h 7 ['N/A', 'N/A', 'N/A', 'bool', 'bool', 'bool', 'bool'] 19 0 1420 177 163 540 0 2998 1996
tinygltf::WriteImageData(std::__1::basic_string ,std::__1::allocator >const*,std::__1::basic_string ,std::__1::allocator >const*,tinygltf::Imageconst*,bool,tinygltf::FsCallbacksconst*,tinygltf::URICallbacksconst*,std::__1::basic_string ,std::__1::allocator >*,void*) /src/tinygltf/tests/fuzzer/build/../../../tiny_gltf.h 8 ['N/A', 'N/A', 'N/A', 'bool', 'N/A', 'N/A', 'N/A', 'N/A'] 8 0 907 148 26 83 0 642 568
stbi_write_hdr /src/tinygltf/tests/fuzzer/build/../../../stb_image_write.h 5 ['N/A', 'int', 'int', 'int', 'N/A'] 4 0 137 13 6 38 0 145 109
tinygltf::GetFileSizeInBytes(unsignedlong*,std::__1::basic_string ,std::__1::allocator >*,std::__1::basic_string ,std::__1::allocator >const&,void*) /src/tinygltf/tests/fuzzer/build/../../../tiny_gltf.h 4 ['N/A', 'N/A', 'N/A', 'N/A'] 1 0 776 103 93 5 0 103 93
tinygltf::ReadWholeFile(std::__1::vector >*,std::__1::basic_string ,std::__1::allocator >*,std::__1::basic_string ,std::__1::allocator >const&,void*) /src/tinygltf/tests/fuzzer/build/../../../tiny_gltf.h 4 ['N/A', 'N/A', 'N/A', 'N/A'] 1 0 783 105 91 4 0 99 91
tinygltf::TinyGLTF::LoadBinaryFromFile(tinygltf::Model*,std::__1::basic_string ,std::__1::allocator >*,std::__1::basic_string ,std::__1::allocator >*,std::__1::basic_string ,std::__1::allocator >const&,unsignedint) /src/tinygltf/tests/fuzzer/build/../../../tiny_gltf.h 6 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'int'] 21 0 476 52 46 987 0 6796 90
tinygltf::TinyGLTF::WriteGltfSceneToStream(tinygltf::Modelconst*,std::__1::basic_ostream >&,bool,bool) /src/tinygltf/tests/fuzzer/build/../../../tiny_gltf.h 5 ['N/A', 'N/A', 'N/A', 'bool', 'bool'] 19 0 624 81 79 526 0 2882 79
tinygltf::Material::operator==(tinygltf::Materialconst&)const /src/tinygltf/tests/fuzzer/build/../../../tiny_gltf.h 2 ['N/A', 'N/A'] 6 0 188 38 16 58 0 132 70
stbi__idct_block(unsignedchar*,int,short*) /src/tinygltf/tests/fuzzer/build/../../../stb_image.h 3 ['N/A', 'int', 'N/A'] 1 0 1482 178 62 8 0 78 66

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

Functions statically reachable by fuzzers
83.0%
860 / 1040
Cyclomatic complexity statically reachable by fuzzers
92.0%
12854 / 13908

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/tinygltf/tests/fuzzer/build/../fuzz_gltf.cc

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=['tinygltf::ParseExtrasProperty(tinygltf::Value*, nlohmann::basic_json, std::__1::allocator >, bool, long, unsigned long, double, std::__1::allocator, nlohmann::adl_serializer, std::__1::vector > > const&)', 'nlohmann::detail::primitive_iterator_t::set_end()', 'tinygltf::TinyGLTF::LoadFromString(tinygltf::Model*, std::__1::basic_string, std::__1::allocator >*, std::__1::basic_string, std::__1::allocator >*, char const*, unsigned int, std::__1::basic_string, std::__1::allocator > const&, unsigned int)', 'tinygltf::ParseNumberArrayProperty(std::__1::vector >*, std::__1::basic_string, std::__1::allocator >*, nlohmann::basic_json, std::__1::allocator >, bool, long, unsigned long, double, std::__1::allocator, nlohmann::adl_serializer, std::__1::vector > > const&, std::__1::basic_string, std::__1::allocator > const&, bool, std::__1::basic_string, std::__1::allocator > const&)', 'nlohmann::basic_json, std::__1::allocator >, bool, long, unsigned long, double, std::__1::allocator, nlohmann::adl_serializer, std::__1::vector > >::json_value::json_value(double)', 'tinygltf::TinyGLTF::LoadFromString(tinygltf::Model*, std::__1::basic_string, std::__1::allocator >*, std::__1::basic_string, std::__1::allocator >*, char const*, unsigned int, std::__1::basic_string, std::__1::allocator > const&, unsigned int)', 'nlohmann::detail::lexer, std::__1::allocator >, bool, long, unsigned long, double, std::__1::allocator, nlohmann::adl_serializer, std::__1::vector > >, nlohmann::detail::iterator_input_adapter >::scan_string()', 'tinygltf::ParseCamera(tinygltf::Camera*, std::__1::basic_string, std::__1::allocator >*, nlohmann::basic_json, std::__1::allocator >, bool, long, unsigned long, double, std::__1::allocator, nlohmann::adl_serializer, std::__1::vector > > const&, bool)', 'nlohmann::basic_json, std::__1::allocator >, bool, long, unsigned long, double, std::__1::allocator, nlohmann::adl_serializer, std::__1::vector > >::operator=(nlohmann::basic_json, std::__1::allocator >, bool, long, unsigned long, double, std::__1::allocator, nlohmann::adl_serializer, std::__1::vector > >)', 'tinygltf::TinyGLTF::LoadFromString(tinygltf::Model*, std::__1::basic_string, std::__1::allocator >*, std::__1::basic_string, std::__1::allocator >*, char const*, unsigned int, std::__1::basic_string, std::__1::allocator > const&, unsigned int)']

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
nlohmann::basic_json ,std::__1::allocator >,bool,long,unsignedlong,double,std::__1::allocator,nlohmann::adl_serializer,std::__1::vector >>::json_value::json_value(nlohmann::detail::value_t) 60 17 28.33% ['fuzz_gltf']
nlohmann::detail::parser ,std::__1::allocator >,bool,long,unsignedlong,double,std::__1::allocator,nlohmann::adl_serializer,std::__1::vector >>,nlohmann::detail::iterator_input_adapter >::parse(bool,nlohmann::basic_json ,std::__1::allocator >,bool,long,unsignedlong,double,std::__1::allocator,nlohmann::adl_serializer,std::__1::vector >>&) 40 11 27.50% ['fuzz_gltf']
nlohmann::detail::iter_impl ,std::__1::allocator >,bool,long,unsignedlong,double,std::__1::allocator,nlohmann::adl_serializer,std::__1::vector >>const>::set_begin() 33 14 42.42% ['fuzz_gltf']
nlohmann::detail::iter_impl ,std::__1::allocator >,bool,long,unsignedlong,double,std::__1::allocator,nlohmann::adl_serializer,std::__1::vector >>const>::operator*()const 33 16 48.48% ['fuzz_gltf']
stbi__parse_png_file(stbi__png*,int,int) 160 11 6.875% ['fuzz_gltf']
stbi__gif_load_next(stbi__context*,stbi__gif*,int*,int,unsignedchar*) 131 66 50.38% ['fuzz_gltf']
load_jpeg_image(stbi__jpeg*,int*,int*,int*,int) 137 70 51.09% ['fuzz_gltf']
stbi__psd_info(stbi__context*,int*,int*,int*) 33 9 27.27% ['fuzz_gltf']
stbi__pic_info(stbi__context*,int*,int*,int*) 44 10 22.72% ['fuzz_gltf']
stbi__hdr_info(stbi__context*,int*,int*,int*) 37 12 32.43% ['fuzz_gltf']
tinygltf::ParseNumberArrayProperty(std::__1::vector >*,std::__1::basic_string ,std::__1::allocator >*,nlohmann::basic_json ,std::__1::allocator >,bool,long,unsignedlong,double,std::__1::allocator,nlohmann::adl_serializer,std::__1::vector >>const&,std::__1::basic_string ,std::__1::allocator >const&,bool,std::__1::basic_string ,std::__1::allocator >const&) 47 23 48.93% ['fuzz_gltf']
tinygltf::LoadExternalFile(std::__1::vector >*,std::__1::basic_string ,std::__1::allocator >*,std::__1::basic_string ,std::__1::allocator >*,std::__1::basic_string ,std::__1::allocator >const&,std::__1::basic_string ,std::__1::allocator >const&,bool,unsignedlong,bool,unsignedlong,tinygltf::FsCallbacks*) 78 15 19.23% ['fuzz_gltf']
tinygltf::ParseIntegerArrayProperty(std::__1::vector >*,std::__1::basic_string ,std::__1::allocator >*,nlohmann::basic_json ,std::__1::allocator >,bool,long,unsignedlong,double,std::__1::allocator,nlohmann::adl_serializer,std::__1::vector >>const&,std::__1::basic_string ,std::__1::allocator >const&,bool,std::__1::basic_string ,std::__1::allocator >const&) 47 23 48.93% ['fuzz_gltf']
tinygltf::TinyGLTF::LoadFromString(tinygltf::Model*,std::__1::basic_string ,std::__1::allocator >*,std::__1::basic_string ,std::__1::allocator >*,charconst*,unsignedint,std::__1::basic_string ,std::__1::allocator >const&,unsignedint)::$_10::operator()(nlohmann::basic_json ,std::__1::allocator >,bool,long,unsignedlong,double,std::__1::allocator,nlohmann::adl_serializer,std::__1::vector >>const&)const 63 19 30.15% ['fuzz_gltf']
tinygltf::ParseImage(tinygltf::Image*,int,std::__1::basic_string ,std::__1::allocator >*,std::__1::basic_string ,std::__1::allocator >*,nlohmann::basic_json ,std::__1::allocator >,bool,long,unsignedlong,double,std::__1::allocator,nlohmann::adl_serializer,std::__1::vector >>const&,bool,std::__1::basic_string ,std::__1::allocator >const&,unsignedlong,tinygltf::FsCallbacks*,tinygltf::URICallbacksconst*,std::__1::function ,std::__1::allocator >*,std::__1::basic_string ,std::__1::allocator >*,int,int,unsignedcharconst*,int,void*)>const&,void*) 106 55 51.88% ['fuzz_gltf']
tinygltf::ParseCamera(tinygltf::Camera*,std::__1::basic_string ,std::__1::allocator >*,nlohmann::basic_json ,std::__1::allocator >,bool,long,unsignedlong,double,std::__1::allocator,nlohmann::adl_serializer,std::__1::vector >>const&,bool) 66 14 21.21% ['fuzz_gltf']