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

Fuzzer details

Fuzzer: hts_open_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 3525 67.6%
gold [1:9] 223 4.28%
yellow [10:29] 62 1.19%
greenyellow [30:49] 34 0.65%
lawngreen 50+ 1365 26.2%
All colors 5209 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
6549 6549 1 :

['cram_write_eof_block']

6575 7469 cram_close call site: 03367 /src/htslib/cram/cram_io.c:5532
6444 6444 2 :

['cram_flush_container_mt', 'cram_update_curr_slice']

17243 18336 cram_close call site: 02103 /src/htslib/cram/cram_io.c:5503
4224 4224 4 :

['cram_flush_result', 'hts_tpool_process_destroy', 'hts_tpool_process_flush', 'pthread_mutex_destroy']

10799 11693 cram_close call site: 03361 /src/htslib/cram/cram_io.c:5514
2818 2818 1 :

['hts_process_opts']

2826 2826 hts_hopen call site: 01634 /src/htslib/hts.c:1505
2790 3082 7 :

['strcmp', 'bgzf_open_ref', 'cram_ref_incr_locked', 'free', 'bgzf_close', 'load_ref_portion', 'cram_ref_load']

2814 3106 cram_get_ref call site: 02126 /src/htslib/cram/cram_io.c:3457
2732 2750 5 :

['hclose_abruptly', '__errno_location', 'hts_opt_apply', 'strerror', 'hts_log']

2732 2750 hts_open_format call site: 01939 /src/htslib/hts.c:900
1042 1098 10 :

['float_to_le.1889', 'i32_to_le.1849', 'bgzf_write', 'bcf_strerror', 'bcf_seqname_safe', 'bcf1_sync', 'u32_to_le.1850', 'hts_idx_push', 'u16_to_le.1851', 'hts_log']

1042 1098 bcf_write call site: 05052 /src/htslib/vcf.c:2096
932 932 1 :

['bcf_hdr_append']

932 932 bcf_hdr_init call site: 04420 /src/htslib/vcf.c:1328
639 649 10 :

['memcmp', 'ks_free.2213', 'hts_md5_update', 'sam_hdr_find_tag_id', 'hts_md5_init', 'hts_md5_final', 'cram_get_block_by_id', 'hts_md5_destroy', 'sam_hdr_tid2name', 'md5_print']

1932 3982 cram_decode_slice call site: 03216 /src/htslib/cram/cram_decode.c:2399
537 572 6 :

['tbx_seqnames', 'bcf_hdr_sync', 'add_missing_contig_hrec', 'tbx_destroy', 'bcf_hdr_destroy', 'bcf_hdr_get_hrec']

537 572 vcf_hdr_read call site: 04554 /src/htslib/vcf.c:2224
417 7775 19 :

['hts_tpool_next_result_wait', 'cram_free_container', 'cram_decode_slice_mt', 'cram_read_container', 'cram_free_slice', 'pthread_mutex_lock', 'hts_tpool_process_qsize', 'hts_tpool_result_data', 'cram_read_slice', 'hts_tpool_delete_result', 'hts_tpool_process_len', 'cram_read_block', 'pthread_mutex_unlock', 'cram_seek', 'cram_decode_compression_header', 'sam_hrecs_sort_order', 'free', 'hts_tpool_process_empty', 'hts_log']

417 7775 cram_next_slice call site: 03690 /src/htslib/cram/cram_decode.c:3233
400 400 3 :

['hts_idx_amend_last', 'bgzf_flush_try', 'bgzf_write']

543 553 vcf_write call site: 05054 /src/htslib/vcf.c:3574

Runtime coverage analysis

