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

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
10 10 4 :

['__cxa_throw', 'std::out_of_range::out_of_range(char const*)', '__cxa_allocate_exception', '__cxa_free_exception']

10 10 jsoncons::detail::basic_string_view >::substr(unsignedlong,unsignedlong)const call site: 00000 /src/jsoncons/./include/jsoncons/detail/string_view.hpp:165
0 0 None 4 52 jsoncons::detail::basic_string_view >::find_last_of(jsoncons::detail::basic_string_view >,unsignedlong)const call site: 00000 /src/jsoncons/./include/jsoncons/detail/string_view.hpp:291
0 0 None 0 32 _ZN8jsoncons6detail10to_integerIjcEENSt3__19enable_ifIXaasr16extension_traits14integer_limitsIT_EE14is_specializedntsr16extension_traits14integer_limitsIS4_EE9is_signedENS0_17to_integer_resultIS4_T0_EEE4typeEPKS6_mRS4_ call site: 00000 /src/jsoncons/./include/jsoncons/detail/parse_number.hpp:430
0 0 None 0 32 _ZN8jsoncons6detail10to_integerIjcEENSt3__19enable_ifIXaasr16extension_traits14integer_limitsIT_EE14is_specializedntsr16extension_traits14integer_limitsIS4_EE9is_signedENS0_17to_integer_resultIS4_T0_EEE4typeEPKS6_mRS4_ call site: 00000 /src/jsoncons/./include/jsoncons/detail/parse_number.hpp:505
0 0 None 0 32 _ZN8jsoncons6detail10to_integerIjcEENSt3__19enable_ifIXaasr16extension_traits14integer_limitsIT_EE14is_specializedntsr16extension_traits14integer_limitsIS4_EE9is_signedENS0_17to_integer_resultIS4_T0_EEE4typeEPKS6_mRS4_ call site: 00000 /src/jsoncons/./include/jsoncons/detail/parse_number.hpp:505
0 0 None 0 32 _ZN8jsoncons6detail10to_integerIjcEENSt3__19enable_ifIXaasr16extension_traits14integer_limitsIT_EE14is_specializedntsr16extension_traits14integer_limitsIS4_EE9is_signedENS0_17to_integer_resultIS4_T0_EEE4typeEPKS6_mRS4_ call site: 00000 /src/jsoncons/./include/jsoncons/detail/parse_number.hpp:505
0 0 None 0 32 _ZN8jsoncons6detail10to_integerIjcEENSt3__19enable_ifIXaasr16extension_traits14integer_limitsIT_EE14is_specializedntsr16extension_traits14integer_limitsIS4_EE9is_signedENS0_17to_integer_resultIS4_T0_EEE4typeEPKS6_mRS4_ call site: 00000 /src/jsoncons/./include/jsoncons/detail/parse_number.hpp:505
0 0 None 0 32 _ZN8jsoncons6detail10to_integerIjcEENSt3__19enable_ifIXaasr16extension_traits14integer_limitsIT_EE14is_specializedntsr16extension_traits14integer_limitsIS4_EE9is_signedENS0_17to_integer_resultIS4_T0_EEE4typeEPKS6_mRS4_ call site: 00000 /src/jsoncons/./include/jsoncons/detail/parse_number.hpp:505
0 0 None 0 32 _ZN8jsoncons6detail10to_integerIjcEENSt3__19enable_ifIXaasr16extension_traits14integer_limitsIT_EE14is_specializedntsr16extension_traits14integer_limitsIS4_EE9is_signedENS0_17to_integer_resultIS4_T0_EEE4typeEPKS6_mRS4_ call site: 00000 /src/jsoncons/./include/jsoncons/detail/parse_number.hpp:505
0 0 None 0 32 _ZN8jsoncons6detail10to_integerIjcEENSt3__19enable_ifIXaasr16extension_traits14integer_limitsIT_EE14is_specializedntsr16extension_traits14integer_limitsIS4_EE9is_signedENS0_17to_integer_resultIS4_T0_EEE4typeEPKS6_mRS4_ call site: 00000 /src/jsoncons/./include/jsoncons/detail/parse_number.hpp:505
0 0 None 0 32 _ZN8jsoncons6detail10to_integerIjcEENSt3__19enable_ifIXaasr16extension_traits14integer_limitsIT_EE14is_specializedntsr16extension_traits14integer_limitsIS4_EE9is_signedENS0_17to_integer_resultIS4_T0_EEE4typeEPKS6_mRS4_ call site: 00000 /src/jsoncons/./include/jsoncons/detail/parse_number.hpp:505
0 0 None 0 23 jsoncons::bson::decimal128_from_chars(charconst*,charconst*,jsoncons::bson::TP1&) call site: 00000 /src/jsoncons/./include/jsoncons_ext/bson/bson_decimal128.hpp:753

