Issue 373 in protobuf: Tests hang/crash/don't pass without RTTI

40 views
Skip to first unread message

prot...@googlecode.com

unread,
Feb 8, 2012, 4:57:51 PM2/8/12
to prot...@googlegroups.com
Status: New
Owner: liuj...@google.com
Labels: Type-Defect Priority-Medium

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.

prot...@googlecode.com

unread,
Feb 8, 2012, 5:20:24 PM2/8/12
to prot...@googlegroups.com

Comment #1 on issue 373 by Van...@gmail.com: Tests hang/crash/don't pass
without RTTI
http://code.google.com/p/protobuf/issues/detail?id=373

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?

prot...@googlecode.com

unread,
Feb 8, 2012, 6:26:17 PM2/8/12
to prot...@googlegroups.com

Comment #2 on issue 373 by Van...@gmail.com: Tests hang/crash/don't pass
without RTTI
http://code.google.com/p/protobuf/issues/detail?id=373

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

prot...@googlecode.com

unread,
Feb 8, 2012, 6:34:20 PM2/8/12
to prot...@googlegroups.com

Comment #3 on issue 373 by Van...@gmail.com: Tests hang/crash/don't pass
without RTTI
http://code.google.com/p/protobuf/issues/detail?id=373

Oh, it's an old bug:
https://groups.google.com/d/topic/protobuf/w6uwDA2PQH4/discussion
Isn't it fixed yet?

prot...@googlecode.com

unread,
Feb 9, 2012, 4:05:04 AM2/9/12
to prot...@googlegroups.com

Comment #4 on issue 373 by Van...@gmail.com: Tests hang/crash/don't pass
without RTTI
http://code.google.com/p/protobuf/issues/detail?id=373

Test results under windows attached.

Attachments:
file.unit.txt 106 KB

prot...@googlecode.com

unread,
Dec 5, 2012, 12:55:56 AM12/5/12
to prot...@googlegroups.com
Updates:
Status: Fixed
Labels: FixedIn-2.5.0

Comment #5 on issue 373 by liu...@google.com: Tests hang/crash/don't pass
without RTTI
http://code.google.com/p/protobuf/issues/detail?id=373

Fixed in r449

Reply all
Reply to author
Forward
0 new messages