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: dr_mp3_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 36 19.0%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 153 80.9%
All colors 189 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
17 142 drmp3_decode_next_frame_ex__memory(drmp3*, short*, drmp3dec_frame_info*, unsigned char const**) call site: 00142 drmp3dec_decode_frame
8 7 drmp3_init_internal(drmp3*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drmp3_seek_origin), unsigned int (*)(void*, long long*), void (*)(void*, drmp3_metadata const*), void*, void*, drmp3_allocation_callbacks const*) call site: 00007 drmp3_malloc
7 17 drmp3_init_internal(drmp3*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drmp3_seek_origin), unsigned int (*)(void*, long long*), void (*)(void*, drmp3_metadata const*), void*, void*, drmp3_allocation_callbacks const*) call site: 00017 drmp3_malloc
1 125 drmp3dec_decode_frame call site: 00125
1 164 drmp3_init_internal(drmp3*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drmp3_seek_origin), unsigned int (*)(void*, long long*), void (*)(void*, drmp3_metadata const*), void*, void*, drmp3_allocation_callbacks const*) call site: 00164
1 172 drmp3__on_seek_memory(void*, int, drmp3_seek_origin) call site: 00172 __assert_fail
1 186 LLVMFuzzerTestOneInput call site: 00186 fclose

Runtime coverage analysis

Covered functions
66
Functions that are reachable but not covered
21
Reachable functions
146
Percentage of reachable functions covered
85.62%
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/dr_libs/tests/fuzzing/dr_mp3_fuzzer.cc 1
dr_mp3.h 75

Fuzzer: dr_wav_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 243 63.6%
gold [1:9] 0 0.0%
yellow [10:29] 1 0.26%
greenyellow [30:49] 1 0.26%
lawngreen 50+ 137 35.8%
All colors 382 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
205 74 drwav_init__internal(drwav*, unsigned long long (*)(void*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drwav_seek_origin), void*, drwav_chunk_header const*, drwav_container, drwav_fmt const*), void*, unsigned int) call site: 00074 drwav_fourcc_equal
8 280 drwav_init__internal(drwav*, unsigned long long (*)(void*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drwav_seek_origin), void*, drwav_chunk_header const*, drwav_container, drwav_fmt const*), void*, unsigned int) call site: 00280 drwav_free
7 372 LLVMFuzzerTestOneInput call site: 00372 __assert_fail
4 301 LLVMFuzzerTestOneInput call site: 00301 __assert_fail
1 9 drwav__on_seek_memory(void*, int, drwav_seek_origin) call site: 00009 __assert_fail
1 46 drwav_init__internal(drwav*, unsigned long long (*)(void*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drwav_seek_origin), void*, drwav_chunk_header const*, drwav_container, drwav_fmt const*), void*, unsigned int) call site: 00046
1 52 drwav_init__internal(drwav*, unsigned long long (*)(void*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drwav_seek_origin), void*, drwav_chunk_header const*, drwav_container, drwav_fmt const*), void*, unsigned int) call site: 00052
1 72 drwav_init__internal(drwav*, unsigned long long (*)(void*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drwav_seek_origin), void*, drwav_chunk_header const*, drwav_container, drwav_fmt const*), void*, unsigned int) call site: 00072
1 289 drwav_free call site: 00289
1 291 drwav_init__internal(drwav*, unsigned long long (*)(void*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drwav_seek_origin), void*, drwav_chunk_header const*, drwav_container, drwav_fmt const*), void*, unsigned int) call site: 00291 drwav_free
1 299 drwav_init__internal(drwav*, unsigned long long (*)(void*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drwav_seek_origin), void*, drwav_chunk_header const*, drwav_container, drwav_fmt const*), void*, unsigned int) call site: 00299 drwav_free
1 318 drwav_read_pcm_frames_s16__msadpcm(drwav*, unsigned long long, short*) call site: 00318

Runtime coverage analysis

Covered functions
71
Functions that are reachable but not covered
70
Reachable functions
138
Percentage of reachable functions covered
49.28%
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/dr_libs/tests/fuzzing/dr_wav_fuzzer.cc 1
dr_wav.h 79

