New issue 373 by Van...@gmail.com: Tests hang/crash/don't pass without RTTI
http://code.google.com/p/protobuf/issues/detail?id=373
What steps will reproduce the problem?
1. Add -fno-rtti -DGOOGLE_PROTOBUF_NO_RTTI to src/Makefile.am
2. ./autogen.sh && ./configure && make check
What is the expected output? What do you see instead?
I expect that all tests pass. Instead test "CustomOptions.OptionLocations"
hangs.
What version of the product are you using? On what operating system?
protobuf 2.4.1. Tried on Linux and Windows.
Please provide any additional information below.
I also tried compiling with VS under Windows.
Test "CustomOptions.OptionLocations" don't hang, but all CustomOptions
tests crash with access violation somewhere in algoritm::sort(). In total I
have 18 protobuf-test failures.
In fact, tests didn't even compile:
google/protobuf/extension_set_unittest.cc:618:67: error: "dynamic_cast" not
permitted with -fno-rtti
I made the following change to fix compile error:
--- a/src/google/protobuf/extension_set_unittest.cc
+++ b/src/google/protobuf/extension_set_unittest.cc
@@ -615,7 +615,8 @@ TEST(ExtensionSetTest, DynamicExtensions) {
const Message& sub_message =
message.GetReflection()->GetMessage(message, message_extension);
const unittest::ForeignMessage* typed_sub_message =
- dynamic_cast<const unittest::ForeignMessage*>(&sub_message);
+ ::google::protobuf::internal::dynamic_cast_if_available
+ <const unittest::ForeignMessage*>(&sub_message);
ASSERT_TRUE(typed_sub_message != NULL);
EXPECT_EQ(456, typed_sub_message->c());
}
Is GOOGLE_PROTOBUF_NO_RTTI supported at all?
I've figured out that pthread_once() doesn't return. I have no idea what
pthread_once has to do with no-rtti...
Full stack attached.
Attachments:
stack.txt 2.3 KB
Oh, it's an old bug:
https://groups.google.com/d/topic/protobuf/w6uwDA2PQH4/discussion
Isn't it fixed yet?
Test results under windows attached.
Attachments:
file.unit.txt 106 KB