protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

Regression: changes in descriptor_databases (?) break codegen check in protobuf-c with Bus error

Open barracuda156 opened this issue 2 months ago • 2 comments

What version of protobuf and what language are you using? protobuf 33.0 protobuf-c 1.5.2

Language: C++

What operating system (Linux, Windows, ...) and version? macOS 10.6.8 / ppc (Yeah, I know this is an “exotic environment”, but this is C++, there is no reason it should fail, especially given that an earlier version worked.)

What runtime / compiler are you using (e.g., python version or gcc version) gcc 14.3.0 / libstdc++ runtime

What did you do? Install protobuf 33.0, try building protobuf-c 1.5.2 with it.

What did you expect to see

protobuf-c 1.5.2 has built fine with protobuf 30.2. The same version should continue to build successfully.

What did you see instead?

It does not build with protobuf 33.0. A crash happens on test_unknown_fields: https://github.com/protobuf-c/protobuf-c/blob/4719fdd7760624388c2c5b9d6759eb6a47490626/t/generated-code2/cxx-generate-packed-data.cc#L998-L1089

(gdb) run
Starting program: /opt/local/var/macports/build/protobuf-c-88730db5/work/protobuf-c-1.5.2/t/generated-code2/cxx-generate-packed-data
Reading symbols for shared libraries .+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++......... done
cxx-generate-packed-data(71550) malloc: *** error for object 0xa04dc754: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
cxx-generate-packed-data(71550) malloc: *** error for object 0xa04dc7c4: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
static const uint8_t test_enum_small_NEG_VALUE[] = { 0x08, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_enum_small_VALUE[] = { 0x08, 0x00 };
static const uint8_t test_enum_small_OTHER_VALUE[] = { 0x08, 0x01 };
static const uint8_t test_enum_big_VALUENEG123456[] = { 0x08, 0xc0, 0xbb, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_enum_big_VALUENEG1[] = { 0x08, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_enum_big_VALUE0[] = { 0x08, 0x00 };
static const uint8_t test_enum_big_VALUE127[] = { 0x08, 0x7f };
static const uint8_t test_enum_big_VALUE128[] = { 0x08, 0x80, 0x01 };
static const uint8_t test_enum_big_VALUE16383[] = { 0x08, 0xff, 0x7f };
static const uint8_t test_enum_big_VALUE16384[] = { 0x08, 0x80, 0x80, 0x01 };
static const uint8_t test_enum_big_VALUE2097151[] = { 0x08, 0xff, 0xff, 0x7f };
static const uint8_t test_enum_big_VALUE2097152[] = { 0x08, 0x80, 0x80, 0x80, 0x01 };
static const uint8_t test_enum_big_VALUE268435455[] = { 0x08, 0xff, 0xff, 0xff, 0x7f };
static const uint8_t test_enum_big_VALUE268435456[] = { 0x08, 0x80, 0x80, 0x80, 0x80, 0x01 };
static const uint8_t test_field_number_15[] = { 0x7a, 0x03, 0x74, 0x73, 0x74 };
static const uint8_t test_field_number_16[] = { 0x82, 0x01, 0x03, 0x74, 0x73, 0x74 };
static const uint8_t test_field_number_2047[] = { 0xfa, 0x7f, 0x03, 0x74, 0x73, 0x74 };
static const uint8_t test_field_number_2048[] = { 0x82, 0x80, 0x01, 0x03, 0x74, 0x73, 0x74 };
static const uint8_t test_field_number_262143[] = { 0xfa, 0xff, 0x7f, 0x03, 0x74, 0x73, 0x74 };
static const uint8_t test_field_number_262144[] = { 0x82, 0x80, 0x80, 0x01, 0x03, 0x74, 0x73, 0x74 };
static const uint8_t test_field_number_33554431[] = { 0xfa, 0xff, 0xff, 0x7f, 0x03, 0x74, 0x73, 0x74 };
static const uint8_t test_field_number_33554432[] = { 0x82, 0x80, 0x80, 0x80, 0x01, 0x03, 0x74, 0x73, 0x74 };
static const uint8_t test_required_int32_min[] = { 0xd0, 0x02, 0x80, 0x80, 0x80, 0x80, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_required_int32_m1000[] = { 0xd0, 0x02, 0x98, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_required_int32_0[] = { 0xd0, 0x02, 0x00 };
static const uint8_t test_required_int32_max[] = { 0xd0, 0x02, 0xff, 0xff, 0xff, 0xff, 0x07 };
static const uint8_t test_required_sint32_min[] = { 0xd8, 0x02, 0xff, 0xff, 0xff, 0xff, 0x0f };
static const uint8_t test_required_sint32_m1000[] = { 0xd8, 0x02, 0xcf, 0x0f };
static const uint8_t test_required_sint32_0[] = { 0xd8, 0x02, 0x00 };
static const uint8_t test_required_sint32_max[] = { 0xd8, 0x02, 0xfe, 0xff, 0xff, 0xff, 0x0f };
static const uint8_t test_required_sfixed32_min[] = { 0xa5, 0x06, 0x00, 0x00, 0x00, 0x80 };
static const uint8_t test_required_sfixed32_m1000[] = { 0xa5, 0x06, 0x18, 0xfc, 0xff, 0xff };
static const uint8_t test_required_sfixed32_0[] = { 0xa5, 0x06, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_required_sfixed32_max[] = { 0xa5, 0x06, 0xff, 0xff, 0xff, 0x7f };
static const uint8_t test_required_uint32_0[] = { 0x08, 0x00 };
static const uint8_t test_required_uint32_million[] = { 0x08, 0xc0, 0x84, 0x3d };
static const uint8_t test_required_uint32_max[] = { 0x08, 0xff, 0xff, 0xff, 0xff, 0x0f };
static const uint8_t test_required_fixed32_0[] = { 0x0d, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_required_fixed32_million[] = { 0x0d, 0x40, 0x42, 0x0f, 0x00 };
static const uint8_t test_required_fixed32_max[] = { 0x0d, 0xff, 0xff, 0xff, 0xff };
static const uint8_t test_required_int64_min[] = { 0x08, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x01 };
static const uint8_t test_required_int64_mtril[] = { 0x08, 0x80, 0xe0, 0xeb, 0xda, 0xf2, 0xe2, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_required_int64_0[] = { 0x08, 0x00 };
static const uint8_t test_required_int64_quad[] = { 0x08, 0x80, 0x80, 0x9a, 0xa6, 0xea, 0xaf, 0xe3, 0x01 };
static const uint8_t test_required_int64_max[] = { 0x08, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f };
static const uint8_t test_required_sint64_min[] = { 0x58, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_required_sint64_mtril[] = { 0x58, 0xff, 0xbf, 0xa8, 0xca, 0x9a, 0x3a };
static const uint8_t test_required_sint64_0[] = { 0x58, 0x00 };
static const uint8_t test_required_sint64_quad[] = { 0x58, 0x80, 0x80, 0xb4, 0xcc, 0xd4, 0xdf, 0xc6, 0x03 };
static const uint8_t test_required_sint64_max[] = { 0x58, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_required_sfixed64_min[] = { 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 };
static const uint8_t test_required_sfixed64_mtril[] = { 0x61, 0x00, 0xf0, 0x5a, 0x2b, 0x17, 0xff, 0xff, 0xff };
static const uint8_t test_required_sfixed64_0[] = { 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_required_sfixed64_quad[] = { 0x61, 0x00, 0x80, 0xc6, 0xa4, 0x7e, 0x8d, 0x03, 0x00 };
static const uint8_t test_required_sfixed64_max[] = { 0x61, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f };
static const uint8_t test_required_uint64_0[] = { 0x08, 0x00 };
static const uint8_t test_required_uint64_thou[] = { 0x08, 0xe8, 0x07 };
static const uint8_t test_required_uint64_mill[] = { 0x08, 0xc0, 0x84, 0x3d };
static const uint8_t test_required_uint64_bill[] = { 0x08, 0x80, 0x94, 0xeb, 0xdc, 0x03 };
static const uint8_t test_required_uint64_20_bill[] = { 0x08, 0x80, 0x90, 0xdf, 0xc0, 0x4a };
static const uint8_t test_required_uint64_tril[] = { 0x08, 0x80, 0xa0, 0x94, 0xa5, 0x8d, 0x1d };
static const uint8_t test_required_uint64_20_tril[] = { 0x08, 0x80, 0x80, 0x95, 0xe7, 0x89, 0xc6, 0x04 };
static const uint8_t test_required_uint64_quad[] = { 0x08, 0x80, 0x80, 0x9a, 0xa6, 0xea, 0xaf, 0xe3, 0x01 };
static const uint8_t test_required_uint64_quint[] = { 0x08, 0x80, 0x80, 0x90, 0xbb, 0xba, 0xd6, 0xad, 0xf0, 0x0d };
static const uint8_t test_required_uint64_max[] = { 0x08, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_required_fixed64_0[] = { 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_required_fixed64_thou[] = { 0x09, 0xe8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_required_fixed64_mill[] = { 0x09, 0x40, 0x42, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_required_fixed64_bill[] = { 0x09, 0x00, 0xca, 0x9a, 0x3b, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_required_fixed64_tril[] = { 0x09, 0x00, 0x10, 0xa5, 0xd4, 0xe8, 0x00, 0x00, 0x00 };
static const uint8_t test_required_fixed64_quad[] = { 0x09, 0x00, 0x80, 0xc6, 0xa4, 0x7e, 0x8d, 0x03, 0x00 };
static const uint8_t test_required_fixed64_quint[] = { 0x09, 0x00, 0x00, 0x64, 0xa7, 0xb3, 0xb6, 0xe0, 0x0d };
static const uint8_t test_required_fixed64_max[] = { 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
static const uint8_t test_required_float_mthou[] = { 0x0d, 0x00, 0x00, 0x7a, 0xc4 };
static const uint8_t test_required_float_0[] = { 0x0d, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_required_float_420[] = { 0x0d, 0x00, 0x00, 0xd2, 0x43 };
static const uint8_t test_required_double_mthou[] = { 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x8f, 0xc0 };
static const uint8_t test_required_double_0[] = { 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_required_double_420[] = { 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x7a, 0x40 };
static const uint8_t test_required_bool_0[] = { 0x08, 0x00 };
static const uint8_t test_required_bool_1[] = { 0x08, 0x01 };
static const uint8_t test_required_enum_small_VALUE[] = { 0x08, 0x00 };
static const uint8_t test_required_enum_small_OTHER_VALUE[] = { 0x08, 0x01 };
static const uint8_t test_required_enum_neg1[] = { 0x08, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_required_enum_0[] = { 0x08, 0x00 };
static const uint8_t test_required_enum_1[] = { 0x08, 0x01 };
static const uint8_t test_required_enum_127[] = { 0x08, 0x7f };
static const uint8_t test_required_enum_128[] = { 0x08, 0x80, 0x01 };
static const uint8_t test_required_enum_16383[] = { 0x08, 0xff, 0x7f };
static const uint8_t test_required_enum_16384[] = { 0x08, 0x80, 0x80, 0x01 };
static const uint8_t test_required_enum_2097151[] = { 0x08, 0xff, 0xff, 0x7f };
static const uint8_t test_required_enum_2097152[] = { 0x08, 0x80, 0x80, 0x80, 0x01 };
static const uint8_t test_required_enum_268435455[] = { 0x08, 0xff, 0xff, 0xff, 0x7f };
static const uint8_t test_required_enum_268435456[] = { 0x08, 0x80, 0x80, 0x80, 0x80, 0x01 };
static const uint8_t test_required_string_empty[] = { 0x0a, 0x00 };
static const uint8_t test_required_string_hello[] = { 0x0a, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f };
static const uint8_t test_required_string_long[] = { 0x0a, 0xdf, 0x01, 0x74, 0x77, 0x6f, 0x20, 0x68, 0x75, 0x6e, 0x64, 0x72, 0x65, 0x64, 0x20, 0x78, 0x73, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x3a, 0x20, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 };
static const uint8_t test_required_bytes_empty[] = { 0x0a, 0x00 };
static const uint8_t test_required_bytes_hello[] = { 0x0a, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f };
static const uint8_t test_required_bytes_random[] = { 0x0a, 0x05, 0x01, 0x00, 0xfd, 0x02, 0x04 };
static const uint8_t test_required_submess_0[] = { 0x0a, 0x02, 0x20, 0x00 };
static const uint8_t test_required_submess_42[] = { 0x0a, 0x02, 0x20, 0x2a };
static const uint8_t test_optional_int32_min[] = { 0x08, 0x80, 0x80, 0x80, 0x80, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_optional_int32_m1[] = { 0x08, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_optional_int32_0[] = { 0x08, 0x00 };
static const uint8_t test_optional_int32_666[] = { 0x08, 0x9a, 0x05 };
static const uint8_t test_optional_int32_max[] = { 0x08, 0xff, 0xff, 0xff, 0xff, 0x07 };
static const uint8_t test_optional_sint32_min[] = { 0x10, 0xff, 0xff, 0xff, 0xff, 0x0f };
static const uint8_t test_optional_sint32_m1[] = { 0x10, 0x01 };
static const uint8_t test_optional_sint32_0[] = { 0x10, 0x00 };
static const uint8_t test_optional_sint32_666[] = { 0x10, 0xb4, 0x0a };
static const uint8_t test_optional_sint32_max[] = { 0x10, 0xfe, 0xff, 0xff, 0xff, 0x0f };
static const uint8_t test_optional_sfixed32_min[] = { 0x1d, 0x00, 0x00, 0x00, 0x80 };
static const uint8_t test_optional_sfixed32_m1[] = { 0x1d, 0xff, 0xff, 0xff, 0xff };
static const uint8_t test_optional_sfixed32_0[] = { 0x1d, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_optional_sfixed32_666[] = { 0x1d, 0x9a, 0x02, 0x00, 0x00 };
static const uint8_t test_optional_sfixed32_max[] = { 0x1d, 0xff, 0xff, 0xff, 0x7f };
static const uint8_t test_optional_int64_min[] = { 0x20, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x01 };
static const uint8_t test_optional_int64_m1111111111LL[] = { 0x20, 0xb9, 0x94, 0x97, 0xee, 0xfb, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_optional_int64_0[] = { 0x20, 0x00 };
static const uint8_t test_optional_int64_quintillion[] = { 0x20, 0x80, 0x80, 0x90, 0xbb, 0xba, 0xd6, 0xad, 0xf0, 0x0d };
static const uint8_t test_optional_int64_max[] = { 0x20, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f };
static const uint8_t test_optional_sint64_min[] = { 0x28, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_optional_sint64_m1111111111LL[] = { 0x28, 0x8d, 0xd7, 0xd1, 0xa3, 0x08 };
static const uint8_t test_optional_sint64_0[] = { 0x28, 0x00 };
static const uint8_t test_optional_sint64_quintillion[] = { 0x28, 0x80, 0x80, 0xa0, 0xf6, 0xf4, 0xac, 0xdb, 0xe0, 0x1b };
static const uint8_t test_optional_sint64_max[] = { 0x28, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_optional_sfixed64_min[] = { 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 };
static const uint8_t test_optional_sfixed64_m1111111111LL[] = { 0x31, 0x39, 0xca, 0xc5, 0xbd, 0xff, 0xff, 0xff, 0xff };
static const uint8_t test_optional_sfixed64_0[] = { 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_optional_sfixed64_quintillion[] = { 0x31, 0x00, 0x00, 0x64, 0xa7, 0xb3, 0xb6, 0xe0, 0x0d };
static const uint8_t test_optional_sfixed64_max[] = { 0x31, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f };
static const uint8_t test_optional_uint32_0[] = { 0x38, 0x00 };
static const uint8_t test_optional_uint32_669[] = { 0x38, 0x9d, 0x05 };
static const uint8_t test_optional_uint32_max[] = { 0x38, 0xff, 0xff, 0xff, 0xff, 0x0f };
static const uint8_t test_optional_fixed32_0[] = { 0x45, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_optional_fixed32_669[] = { 0x45, 0x9d, 0x02, 0x00, 0x00 };
static const uint8_t test_optional_fixed32_max[] = { 0x45, 0xff, 0xff, 0xff, 0xff };
static const uint8_t test_optional_uint64_0[] = { 0x48, 0x00 };
static const uint8_t test_optional_uint64_669669669669669[] = { 0x48, 0xa5, 0x96, 0x9c, 0xf6, 0xf9, 0xa1, 0x98, 0x01 };
static const uint8_t test_optional_uint64_max[] = { 0x48, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_optional_fixed64_0[] = { 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_optional_fixed64_669669669669669[] = { 0x51, 0x25, 0x0b, 0xc7, 0x9e, 0x0f, 0x61, 0x02, 0x00 };
static const uint8_t test_optional_fixed64_max[] = { 0x51, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
static const uint8_t test_optional_float_m100[] = { 0x5d, 0x00, 0x00, 0xc8, 0xc2 };
static const uint8_t test_optional_float_0[] = { 0x5d, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_optional_float_141243[] = { 0x5d, 0xc0, 0xee, 0x09, 0x48 };
static const uint8_t test_optional_double_m100[] = { 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0xc0 };
static const uint8_t test_optional_double_0[] = { 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_optional_double_141243[] = { 0x61, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x3d, 0x01, 0x41 };
static const uint8_t test_optional_bool_0[] = { 0x68, 0x00 };
static const uint8_t test_optional_bool_1[] = { 0x68, 0x01 };
static const uint8_t test_optional_enum_small_neg1[] = { 0x70, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_optional_enum_small_0[] = { 0x70, 0x00 };
static const uint8_t test_optional_enum_small_1[] = { 0x70, 0x01 };
static const uint8_t test_optional_enum_neg1[] = { 0x78, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_optional_enum_0[] = { 0x78, 0x00 };
static const uint8_t test_optional_enum_1[] = { 0x78, 0x01 };
static const uint8_t test_optional_enum_127[] = { 0x78, 0x7f };
static const uint8_t test_optional_enum_128[] = { 0x78, 0x80, 0x01 };
static const uint8_t test_optional_enum_16383[] = { 0x78, 0xff, 0x7f };
static const uint8_t test_optional_enum_16384[] = { 0x78, 0x80, 0x80, 0x01 };
static const uint8_t test_optional_enum_2097151[] = { 0x78, 0xff, 0xff, 0x7f };
static const uint8_t test_optional_enum_2097152[] = { 0x78, 0x80, 0x80, 0x80, 0x01 };
static const uint8_t test_optional_enum_268435455[] = { 0x78, 0xff, 0xff, 0xff, 0x7f };
static const uint8_t test_optional_enum_268435456[] = { 0x78, 0x80, 0x80, 0x80, 0x80, 0x01 };
static const uint8_t test_optional_string_empty[] = { 0x82, 0x01, 0x00 };
static const uint8_t test_optional_string_hello[] = { 0x82, 0x01, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f };
static const uint8_t test_optional_bytes_empty[] = { 0x8a, 0x01, 0x00 };
static const uint8_t test_optional_bytes_hello[] = { 0x8a, 0x01, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f };
static const uint8_t test_optional_bytes_random[] = { 0x8a, 0x01, 0x05, 0x01, 0x00, 0xfd, 0x02, 0x04 };
static const uint8_t test_optional_submess_0[] = { 0x92, 0x01, 0x02, 0x20, 0x00 };
static const uint8_t test_optional_submess_42[] = { 0x92, 0x01, 0x02, 0x20, 0x2a };
static const uint8_t test_oneof_merge_double[] = { 0x8a, 0x01, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x92, 0x01, 0x02, 0x20, 0x2a, 0x82, 0x01, 0x00, 0x08, 0x9a, 0x05, 0x5d, 0x00, 0x80, 0xa6, 0x43, 0x61, 0x00, 0x00, 0x00, 0x83, 0xda, 0x7d, 0xba, 0x41 };
static const uint8_t test_oneof_merge_float[] = { 0x8a, 0x01, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x92, 0x01, 0x02, 0x20, 0x2a, 0x82, 0x01, 0x00, 0x08, 0x9a, 0x05, 0x61, 0x00, 0x00, 0x00, 0x83, 0xda, 0x7d, 0xba, 0x41, 0x5d, 0x00, 0x80, 0xa6, 0x43 };
static const uint8_t test_oneof_merge_int32[] = { 0x8a, 0x01, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x92, 0x01, 0x02, 0x20, 0x2a, 0x82, 0x01, 0x00, 0x5d, 0x00, 0x80, 0xa6, 0x43, 0x61, 0x00, 0x00, 0x00, 0x83, 0xda, 0x7d, 0xba, 0x41, 0x08, 0x9a, 0x05 };
static const uint8_t test_oneof_merge_string[] = { 0x8a, 0x01, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x92, 0x01, 0x02, 0x20, 0x2a, 0x08, 0x9a, 0x05, 0x5d, 0x00, 0x80, 0xa6, 0x43, 0x61, 0x00, 0x00, 0x00, 0x83, 0xda, 0x7d, 0xba, 0x41, 0x82, 0x01, 0x00 };
static const uint8_t test_oneof_merge_submess[] = { 0x8a, 0x01, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x82, 0x01, 0x00, 0x08, 0x9a, 0x05, 0x5d, 0x00, 0x80, 0xa6, 0x43, 0x61, 0x00, 0x00, 0x00, 0x83, 0xda, 0x7d, 0xba, 0x41, 0x92, 0x01, 0x02, 0x20, 0x2a };
static const uint8_t test_oneof_merge_bytes[] = { 0x92, 0x01, 0x02, 0x20, 0x2a, 0x82, 0x01, 0x00, 0x08, 0x9a, 0x05, 0x5d, 0x00, 0x80, 0xa6, 0x43, 0x61, 0x00, 0x00, 0x00, 0x83, 0xda, 0x7d, 0xba, 0x41, 0x8a, 0x01, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f };
static const uint8_t test_repeated_int32_arr0[] = { 0x08, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x08, 0x01 };
static const uint8_t test_repeated_int32_arr1[] = { 0x08, 0x2a, 0x08, 0x9a, 0x05, 0x08, 0xcd, 0xb9, 0xbb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x08, 0x00, 0x08, 0x2f };
static const uint8_t test_repeated_int32_arr_min_max[] = { 0x08, 0x80, 0x80, 0x80, 0x80, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x01, 0x08, 0xff, 0xff, 0xff, 0xff, 0x07 };
static const uint8_t test_repeated_sint32_arr0[] = { 0x10, 0x01, 0x10, 0x02 };
static const uint8_t test_repeated_sint32_arr1[] = { 0x10, 0x54, 0x10, 0xb4, 0x0a, 0x10, 0xe5, 0x8c, 0x89, 0x01, 0x10, 0x00, 0x10, 0x5e };
static const uint8_t test_repeated_sint32_arr_min_max[] = { 0x10, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0xfe, 0xff, 0xff, 0xff, 0x0f };
static const uint8_t test_repeated_uint32_roundnumbers[] = { 0x38, 0x80, 0x94, 0xeb, 0xdc, 0x03, 0x38, 0xc0, 0x84, 0x3d, 0x38, 0x01, 0x38, 0x00 };
static const uint8_t test_repeated_uint32_0_max[] = { 0x38, 0x00, 0x38, 0xff, 0xff, 0xff, 0xff, 0x0f };
static const uint8_t test_repeated_sfixed32_arr0[] = { 0x1d, 0xff, 0xff, 0xff, 0xff, 0x1d, 0x01, 0x00, 0x00, 0x00 };
static const uint8_t test_repeated_sfixed32_arr1[] = { 0x1d, 0x2a, 0x00, 0x00, 0x00, 0x1d, 0x9a, 0x02, 0x00, 0x00, 0x1d, 0xcd, 0xdc, 0xee, 0xff, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x2f, 0x00, 0x00, 0x00 };
static const uint8_t test_repeated_sfixed32_arr_min_max[] = { 0x1d, 0x00, 0x00, 0x00, 0x80, 0x1d, 0xff, 0xff, 0xff, 0x7f };
static const uint8_t test_repeated_fixed32_roundnumbers[] = { 0x45, 0x00, 0xca, 0x9a, 0x3b, 0x45, 0x40, 0x42, 0x0f, 0x00, 0x45, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_repeated_fixed32_0_max[] = { 0x45, 0x00, 0x00, 0x00, 0x00, 0x45, 0xff, 0xff, 0xff, 0xff };
static const uint8_t test_repeated_int64_roundnumbers[] = { 0x20, 0x80, 0x80, 0xf0, 0xc4, 0xc5, 0xa9, 0xd2, 0x8f, 0xf2, 0x01, 0x20, 0x80, 0x80, 0xe6, 0xd9, 0x95, 0xd0, 0x9c, 0xfe, 0xff, 0x01, 0x20, 0x80, 0xe0, 0xeb, 0xda, 0xf2, 0xe2, 0xff, 0xff, 0xff, 0x01, 0x20, 0x80, 0xec, 0x94, 0xa3, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x01, 0x20, 0xc0, 0xfb, 0xc2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x20, 0x98, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x20, 0x01, 0x20, 0xe8, 0x07, 0x20, 0xc0, 0x84, 0x3d, 0x20, 0x80, 0x94, 0xeb, 0xdc, 0x03, 0x20, 0x80, 0xa0, 0x94, 0xa5, 0x8d, 0x1d, 0x20, 0x80, 0x80, 0x9a, 0xa6, 0xea, 0xaf, 0xe3, 0x01, 0x20, 0x80, 0x80, 0x90, 0xbb, 0xba, 0xd6, 0xad, 0xf0, 0x0d, 0x20, 0x00, 0x20, 0x00 };
static const uint8_t test_repeated_int64_min_max[] = { 0x20, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x01, 0x20, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f };
static const uint8_t test_repeated_sint64_roundnumbers[] = { 0x28, 0xff, 0xff, 0x9f, 0xf6, 0xf4, 0xac, 0xdb, 0xe0, 0x1b, 0x28, 0xff, 0xff, 0xb3, 0xcc, 0xd4, 0xdf, 0xc6, 0x03, 0x28, 0xff, 0xbf, 0xa8, 0xca, 0x9a, 0x3a, 0x28, 0xff, 0xa7, 0xd6, 0xb9, 0x07, 0x28, 0xff, 0x88, 0x7a, 0x28, 0xcf, 0x0f, 0x28, 0x02, 0x28, 0xd0, 0x0f, 0x28, 0x80, 0x89, 0x7a, 0x28, 0x80, 0xa8, 0xd6, 0xb9, 0x07, 0x28, 0x80, 0xc0, 0xa8, 0xca, 0x9a, 0x3a, 0x28, 0x80, 0x80, 0xb4, 0xcc, 0xd4, 0xdf, 0xc6, 0x03, 0x28, 0x80, 0x80, 0xa0, 0xf6, 0xf4, 0xac, 0xdb, 0xe0, 0x1b, 0x28, 0x00, 0x28, 0x00 };
static const uint8_t test_repeated_sint64_min_max[] = { 0x28, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x28, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_repeated_sfixed64_roundnumbers[] = { 0x31, 0x00, 0x00, 0x9c, 0x58, 0x4c, 0x49, 0x1f, 0xf2, 0x31, 0x00, 0x80, 0x39, 0x5b, 0x81, 0x72, 0xfc, 0xff, 0x31, 0x00, 0xf0, 0x5a, 0x2b, 0x17, 0xff, 0xff, 0xff, 0x31, 0x00, 0x36, 0x65, 0xc4, 0xff, 0xff, 0xff, 0xff, 0x31, 0xc0, 0xbd, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x31, 0x18, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x31, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0xe8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x40, 0x42, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x00, 0xca, 0x9a, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x31, 0x00, 0x10, 0xa5, 0xd4, 0xe8, 0x00, 0x00, 0x00, 0x31, 0x00, 0x80, 0xc6, 0xa4, 0x7e, 0x8d, 0x03, 0x00, 0x31, 0x00, 0x00, 0x64, 0xa7, 0xb3, 0xb6, 0xe0, 0x0d, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_repeated_sfixed64_min_max[] = { 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x31, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f };
static const uint8_t test_repeated_uint64_roundnumbers[] = { 0x48, 0x01, 0x48, 0xe8, 0x07, 0x48, 0xc0, 0x84, 0x3d, 0x48, 0x80, 0x94, 0xeb, 0xdc, 0x03, 0x48, 0x80, 0xa0, 0x94, 0xa5, 0x8d, 0x1d, 0x48, 0x80, 0x80, 0x9a, 0xa6, 0xea, 0xaf, 0xe3, 0x01, 0x48, 0x80, 0x80, 0x90, 0xbb, 0xba, 0xd6, 0xad, 0xf0, 0x0d, 0x48, 0x00, 0x48, 0x00 };
static const uint8_t test_repeated_uint64_0_1_max[] = { 0x48, 0x00, 0x48, 0x01, 0x48, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_repeated_uint64_random[] = { 0x48, 0x00, 0x48, 0x9a, 0x05, 0x48, 0x80, 0xd4, 0xdb, 0xd2, 0x0f, 0x48, 0xa1, 0x80, 0x80, 0xb2, 0xa7, 0xe7, 0xda, 0x85, 0xde, 0x01 };
static const uint8_t test_repeated_fixed64_roundnumbers[] = { 0x51, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0xe8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x40, 0x42, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0xca, 0x9a, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x10, 0xa5, 0xd4, 0xe8, 0x00, 0x00, 0x00, 0x51, 0x00, 0x80, 0xc6, 0xa4, 0x7e, 0x8d, 0x03, 0x00, 0x51, 0x00, 0x00, 0x64, 0xa7, 0xb3, 0xb6, 0xe0, 0x0d, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_repeated_fixed64_0_1_max[] = { 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
static const uint8_t test_repeated_fixed64_random[] = { 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x9a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0xea, 0x56, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x51, 0x21, 0x00, 0x40, 0x76, 0x3a, 0x6b, 0x0b, 0xde };
static const uint8_t test_repeated_float_random[] = { 0x5d, 0x00, 0x00, 0x7a, 0xc4, 0x5d, 0x00, 0x00, 0xc8, 0xc2, 0x5d, 0x00, 0x00, 0x28, 0xc2, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x80, 0x26, 0x44, 0x5d, 0x40, 0x3c, 0x00, 0x48 };
static const uint8_t test_repeated_double_random[] = { 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x8f, 0xc0, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0xc0, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0xc0, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x84, 0x40, 0x61, 0x00, 0x00, 0x00, 0x00, 0x88, 0x07, 0x00, 0x41 };
static const uint8_t test_repeated_boolean_0[] = { 0x68, 0x00 };
static const uint8_t test_repeated_boolean_1[] = { 0x68, 0x01 };
static const uint8_t test_repeated_boolean_random[] = { 0x68, 0x00, 0x68, 0x01, 0x68, 0x01, 0x68, 0x00, 0x68, 0x00, 0x68, 0x01, 0x68, 0x01, 0x68, 0x01, 0x68, 0x00, 0x68, 0x00, 0x68, 0x00, 0x68, 0x00, 0x68, 0x00, 0x68, 0x01, 0x68, 0x01, 0x68, 0x01, 0x68, 0x01, 0x68, 0x01, 0x68, 0x01, 0x68, 0x00, 0x68, 0x01, 0x68, 0x01, 0x68, 0x00, 0x68, 0x01, 0x68, 0x01, 0x68, 0x00 };
static const uint8_t test_repeated_enum_small_0[] = { 0x70, 0x00 };
static const uint8_t test_repeated_enum_small_1[] = { 0x70, 0x01 };
static const uint8_t test_repeated_enum_small_random[] = { 0x70, 0x00, 0x70, 0x01, 0x70, 0x01, 0x70, 0x00, 0x70, 0x00, 0x70, 0x01, 0x70, 0x01, 0x70, 0x01, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x01, 0x70, 0x01, 0x70, 0x01, 0x70, 0x01, 0x70, 0x01, 0x70, 0x01, 0x70, 0x00, 0x70, 0x01, 0x70, 0x01, 0x70, 0x00, 0x70, 0x01, 0x70, 0x01, 0x70, 0x00 };
static const uint8_t test_repeated_enum_0[] = { 0x78, 0x00 };
static const uint8_t test_repeated_enum_1[] = { 0x78, 0x01 };
static const uint8_t test_repeated_enum_random[] = { 0x78, 0x00, 0x78, 0xff, 0xff, 0xff, 0x7f, 0x78, 0x7f, 0x78, 0x80, 0x80, 0x01, 0x78, 0xff, 0x7f, 0x78, 0x80, 0x80, 0x80, 0x01, 0x78, 0xff, 0xff, 0x7f, 0x78, 0x80, 0x01, 0x78, 0x80, 0x80, 0x80, 0x80, 0x01, 0x78, 0x00, 0x78, 0x80, 0x80, 0x80, 0x01, 0x78, 0xff, 0xff, 0xff, 0x7f, 0x78, 0x7f, 0x78, 0xff, 0x7f, 0x78, 0x80, 0x80, 0x01 };
static const uint8_t test_repeated_strings_0[] = { 0x82, 0x01, 0x09, 0x6f, 0x6e, 0x65, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67 };
static const uint8_t test_repeated_strings_1[] = { 0x82, 0x01, 0x03, 0x74, 0x77, 0x6f, 0x82, 0x01, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67 };
static const uint8_t test_repeated_strings_2[] = { 0x82, 0x01, 0x04, 0x6d, 0x61, 0x6e, 0x79, 0x82, 0x01, 0x04, 0x74, 0x69, 0x6e, 0x79, 0x82, 0x01, 0x06, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x82, 0x01, 0x07, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x82, 0x01, 0x06, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x82, 0x01, 0x02, 0x62, 0x65, 0x82, 0x01, 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x64 };
static const uint8_t test_repeated_strings_3[] = { 0x82, 0x01, 0xcb, 0x02, 0x6f, 0x6e, 0x65, 0x20, 0x76, 0x65, 0x72, 0x79, 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58 };
static const uint8_t test_repeated_bytes_0[] = { 0x8a, 0x01, 0x04, 0x74, 0x65, 0x78, 0x74, 0x8a, 0x01, 0x09, 0x73, 0x74, 0x72, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x8a, 0x01, 0x0a, 0x67, 0x6f, 0x62, 0x62, 0x6c, 0x65, 0x00, 0x66, 0x6f, 0x6f };
static const uint8_t test_repeated_submess_0[] = { 0x92, 0x01, 0x02, 0x20, 0x00, 0x92, 0x01, 0x02, 0x20, 0x00, 0x92, 0x01, 0x02, 0x20, 0x00 };
static const uint8_t test_repeated_submess_1[] = { 0x92, 0x01, 0x02, 0x20, 0x2a, 0x92, 0x01, 0x0b, 0x20, 0xf0, 0xb1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x92, 0x01, 0x03, 0x20, 0x9b, 0x05 };
static const uint8_t test_packed_repeated_int32_arr0[] = { 0x0a, 0x0b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x01 };
static const uint8_t test_packed_repeated_int32_arr1[] = { 0x0a, 0x0f, 0x2a, 0x9a, 0x05, 0xcd, 0xb9, 0xbb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x2f };
static const uint8_t test_packed_repeated_int32_arr_min_max[] = { 0x0a, 0x0f, 0x80, 0x80, 0x80, 0x80, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0xff, 0x07 };
static const uint8_t test_packed_repeated_sint32_arr0[] = { 0x12, 0x02, 0x01, 0x02 };
static const uint8_t test_packed_repeated_sint32_arr1[] = { 0x12, 0x09, 0x54, 0xb4, 0x0a, 0xe5, 0x8c, 0x89, 0x01, 0x00, 0x5e };
static const uint8_t test_packed_repeated_sint32_arr_min_max[] = { 0x12, 0x0a, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xfe, 0xff, 0xff, 0xff, 0x0f };
static const uint8_t test_packed_repeated_uint32_roundnumbers[] = { 0x3a, 0x0a, 0x80, 0x94, 0xeb, 0xdc, 0x03, 0xc0, 0x84, 0x3d, 0x01, 0x00 };
static const uint8_t test_packed_repeated_uint32_0_max[] = { 0x3a, 0x06, 0x00, 0xff, 0xff, 0xff, 0xff, 0x0f };
static const uint8_t test_packed_repeated_sfixed32_arr0[] = { 0x1a, 0x08, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00 };
static const uint8_t test_packed_repeated_sfixed32_arr1[] = { 0x1a, 0x14, 0x2a, 0x00, 0x00, 0x00, 0x9a, 0x02, 0x00, 0x00, 0xcd, 0xdc, 0xee, 0xff, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00 };
static const uint8_t test_packed_repeated_sfixed32_arr_min_max[] = { 0x1a, 0x08, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x7f };
static const uint8_t test_packed_repeated_fixed32_roundnumbers[] = { 0x42, 0x10, 0x00, 0xca, 0x9a, 0x3b, 0x40, 0x42, 0x0f, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_packed_repeated_fixed32_0_max[] = { 0x42, 0x08, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff };
static const uint8_t test_packed_repeated_int64_roundnumbers[] = { 0x22, 0x60, 0x80, 0x80, 0xf0, 0xc4, 0xc5, 0xa9, 0xd2, 0x8f, 0xf2, 0x01, 0x80, 0x80, 0xe6, 0xd9, 0x95, 0xd0, 0x9c, 0xfe, 0xff, 0x01, 0x80, 0xe0, 0xeb, 0xda, 0xf2, 0xe2, 0xff, 0xff, 0xff, 0x01, 0x80, 0xec, 0x94, 0xa3, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x01, 0xc0, 0xfb, 0xc2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x98, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x01, 0xe8, 0x07, 0xc0, 0x84, 0x3d, 0x80, 0x94, 0xeb, 0xdc, 0x03, 0x80, 0xa0, 0x94, 0xa5, 0x8d, 0x1d, 0x80, 0x80, 0x9a, 0xa6, 0xea, 0xaf, 0xe3, 0x01, 0x80, 0x80, 0x90, 0xbb, 0xba, 0xd6, 0xad, 0xf0, 0x0d, 0x00, 0x00 };
static const uint8_t test_packed_repeated_int64_min_max[] = { 0x22, 0x13, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f };
static const uint8_t test_packed_repeated_sint64_roundnumbers[] = { 0x2a, 0x45, 0xff, 0xff, 0x9f, 0xf6, 0xf4, 0xac, 0xdb, 0xe0, 0x1b, 0xff, 0xff, 0xb3, 0xcc, 0xd4, 0xdf, 0xc6, 0x03, 0xff, 0xbf, 0xa8, 0xca, 0x9a, 0x3a, 0xff, 0xa7, 0xd6, 0xb9, 0x07, 0xff, 0x88, 0x7a, 0xcf, 0x0f, 0x02, 0xd0, 0x0f, 0x80, 0x89, 0x7a, 0x80, 0xa8, 0xd6, 0xb9, 0x07, 0x80, 0xc0, 0xa8, 0xca, 0x9a, 0x3a, 0x80, 0x80, 0xb4, 0xcc, 0xd4, 0xdf, 0xc6, 0x03, 0x80, 0x80, 0xa0, 0xf6, 0xf4, 0xac, 0xdb, 0xe0, 0x1b, 0x00, 0x00 };
static const uint8_t test_packed_repeated_sint64_min_max[] = { 0x2a, 0x14, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_packed_repeated_sfixed64_roundnumbers[] = { 0x32, 0x78, 0x00, 0x00, 0x9c, 0x58, 0x4c, 0x49, 0x1f, 0xf2, 0x00, 0x80, 0x39, 0x5b, 0x81, 0x72, 0xfc, 0xff, 0x00, 0xf0, 0x5a, 0x2b, 0x17, 0xff, 0xff, 0xff, 0x00, 0x36, 0x65, 0xc4, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xbd, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x18, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x42, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x9a, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xa5, 0xd4, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc6, 0xa4, 0x7e, 0x8d, 0x03, 0x00, 0x00, 0x00, 0x64, 0xa7, 0xb3, 0xb6, 0xe0, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_packed_repeated_sfixed64_min_max[] = { 0x32, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f };
static const uint8_t test_packed_repeated_uint64_roundnumbers[] = { 0x4a, 0x24, 0x01, 0xe8, 0x07, 0xc0, 0x84, 0x3d, 0x80, 0x94, 0xeb, 0xdc, 0x03, 0x80, 0xa0, 0x94, 0xa5, 0x8d, 0x1d, 0x80, 0x80, 0x9a, 0xa6, 0xea, 0xaf, 0xe3, 0x01, 0x80, 0x80, 0x90, 0xbb, 0xba, 0xd6, 0xad, 0xf0, 0x0d, 0x00, 0x00 };
static const uint8_t test_packed_repeated_uint64_0_1_max[] = { 0x4a, 0x0c, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 };
static const uint8_t test_packed_repeated_uint64_random[] = { 0x4a, 0x12, 0x00, 0x9a, 0x05, 0x80, 0xd4, 0xdb, 0xd2, 0x0f, 0xa1, 0x80, 0x80, 0xb2, 0xa7, 0xe7, 0xda, 0x85, 0xde, 0x01 };
static const uint8_t test_packed_repeated_fixed64_roundnumbers[] = { 0x52, 0x48, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x42, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x9a, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xa5, 0xd4, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc6, 0xa4, 0x7e, 0x8d, 0x03, 0x00, 0x00, 0x00, 0x64, 0xa7, 0xb3, 0xb6, 0xe0, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const uint8_t test_packed_repeated_fixed64_0_1_max[] = { 0x52, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
static const uint8_t test_packed_repeated_fixed64_random[] = { 0x52, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0x56, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x21, 0x00, 0x40, 0x76, 0x3a, 0x6b, 0x0b, 0xde };
static const uint8_t test_packed_repeated_float_random[] = { 0x5a, 0x18, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0xc8, 0xc2, 0x00, 0x00, 0x28, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x26, 0x44, 0x40, 0x3c, 0x00, 0x48 };
static const uint8_t test_packed_repeated_double_random[] = { 0x62, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x8f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x84, 0x40, 0x00, 0x00, 0x00, 0x00, 0x88, 0x07, 0x00, 0x41 };
static const uint8_t test_packed_repeated_boolean_0[] = { 0x6a, 0x04, 0x00 };
static const uint8_t test_packed_repeated_boolean_1[] = { 0x6a, 0x04, 0x01 };
static const uint8_t test_packed_repeated_boolean_random[] = { 0x6a, 0x68, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00 };
static const uint8_t test_packed_repeated_enum_small_0[] = { 0x72, 0x01, 0x00 };
static const uint8_t test_packed_repeated_enum_small_1[] = { 0x72, 0x01, 0x01 };
static const uint8_t test_packed_repeated_enum_small_random[] = { 0x72, 0x1a, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00 };
static const uint8_t test_packed_repeated_enum_0[] = { 0x7a, 0x01, 0x00 };
static const uint8_t test_packed_repeated_enum_1[] = { 0x7a, 0x01, 0x01 };
static const uint8_t test_packed_repeated_enum_random[] = { 0x7a, 0x28, 0x00, 0xff, 0xff, 0xff, 0x7f, 0x7f, 0x80, 0x80, 0x01, 0xff, 0x7f, 0x80, 0x80, 0x80, 0x01, 0xff, 0xff, 0x7f, 0x80, 0x01, 0x80, 0x80, 0x80, 0x80, 0x01, 0x00, 0x80, 0x80, 0x80, 0x01, 0xff, 0xff, 0xff, 0x7f, 0x7f, 0xff, 0x7f, 0x80, 0x80, 0x01 };

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000009
0x9220aa38 in std::string::_Rep::_M_grab ()
(gdb) bt
#0  0x9220aa38 in std::string::_Rep::_M_grab ()
#1  0x9220aac0 in std::string::assign ()
#2  0x0015762c in google::protobuf::EncodedDescriptorDatabase::DescriptorIndex::EnsureFlat (this=0xc03bf0) at cow_string.h:720
#3  0x00157d98 in google::protobuf::EncodedDescriptorDatabase::DescriptorIndex::FindFile (this=0x0, filename=<incomplete type>) at /opt/local/var/macports/build/protobuf-5bcb6987/work/protobuf-33.0/src/google/protobuf/descriptor_database.cc:893
#4  0x00157ec0 in google::protobuf::EncodedDescriptorDatabase::FindFileByName (this=<value temporarily unavailable, due to optimizations>, filename=<value temporarily unavailable, due to optimizations>, output=0x100a2f8) at /opt/local/var/macports/build/protobuf-5bcb6987/work/protobuf-33.0/src/google/protobuf/descriptor_database.cc:611
#5  0x000de59c in operator() (database=@0x100a2f8, filename=<value temporarily unavailable, due to optimizations>, output=@0xc05590) at /opt/local/var/macports/build/protobuf-5bcb6987/work/protobuf-33.0/src/google/protobuf/descriptor.cc:2986
#6  0x001162a0 in google::protobuf::DescriptorPool::TryFindFileInFallbackDatabase (this=0x100a2f8, name=Cannot access memory at address 0x1f
) at /opt/local/var/macports/build/protobuf-5bcb6987/work/protobuf-33.0/src/google/protobuf/descriptor.cc:2990
#7  0x00121164 in google::protobuf::DescriptorPool::FindFileByName (this=0x100a2f8, name={static npos = <optimized out>, _M_len = 0, _M_str = 0x0}) at /opt/local/var/macports/build/protobuf-5bcb6987/work/protobuf-33.0/src/google/protobuf/descriptor.cc:2549
#8  0x0017dcb4 in AssignDescriptorsImpl (table=0x1f, eager=<value temporarily unavailable, due to optimizations>) at /opt/local/var/macports/build/protobuf-5bcb6987/work/protobuf-33.0/src/google/protobuf/generated_message_reflection.cc:4013
#9  0x00223318 in google::protobuf::Message::GetMetadataImpl (data=@0x100a2f8) at /opt/local/var/macports/build/protobuf-5bcb6987/work/protobuf-33.0/src/google/protobuf/message.cc:171
#10 0x00139c58 in google::protobuf::DescriptorProto::GetMetadata (this=<value temporarily unavailable, due to optimizations>) at /opt/local/var/macports/build/protobuf-5bcb6987/work/protobuf-33.0/src/google/protobuf/descriptor.pb.cc:4688
#11 0x0010bffc in google::protobuf::DescriptorPool::generated_pool () at descriptor.pb.h:11429
#12 0x0017e07c in google::protobuf::internal::AssignDescriptorsOnceInnerCall (table=0xbffff5a8) at /opt/local/var/macports/build/protobuf-5bcb6987/work/protobuf-33.0/src/google/protobuf/generated_message_reflection.cc:4040
#13 0x00223318 in google::protobuf::Message::GetMetadataImpl (data=@0xbffff5a8) at /opt/local/var/macports/build/protobuf-5bcb6987/work/protobuf-33.0/src/google/protobuf/message.cc:171
#14 0x0002dcbc in foo::EmptyMess::GetMetadata ()
#15 0x0004264c in main ()

If that one test is removed, protobuf-c build succeeds.

Anything else we should know about your project / environment

MacPorts libstdc++ uses “old C++ ABI” (i.e. everything is built with _GLIBCXX_USE_CXX11_ABI=0.

barracuda156 avatar Oct 25 '25 05:10 barracuda156

Could you please reduce this down to the smallest program that will reproduce the issue?

Also, does it reproduce on any other platforms, or just PPC? We don't have access to macOS/PPC machines (and PPC isn't in our official supported architectures list), so if it only reproduces on that platform, we may need to rely on contributors to diagnose the issue and send a fix.

haberman avatar Oct 27 '25 15:10 haberman

@haberman Thank you for responding. I will try.

Just to keep track, protobuf 31.1 works normally.

barracuda156 avatar Nov 01 '25 14:11 barracuda156