Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 663 by Undefined behavior while running unit tests


When compiling protobuf 2.6.0-rc1 with gcc 4.9's undefined behavior detector, I get runtime errors from protoc:

./configure CXX="g++-4.9" CXXFLAGS="-O0 -ggdb -fsanitize=undefined -fsanitize=signed-integer-overflow" && make
oldpwd=`pwd` && ( cd . && $oldpwd/protoc -I. --cpp_out=$oldpwd google/protobuf/unittest.proto google/protobuf/unittest_empty.proto google/protobuf/unittest_import.proto google/protobuf/unittest_import_public.proto google/protobuf/unittest_mset.proto google/protobuf/unittest_optimize_for.proto google/protobuf/unittest_embed_optimize_for.proto google/protobuf/unittest_custom_options.proto google/protobuf/unittest_lite.proto google/protobuf/unittest_import_lite.proto google/protobuf/unittest_import_public_lite.proto google/protobuf/unittest_lite_imports_nonlite.proto google/protobuf/unittest_no_generic_services.proto google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto ) google/protobuf/stubs/ runtime error: signed integer overflow: 42 * -100000000 cannot be represented in type 'int' google/protobuf/compiler/ runtime error: negation of -9223372036854775808 cannot be represented in type 'long int'; cast to an unsigned type to negate this value to itself

Note that -9223372036854775808 is -0x8000000000000000.

You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:

You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to