Fuzzer: dr_flac_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 57 19.1%
gold [1:9] 1 0.33%
yellow [10:29] 0 0.0%
greenyellow [30:49] 2 0.67%
lawngreen 50+ 238 79.8%
All colors 298 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
26 96 drflac_open_with_metadata_private(unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drflac_seek_origin), unsigned int (*)(void*, long long*), void (*)(void*, drflac_metadata*), drflac_container, void*, void*, drflac_allocation_callbacks const*) call site: 00096
6 260 drflac_open_with_metadata_private(unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drflac_seek_origin), unsigned int (*)(void*, long long*), void (*)(void*, drflac_metadata*), drflac_container, void*, void*, drflac_allocation_callbacks const*) call site: 00260
6 282 drflac_read_pcm_frames_s32 call site: 00282 __assert_fail
2 8 drflac__init_private(drflac_init_info*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drflac_seek_origin), unsigned int (*)(void*, long long*), void (*)(void*, drflac_metadata*), drflac_container, void*, void*) call site: 00008
2 32 drflac__read_uint8(drflac_bs*, unsigned int, unsigned char*) call site: 00032 __assert_fail
2 92 drflac_ogg__read_page_header(unsigned long (*)(void*, void*, unsigned long), void*, drflac_ogg_page_header*, unsigned int*, unsigned int*) call site: 00092
2 132 drflac_open_with_metadata_private(unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drflac_seek_origin), unsigned int (*)(void*, long long*), void (*)(void*, drflac_metadata*), drflac_container, void*, void*, drflac_allocation_callbacks const*) call site: 00132
2 276 LLVMFuzzerTestOneInput call site: 00276
1 2 drflac_open_memory call site: 00002
1 15 drflac__find_and_seek_to_next_sync_code(drflac_bs*) call site: 00015
1 25 drflac__read_uint64(drflac_bs*, unsigned int, unsigned long long*) call site: 00025
1 84 drflac__read_next_flac_frame_header(drflac_bs*, unsigned char, drflac_frame_header*) call site: 00084 __assert_fail

Runtime coverage analysis

Covered functions
110
Functions that are reachable but not covered
6
Reachable functions
101
Percentage of reachable functions covered
94.06%
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.
Warning: The number of covered functions are larger than the number of reachable functions. This means that there are more functions covered at runtime than are extracted using static analysis. This is likely a result of the static analysis component failing to extract the right call graph or the coverage runtime being compiled with sanitizers in code that the static analysis has not analysed. This can happen if lto/gold is not used in all places that coverage instrumentation is used.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
/src/dr_libs/tests/fuzzing/dr_flac_fuzzer.cc 1
dr_flac.h 51

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
drwav_open_file_and_read_pcm_frames_s32_w /src/dr_libs/tests/fuzzing/../../dr_wav.h 5 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 10 0 83 15 6 175 0 1083 292
drflac_seek_to_pcm_frame /src/dr_libs/tests/fuzzing/../../dr_flac.h 2 ['N/A', 'size_t'] 14 0 336 51 21 104 1 907 284
drflac_open_file_and_read_pcm_frames_f32 /src/dr_libs/tests/fuzzing/../../dr_flac.h 5 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 12 0 85 15 6 113 0 1095 229
drmp3_open_file_and_read_pcm_frames_s16 /src/dr_libs/tests/fuzzing/../../dr_mp3.h 4 ['N/A', 'N/A', 'N/A', 'N/A'] 12 0 41 6 3 154 0 690 175
drwav_init_memory_write_sequential_pcm_frames /src/dr_libs/tests/fuzzing/../../dr_wav.h 6 ['N/A', 'N/A', 'N/A', 'N/A', 'size_t', 'N/A'] 8 0 50 6 3 44 0 148 139
drwav_open_file_and_read_pcm_frames_f32 /src/dr_libs/tests/fuzzing/../../dr_wav.h 5 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 10 0 83 15 6 174 0 1077 123
drmp3_calculate_seek_points /src/dr_libs/tests/fuzzing/../../dr_mp3.h 3 ['N/A', 'N/A', 'N/A'] 14 0 390 55 18 139 0 451 82
drflac_open_memory_and_read_pcm_frames_s16 /src/dr_libs/tests/fuzzing/../../dr_flac.h 6 ['N/A', 'size_t', 'N/A', 'N/A', 'N/A', 'N/A'] 12 0 88 15 6 104 0 946 65
drwav_write_pcm_frames /src/dr_libs/tests/fuzzing/../../dr_wav.h 3 ['N/A', 'size_t', 'N/A'] 9 0 39 6 3 56 0 157 60

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