Covered functions
491
Functions that are reachable but not covered
657
Reachable functions
1114
Percentage of reachable functions covered
41.02%
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/htslib/test/fuzz/hts_open_fuzzer.c 4
/src/htslib/hfile.c 40
/src/htslib/./textutils_internal.h 12
/src/htslib/hts.c 62
/src/htslib/./htslib/khash.h 1
/src/htslib/hfile_libcurl.c 9
/src/htslib/kstring.c 6
/src/htslib/./htslib/kstring.h 16
/src/htslib/hfile_gcs.c 1
/src/htslib/hfile_s3.c 1
/src/htslib/hfile_s3_write.c 4
/src/htslib/./htslib/hts.h 8
/src/htslib/./hts_internal.h 1
/src/htslib/multipart.c 5
/src/htslib/textutils.c 8
/src/htslib/./htslib/hfile.h 8
/src/htslib/bgzf.c 66
/src/htslib/cram/cram_io.c 99
/src/htslib/cram/../htslib/hfile.h 5
/src/htslib/cram/../htscodecs/htscodecs/varint.h 11
/src/htslib/cram/cram_io.h 10
/src/htslib/cram/cram_structs.h 23
/src/htslib/cram/../header.h 4
/src/htslib/cram/string_alloc.c 6
/src/htslib/cram/cram_stats.c 5
/src/htslib/htscodecs/htscodecs/rANS_static.c 6
/src/htslib/htscodecs/htscodecs/utils.c 5
/src/htslib/htscodecs/htscodecs/rANS_byte.h 11
/src/htslib/htscodecs/htscodecs/fqzcomp_qual.c 19
/src/htslib/htscodecs/htscodecs/varint.h 3
/src/htslib/htscodecs/htscodecs/c_simple_model.h 10
/src/htslib/htscodecs/htscodecs/c_range_coder.h 11
/src/htslib/htscodecs/htscodecs/rANS_static4x16pr.c 11
/src/htslib/htscodecs/htscodecs/utils.h 5
/src/htslib/htscodecs/htscodecs/pack.c 3
/usr/local/lib/clang/15.0.0/include/cpuid.h 1
/src/htslib/htscodecs/htscodecs/rANS_static32x16pr_avx512.c 5
/src/htslib/htscodecs/htscodecs/rANS_static16_int.h 14
/src/htslib/htscodecs/htscodecs/rANS_word.h 9
/src/htslib/htscodecs/htscodecs/rANS_static32x16pr_avx2.c 6
/src/htslib/htscodecs/htscodecs/rANS_static32x16pr_sse4.c 4
/src/htslib/htscodecs/htscodecs/rANS_static32x16pr.c 4
/src/htslib/htscodecs/htscodecs/rle.c 3
/src/htslib/htscodecs/htscodecs/arith_dynamic.c 11
/src/htslib/htscodecs/htscodecs/tokenise_name3.c 33
/src/htslib/htscodecs/htscodecs/pooled_alloc.h 4
/src/htslib/sam.c 77
/src/htslib/header.c 38
/src/htslib/./header.h 11
/src/htslib/cram/pooled_alloc.c 6
/src/htslib/./cram/../htslib/khash.h 1
/src/htslib/cram/mFILE.c 12
/src/htslib/thread_pool.c 29
/src/htslib/./htslib/hts_endian.h 16
/src/htslib/cram/../htslib/khash.h 1
/src/htslib/cram/cram_index.c 6
/src/htslib/cram/cram_decode.c 23
/src/htslib/faidx.c 12
/src/htslib/./sam_internal.h 3
/src/htslib/./cram/../htslib/sam.h 4
/src/htslib/./cram/cram_io.h 1
/src/htslib/hts_expr.c 21
/src/htslib/cram/cram_encode.c 38
/src/htslib/cram/open_trace_file.c 6
/src/htslib/md5.c 7
/src/htslib/cram/../textutils_internal.h 1
/src/htslib/cram/../sam_internal.h 1
/src/htslib/cram/cram_codecs.c 4
/src/htslib/./htslib/hts_expr.h 4
/src/htslib/vcf.c 79
/src/htslib/tbx.c 5
/src/htslib/./htslib/vcf.h 11

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
sam_itr_regarray /src/htslib/sam.c 4 ['struct.hts_idx_t *', 'struct.sam_hdr_t *', 'char **', 'int '] 14 0 132 19 8 671 0 6193 415
s3_vopen /src/htslib/hfile_s3.c 3 ['char *', 'char *', 'struct.__va_list_tag *'] 6 0 52 6 3 153 0 790 352
vhopen_libcurl /src/htslib/hfile_libcurl.c 3 ['char *', 'char *', 'struct.__va_list_tag *'] 6 0 61 9 4 154 0 806 323
bam_mplp_auto /src/htslib/sam.c 5 ['struct.bam_mplp_s *', 'int *', 'int *', 'int *', 'struct.bam_pileup1_t **'] 6 0 72 10 4 34 0 316 263
bcf_index_build /src/htslib/vcf.c 2 ['char *', 'int '] 15 0 20 3 2 964 0 9537 247
cram_codec_decoder2encoder /src/htslib/cram/cram_codecs.c 2 ['struct.cram_fd.698 *', 'struct.cram_codec.703 *'] 4 0 655 98 29 48 1 259 229
bcf_hdr_subset /src/htslib/vcf.c 4 ['struct.bcf_hdr_t *', 'int ', 'char **', 'int *'] 6 0 392 49 18 94 0 734 120
sam_hdr_remove_lines /src/htslib/header.c 4 ['struct.sam_hdr_t *', 'char *', 'char *', 'char *'] 6 0 330 51 21 77 0 681 101
cram_huffman_decode_init /src/htslib/cram/cram_codecs.c 7 ['struct.cram_block_compression_hdr.671 *', 'char *', 'int ', 'int ', 'int ', 'int ', 'struct.varint_vec.699 *'] 5 0 750 107 39 28 0 175 93
sam_itr_queryi /src/htslib/sam.c 4 ['struct.hts_idx_t *', 'int ', 'size_t ', 'size_t '] 14 0 68 8 4 705 0 6352 88

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

