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

New issue 663 by robert.e...@gmail.com: Undefined behavior while running unit tests
http://code.google.com/p/protobuf/issues/detail?id=663

Hello,

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/strutil.cc:908:17: runtime error: signed integer overflow: 42 * -100000000 cannot be represented in type 'int' google/protobuf/compiler/parser.cc:1103:41: 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:
https://code.google.com/hosting/settings

--
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to