Functions statically reachable by fuzzers
78.0%
339 / 436
Cyclomatic complexity statically reachable by fuzzers
90.0%
3670 / 4096

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/dr_libs/tests/fuzzing/dr_mp3_fuzzer.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=['drmp3_decode_next_frame_ex__memory(drmp3*, short*, drmp3dec_frame_info*, unsigned char const**)', 'drmp3_init_internal(drmp3*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drmp3_seek_origin), unsigned int (*)(void*, long long*), void (*)(void*, drmp3_metadata const*), void*, void*, drmp3_allocation_callbacks const*)', 'drmp3_init_internal(drmp3*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drmp3_seek_origin), unsigned int (*)(void*, long long*), void (*)(void*, drmp3_metadata const*), void*, void*, drmp3_allocation_callbacks const*)', 'drmp3dec_decode_frame', 'drmp3_init_internal(drmp3*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drmp3_seek_origin), unsigned int (*)(void*, long long*), void (*)(void*, drmp3_metadata const*), void*, void*, drmp3_allocation_callbacks const*)', 'drmp3__on_seek_memory(void*, int, drmp3_seek_origin)', 'LLVMFuzzerTestOneInput']

/src/dr_libs/tests/fuzzing/dr_wav_fuzzer.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=['drwav_init__internal(drwav*, unsigned long long (*)(void*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drwav_seek_origin), void*, drwav_chunk_header const*, drwav_container, drwav_fmt const*), void*, unsigned int)', 'drwav_init__internal(drwav*, unsigned long long (*)(void*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drwav_seek_origin), void*, drwav_chunk_header const*, drwav_container, drwav_fmt const*), void*, unsigned int)', 'LLVMFuzzerTestOneInput', 'drwav__on_seek_memory(void*, int, drwav_seek_origin)', 'drwav_init__internal(drwav*, unsigned long long (*)(void*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drwav_seek_origin), void*, drwav_chunk_header const*, drwav_container, drwav_fmt const*), void*, unsigned int)', 'drwav_init__internal(drwav*, unsigned long long (*)(void*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drwav_seek_origin), void*, drwav_chunk_header const*, drwav_container, drwav_fmt const*), void*, unsigned int)', 'drwav_init__internal(drwav*, unsigned long long (*)(void*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drwav_seek_origin), void*, drwav_chunk_header const*, drwav_container, drwav_fmt const*), void*, unsigned int)', 'drwav_free', 'drwav_init__internal(drwav*, unsigned long long (*)(void*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drwav_seek_origin), void*, drwav_chunk_header const*, drwav_container, drwav_fmt const*), void*, unsigned int)']

/src/dr_libs/tests/fuzzing/dr_flac_fuzzer.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=['drflac_open_with_metadata_private(unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drflac_seek_origin), unsigned int (*)(void*, long long*), void (*)(void*, drflac_metadata*), drflac_container, void*, void*, drflac_allocation_callbacks const*)', 'drflac_open_with_metadata_private(unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drflac_seek_origin), unsigned int (*)(void*, long long*), void (*)(void*, drflac_metadata*), drflac_container, void*, void*, drflac_allocation_callbacks const*)', 'drflac_read_pcm_frames_s32', 'drflac__init_private(drflac_init_info*, unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drflac_seek_origin), unsigned int (*)(void*, long long*), void (*)(void*, drflac_metadata*), drflac_container, void*, void*)', 'drflac__read_uint8(drflac_bs*, unsigned int, unsigned char*)', 'drflac_ogg__read_page_header(unsigned long (*)(void*, void*, unsigned long), void*, drflac_ogg_page_header*, unsigned int*, unsigned int*)', 'drflac_open_with_metadata_private(unsigned long (*)(void*, void*, unsigned long), unsigned int (*)(void*, int, drflac_seek_origin), unsigned int (*)(void*, long long*), void (*)(void*, drflac_metadata*), drflac_container, void*, void*, drflac_allocation_callbacks const*)', 'LLVMFuzzerTestOneInput', 'drflac_open_memory', 'drflac__find_and_seek_to_next_sync_code(drflac_bs*)']