Fuzzer calltree

0 LLVMFuzzerTestOneInput [function] [call site] 00000
1 jsoncons::bytes_sink >, void>::bytes_sink(std::__1::vector >&) [function] [call site] 00001
1 jsoncons::bson::basic_bson_encoder >, void>, std::__1::allocator >::basic_bson_encoder(jsoncons::bytes_sink >, void>&&, std::__1::allocator const&) [function] [call site] 00002
2 jsoncons::bson::bson_encode_options::bson_encode_options() [function] [call site] 00003
3 jsoncons::bson::bson_options_common::bson_options_common() [function] [call site] 00004
2 jsoncons::bson::basic_bson_encoder >, void>, std::__1::allocator >::basic_bson_encoder(jsoncons::bytes_sink >, void>&&, jsoncons::bson::bson_encode_options const&, std::__1::allocator const&) [function] [call site] 00005
3 jsoncons::basic_json_visitor ::basic_json_visitor() [function] [call site] 00006
3 jsoncons::bson::bson_encode_options::bson_encode_options(jsoncons::bson::bson_encode_options const&) [function] [call site] 00007
4 jsoncons::bson::bson_options_common::bson_options_common(jsoncons::bson::bson_options_common const&) [function] [call site] 00008
2 jsoncons::bson::bson_encode_options::~bson_encode_options() [function] [call site] 00009
1 jsoncons::bson::bson_decode_options::bson_decode_options() [function] [call site] 00010
2 jsoncons::bson::bson_options_common::bson_options_common() [function] [call site] 00011
1 jsoncons::bson::basic_bson_reader , std::__1::allocator >::basic_bson_reader , std::__1::allocator >&>(std::__1::basic_istringstream , std::__1::allocator >&, jsoncons::basic_json_visitor &, jsoncons::bson::bson_decode_options const&, std::__1::allocator const&) [function] [call site] 00012
2 jsoncons::bson::basic_bson_parser , std::__1::allocator >::basic_bson_parser , std::__1::allocator >&>(std::__1::basic_istringstream , std::__1::allocator >&, jsoncons::bson::bson_decode_options const&, std::__1::allocator const&) [function] [call site] 00013
3 jsoncons::ser_context::ser_context() [function] [call site] 00014
3 jsoncons::stream_source ::stream_source(std::__1::basic_istream >&, unsigned long) [function] [call site] 00015
4 jsoncons::basic_null_istream ::basic_null_istream() [function] [call site] 00016
5 jsoncons::basic_null_istream ::null_buffer::null_buffer() [function] [call site] 00017
4 jsoncons::basic_null_istream ::~basic_null_istream() [function] [call site] 00018
5 jsoncons::basic_null_istream ::~basic_null_istream() [function] [call site] 00019
3 jsoncons::bson::bson_decode_options::bson_decode_options(jsoncons::bson::bson_decode_options const&) [function] [call site] 00020
4 jsoncons::bson::bson_options_common::bson_options_common(jsoncons::bson::bson_options_common const&) [function] [call site] 00021
3 jsoncons::bson::bson_decode_options::~bson_decode_options() [function] [call site] 00022
3 jsoncons::stream_source ::~stream_source() [function] [call site] 00023
4 jsoncons::basic_null_istream ::~basic_null_istream() [function] [call site] 00024
3 jsoncons::ser_context::~ser_context() [function] [call site] 00025
1 jsoncons::bson::basic_bson_reader , std::__1::allocator >::read(std::__1::error_code&) [function] [call site] 00026
2 jsoncons::bson::basic_bson_parser , std::__1::allocator >::reset() [function] [call site] 00027
2 jsoncons::bson::basic_bson_parser , std::__1::allocator >::parse(jsoncons::basic_json_visitor &, std::__1::error_code&) [function] [call site] 00028
3 jsoncons::stream_source ::is_error() const [function] [call site] 00029
3 jsoncons::bson::basic_bson_parser , std::__1::allocator >::begin_document(jsoncons::basic_json_visitor &, std::__1::error_code&) [function] [call site] 00030
4 jsoncons::bson::bson_options_common::max_nesting_depth() const [function] [call site] 00031
4 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00032
5 jsoncons::stream_source ::fill_buffer() [function] [call site] 00033
6 __cxa_begin_catch [call site] 00034
6 __cxa_end_catch [call site] 00035
5 __cxa_begin_catch [call site] 00036
5 __cxa_end_catch [call site] 00037
4 std::__1::enable_if ::type jsoncons::binary::little_to_native (unsigned char const*, unsigned long) [function] [call site] 00038
4 jsoncons::basic_json_visitor ::begin_object(jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) [function] [call site] 00039
3 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00040
3 jsoncons::bson::basic_bson_parser , std::__1::allocator >::read_e_name(jsoncons::basic_json_visitor &, jsoncons::bson::bson_container_type, std::__1::error_code&) [function] [call site] 00041
4 jsoncons::bson::basic_bson_parser , std::__1::allocator >::read_cstring(std::__1::error_code&) [function] [call site] 00042
5 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00043
4 _ZN8jsoncons14unicode_traits8validateIcEENSt3__19enable_ifIXsr16extension_traits8is_char8IT_EE5valueENS0_14convert_resultIS4_EEE4typeEPKS4_m [function] [call site] 00044
5 _ZN8jsoncons14unicode_traits13is_legal_utf8IcEENSt3__19enable_ifIXsr16extension_traits8is_char8IT_EE5valueENS0_9conv_errcEE4typeEPKS4_m [function] [call site] 00045
5 __clang_call_terminate [call site] 00046
6 __cxa_begin_catch [call site] 00047
4 jsoncons::detail::basic_string_view >::basic_string_view(char const*, unsigned long) [function] [call site] 00048
4 jsoncons::basic_json_visitor ::key(jsoncons::detail::basic_string_view > const&, jsoncons::ser_context const&, std::__1::error_code&) [function] [call site] 00049
3 jsoncons::bson::basic_bson_parser , std::__1::allocator >::end_document(jsoncons::basic_json_visitor &, std::__1::error_code&) [function] [call site] 00050
4 __cxa_allocate_exception [call site] 00051
4 jsoncons::assertion_error::assertion_error(std::__1::basic_string , std::__1::allocator > const&) [function] [call site] 00052
5 std::runtime_error::runtime_error(std::__1::basic_string , std::__1::allocator > const&) [call site] 00053
4 jsoncons::basic_json_visitor ::end_object(jsoncons::ser_context const&, std::__1::error_code&) [function] [call site] 00054
3 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00055
3 jsoncons::bson::basic_bson_parser , std::__1::allocator >::read_e_name(jsoncons::basic_json_visitor &, jsoncons::bson::bson_container_type, std::__1::error_code&) [function] [call site] 00056
3 jsoncons::bson::basic_bson_parser , std::__1::allocator >::read_value(jsoncons::basic_json_visitor &, unsigned char, std::__1::error_code&) [function] [call site] 00057
4 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00058
4 std::__1::enable_if ::type jsoncons::binary::little_to_native (unsigned char const*, unsigned long) [function] [call site] 00059
4 jsoncons::basic_json_visitor ::double_value(double, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) [function] [call site] 00060
4 jsoncons::bson::basic_bson_parser , std::__1::allocator >::read_string(std::__1::error_code&) [function] [call site] 00061
5 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00062
5 std::__1::enable_if ::type jsoncons::binary::little_to_native (unsigned char const*, unsigned long) [function] [call site] 00063
5 _ZN8jsoncons13source_readerINS_13stream_sourceIhEEE4readINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEENS5_9enable_ifIXaaaasr3std14is_convertibleIhNT_10value_typeEEE5valuesr16extension_traits11has_reserveISD_EE5valuentsr16extension_traits14has_data_exactIPhSD_EE5valueEmE4typeERS2_RSD_m [function] [call site] 00064
6 jsoncons::stream_source ::eof() const [function] [call site] 00065
6 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00066
5 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00067
4 _ZN8jsoncons14unicode_traits8validateIcEENSt3__19enable_ifIXsr16extension_traits8is_char8IT_EE5valueENS0_14convert_resultIS4_EEE4typeEPKS4_m [function] [call site] 00068
4 jsoncons::detail::basic_string_view >::basic_string_view , std::__1::allocator >(std::__1::basic_string , std::__1::allocator > const&) [function] [call site] 00069
4 jsoncons::basic_json_visitor ::string_value(jsoncons::detail::basic_string_view > const&, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) [function] [call site] 00070
4 jsoncons::bson::basic_bson_parser , std::__1::allocator >::read_string(std::__1::error_code&) [function] [call site] 00071
4 _ZN8jsoncons14unicode_traits8validateIcEENSt3__19enable_ifIXsr16extension_traits8is_char8IT_EE5valueENS0_14convert_resultIS4_EEE4typeEPKS4_m [function] [call site] 00072
4 jsoncons::detail::basic_string_view >::basic_string_view , std::__1::allocator >(std::__1::basic_string , std::__1::allocator > const&) [function] [call site] 00073
4 jsoncons::basic_json_visitor ::string_value(jsoncons::detail::basic_string_view > const&, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) [function] [call site] 00074
4 jsoncons::bson::basic_bson_parser , std::__1::allocator >::read_cstring(std::__1::error_code&) [function] [call site] 00075
4 jsoncons::bson::basic_bson_parser , std::__1::allocator >::read_cstring(std::__1::error_code&) [function] [call site] 00076
4 jsoncons::detail::basic_string_view >::basic_string_view , std::__1::allocator >(std::__1::basic_string , std::__1::allocator > const&) [function] [call site] 00077
4 jsoncons::basic_json_visitor ::string_value(jsoncons::detail::basic_string_view > const&, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) [function] [call site] 00078
4 jsoncons::bson::basic_bson_parser , std::__1::allocator >::begin_document(jsoncons::basic_json_visitor &, std::__1::error_code&) [function] [call site] 00079
4 jsoncons::bson::basic_bson_parser , std::__1::allocator >::begin_array(jsoncons::basic_json_visitor &, std::__1::error_code&) [function] [call site] 00080
5 jsoncons::bson::bson_options_common::max_nesting_depth() const [function] [call site] 00081
5 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00082
5 std::__1::enable_if ::type jsoncons::binary::little_to_native (unsigned char const*, unsigned long) [function] [call site] 00083
5 jsoncons::basic_json_visitor ::begin_array(jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) [function] [call site] 00084
4 jsoncons::basic_json_visitor ::null_value(jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) [function] [call site] 00085
4 jsoncons::basic_json_visitor ::null_value(jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) [function] [call site] 00086
4 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00087
4 jsoncons::basic_json_visitor ::bool_value(bool, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) [function] [call site] 00088
4 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00089
4 std::__1::enable_if ::type jsoncons::binary::little_to_native (unsigned char const*, unsigned long) [function] [call site] 00090
4 jsoncons::basic_json_visitor ::int64_value(long, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) [function] [call site] 00091
4 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00092
4 std::__1::enable_if ::type jsoncons::binary::little_to_native (unsigned char const*, unsigned long) [function] [call site] 00093
4 jsoncons::basic_json_visitor ::uint64_value(unsigned long, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) [function] [call site] 00094
4 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00095
4 std::__1::enable_if ::type jsoncons::binary::little_to_native (unsigned char const*, unsigned long) [function] [call site] 00096
4 jsoncons::basic_json_visitor ::int64_value(long, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) [function] [call site] 00097
4 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00098
4 std::__1::enable_if ::type jsoncons::binary::little_to_native (unsigned char const*, unsigned long) [function] [call site] 00099
4 jsoncons::basic_json_visitor ::int64_value(long, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) [function] [call site] 00100
4 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00101
4 std::__1::enable_if ::type jsoncons::binary::little_to_native (unsigned char const*, unsigned long) [function] [call site] 00102
4 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00103
4 _ZN8jsoncons13source_readerINS_13stream_sourceIhEEE4readINSt3__16vectorIhNS5_9allocatorIhEEEEEENS5_9enable_ifIXaaaasr3std14is_convertibleIhNT_10value_typeEEE5valuesr16extension_traits11has_reserveISB_EE5valuesr16extension_traits14has_data_exactIPhSB_EE5valueEmE4typeERS2_RSB_m [function] [call site] 00104
5 jsoncons::stream_source ::eof() const [function] [call site] 00105
5 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00106
4 _ZN8jsoncons18basic_json_visitorIcE17byte_string_valueINSt3__16vectorIhNS3_9allocatorIhEEEEEEbRKT_mRKNS_11ser_contextERNS3_10error_codeENS3_9enable_ifIXsr16extension_traits16is_byte_sequenceIS8_EE5valueEiE4typeE [function] [call site] 00107
5 jsoncons::byte_string_view::byte_string_view(unsigned char const*, unsigned long) [function] [call site] 00108
4 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00109
4 jsoncons::bson::TP1::TP1() [function] [call site] 00110
4 std::__1::enable_if ::type jsoncons::binary::little_to_native (unsigned char const*, unsigned long) [function] [call site] 00111
4 std::__1::enable_if ::type jsoncons::binary::little_to_native (unsigned char const*, unsigned long) [function] [call site] 00112
4 jsoncons::bson::decimal128_to_chars(char*, char*, jsoncons::bson::TP1 const&) [function] [call site] 00113
5 jsoncons::bson::detail::bson_uint128_divide1B(jsoncons::bson::bson_uint128_t, jsoncons::bson::bson_uint128_t*, unsigned int*) [function] [call site] 00114
5 _ZN8jsoncons6detail12from_integerIiNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEENS2_9enable_ifIXsr16extension_traits10is_integerIT_EE5valueEmE4typeESA_RT0_ [function] [call site] 00115
6 __cxa_allocate_exception [call site] 00116
6 jsoncons::assertion_error::assertion_error(std::__1::basic_string , std::__1::allocator > const&) [function] [call site] 00117
4 jsoncons::detail::basic_string_view >::basic_string_view(char const*, unsigned long) [function] [call site] 00118
4 jsoncons::basic_json_visitor ::string_value(jsoncons::detail::basic_string_view > const&, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) [function] [call site] 00119
4 jsoncons::stream_source ::read(unsigned char*, unsigned long) [function] [call site] 00120
4 jsoncons::bson::oid_t::oid_t(unsigned char*) [function] [call site] 00121
4 void jsoncons::bson::to_string , std::__1::allocator > >(jsoncons::bson::oid_t const&, std::__1::basic_string , std::__1::allocator >&) [function] [call site] 00122
5 jsoncons::bson::detail::init_hex_char_pairs(jsoncons::bson::oid_t const&, unsigned short*) [function] [call site] 00123
6 jsoncons::bson::oid_t::data() const [function] [call site] 00124
6 jsoncons::bson::detail::get_hex_char_pairs(std::__1::integral_constant ) [function] [call site] 00125
4 jsoncons::detail::basic_string_view >::basic_string_view , std::__1::allocator >(std::__1::basic_string , std::__1::allocator > const&) [function] [call site] 00126
4 jsoncons::basic_json_visitor ::string_value(jsoncons::detail::basic_string_view > const&, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) [function] [call site] 00127
3 jsoncons::bson::basic_bson_parser , std::__1::allocator >::end_array(jsoncons::basic_json_visitor &, std::__1::error_code&) [function] [call site] 00128
4 __cxa_allocate_exception [call site] 00129
4 jsoncons::assertion_error::assertion_error(std::__1::basic_string , std::__1::allocator > const&) [function] [call site] 00130
4 jsoncons::basic_json_visitor ::end_array(jsoncons::ser_context const&, std::__1::error_code&) [function] [call site] 00131
3 jsoncons::bson::basic_bson_parser , std::__1::allocator >::read_value(jsoncons::basic_json_visitor &, unsigned char, std::__1::error_code&) [function] [call site] 00132
3 __cxa_allocate_exception [call site] 00133
3 jsoncons::assertion_error::assertion_error(std::__1::basic_string , std::__1::allocator > const&) [function] [call site] 00134
3 jsoncons::basic_json_visitor ::flush() [function] [call site] 00135
1 jsoncons::bson::basic_bson_reader , std::__1::allocator >::~basic_bson_reader() [function] [call site] 00136
2 jsoncons::bson::basic_bson_parser , std::__1::allocator >::~basic_bson_parser() [function] [call site] 00137
3 jsoncons::stream_source ::~stream_source() [function] [call site] 00138
3 jsoncons::ser_context::~ser_context() [function] [call site] 00139
1 jsoncons::bson::basic_bson_encoder >, void>, std::__1::allocator >::~basic_bson_encoder() [function] [call site] 00140
2 jsoncons::bytes_sink >, void>::flush() [function] [call site] 00141
2 jsoncons::bson::bson_encode_options::~bson_encode_options() [function] [call site] 00142
2 jsoncons::basic_json_visitor ::~basic_json_visitor() [function] [call site] 00143