Functions statically reachable by fuzzers
73.0%
1219 / 1672
Cyclomatic complexity statically reachable by fuzzers
81.0%
13362 / 16505

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

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
bgzf_read_block 205 102 49.75% ['hts_open_fuzzer']
bgzf_close 42 21 50.0% ['hts_open_fuzzer']
bgzf_check_EOF 34 9 26.47% ['hts_open_fuzzer']
cache_block 38 7 18.42% ['hts_open_fuzzer']
cram_dependent_data_series 227 20 8.810% ['hts_open_fuzzer']
cram_decode_slice 534 105 19.66% ['hts_open_fuzzer']
cram_get_seq 45 12 26.66% ['hts_open_fuzzer']
cram_drain_rqueue 50 4 8.0% ['hts_open_fuzzer']
cram_decode_slice_xref 110 7 6.363% ['hts_open_fuzzer']
cram_next_slice 184 94 51.08% ['hts_open_fuzzer']
cram_first_slice 42 21 50.0% ['hts_open_fuzzer']
cram_get_ref 115 22 19.13% ['hts_open_fuzzer']
cram_free_container 46 19 41.30% ['hts_open_fuzzer']
cram_close 74 37 50.0% ['hts_open_fuzzer']
cram_set_voption 215 10 4.651% ['hts_open_fuzzer']
cram_populate_ref 146 30 20.54% ['hts_open_fuzzer']
safe_ltf8_get 70 33 47.14% ['hts_open_fuzzer']
sam_hdr_count_lines 35 13 37.14% ['hts_open_fuzzer']
sam_hrecs_find_type_id 53 13 24.52% ['hts_open_fuzzer']
hseek 36 16 44.44% ['hts_open_fuzzer']
hts_detect_format2 182 97 53.29% ['hts_open_fuzzer']
hts_idx_check_local 102 40 39.21% ['hts_open_fuzzer']
hts_idx_load3 32 7 21.87% ['hts_open_fuzzer']
format_category 34 9 26.47% ['hts_open_fuzzer']
idx_find_and_load 48 10 20.83% ['hts_open_fuzzer']
decode_name 145 9 6.206% ['hts_open_fuzzer']
sam_hdr_dup 46 17 36.95% ['hts_open_fuzzer']
sam_state_destroy 81 5 6.172% ['hts_open_fuzzer']
sam_write1 127 16 12.59% ['hts_open_fuzzer']
sam_read1_sam 74 17 22.97% ['hts_open_fuzzer']
index_load 38 13 34.21% ['hts_open_fuzzer']
bcf_write 44 10 22.72% ['hts_open_fuzzer']
vcf_hdr_read 81 35 43.20% ['hts_open_fuzzer']

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/htslib/hfile.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/cram/cram_codecs.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/./sam_internal.h ['hts_open_fuzzer'] []
/src/htslib/hts.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/hfile_libcurl.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/./htslib/hts.h ['hts_open_fuzzer'] []
/src/htslib/cram/../htslib/hts_endian.h [] []
/src/htslib/bgzf.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/cram/cram_decode.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/tbx.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/hfile_s3.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/cram/cram_io.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/htscodecs/htscodecs/rANS_static32x16pr_avx2.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/htscodecs/htscodecs/rANS_static32x16pr.c ['hts_open_fuzzer'] []
/src/htslib/./htslib/kstring.h ['hts_open_fuzzer'] []
/src/htslib/htscodecs/htscodecs/arith_dynamic.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/cram/mFILE.c ['hts_open_fuzzer'] []
/src/htslib/htscodecs/htscodecs/rANS_static32x16pr_sse4.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/./hts_internal.h ['hts_open_fuzzer'] []
/src/htslib/./cram/../htslib/khash.h ['hts_open_fuzzer'] []
/src/htslib/./header.h ['hts_open_fuzzer'] []
/src/htslib/./htslib/hts_endian.h ['hts_open_fuzzer'] []
/src/htslib/./cram/../htslib/sam.h ['hts_open_fuzzer'] []
/src/htslib/./hts_time_funcs.h [] []
/src/htslib/./htslib/hts_expr.h ['hts_open_fuzzer'] []
/src/htslib/./cram/cram_io.h ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/cram/../htscodecs/htscodecs/varint.h ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/cram/cram_encode.c ['hts_open_fuzzer'] []
/src/htslib/cram/cram_io.h ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/multipart.c ['hts_open_fuzzer'] []
/src/htslib/./htslib/khash.h ['hts_open_fuzzer'] []
/src/htslib/htscodecs/htscodecs/rANS_static.c ['hts_open_fuzzer'] []
/src/htslib/htscodecs/htscodecs/rANS_static32x16pr_avx512.c ['hts_open_fuzzer'] []
/src/htslib/./htslib/vcf.h ['hts_open_fuzzer'] []
/src/htslib/htscodecs/htscodecs/pack.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/hfile_gcs.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/./textutils_internal.h ['hts_open_fuzzer'] []
/src/htslib/htscodecs/htscodecs/varint.h ['hts_open_fuzzer'] ['hts_open_fuzzer']
/usr/local/lib/clang/15.0.0/include/cpuid.h ['hts_open_fuzzer'] []
/src/htslib/cram/pooled_alloc.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/./htslib/hfile.h ['hts_open_fuzzer'] []
/src/htslib/hfile_s3_write.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/htscodecs/htscodecs/rle.c ['hts_open_fuzzer'] []
/src/htslib/./htslib/khash_str2int.h [] []
/src/htslib/vcf.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/htscodecs/htscodecs/c_range_coder.h ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/cram/string_alloc.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/htscodecs/htscodecs/utils.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/region.c [] []
/src/htslib/faidx.c ['hts_open_fuzzer'] []
/src/htslib/htscodecs/htscodecs/fqzcomp_qual.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/htscodecs/htscodecs/rANS_byte.h ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/cram/cram_index.c ['hts_open_fuzzer'] []
/src/htslib/htscodecs/htscodecs/pooled_alloc.h ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/htscodecs/htscodecs/rANS_static4x16pr.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/thread_pool.c ['hts_open_fuzzer'] []
/src/htslib/test/fuzz/hts_open_fuzzer.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/htscodecs/htscodecs/htscodecs.c [] []
/src/htslib/htscodecs/htscodecs/rANS_word.h ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/htscodecs/htscodecs/tokenise_name3.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/cram/open_trace_file.c ['hts_open_fuzzer'] []
/src/htslib/hts_expr.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/textutils.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/htscodecs/htscodecs/utils.h ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/cram/cram_stats.c ['hts_open_fuzzer'] []
/src/htslib/cram/../htslib/hfile.h ['hts_open_fuzzer'] []
/src/htslib/htscodecs/htscodecs/c_simple_model.h ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/cram/cram_structs.h ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/kstring.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/md5.c ['hts_open_fuzzer'] []
/src/htslib/htscodecs/htscodecs/rANS_static16_int.h ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/sam.c ['hts_open_fuzzer'] ['hts_open_fuzzer']
/src/htslib/cram/../header.h ['hts_open_fuzzer'] []
/src/htslib/cram/cram_codecs.h [] []
/src/htslib/cram/../sam_internal.h ['hts_open_fuzzer'] []
/src/htslib/cram/../textutils_internal.h ['hts_open_fuzzer'] []
/src/htslib/header.c ['hts_open_fuzzer'] ['hts_open_fuzzer']

Directories in report

Directory
/src/htslib/./cram/
/src/htslib/./cram/../htslib/
/src/htslib/cram/../
/src/htslib/test/fuzz/
/src/htslib/./
/src/htslib/cram/
/src/htslib/htscodecs/htscodecs/
/src/htslib/
/src/htslib/./htslib/
/src/htslib/cram/../htscodecs/htscodecs/
/src/htslib/cram/../htslib/
/usr/local/lib/clang/15.0.0/include/