Hi Henner,
Thanks for the reply. I am also working on this problem with Des.
The crash occurs on Mac x86_64 and Windows x86 or x86_64. We don't
build on 32 bit mac. Windows compiler is VS2008, MAC is clang. Have
not tested our linux builds.
The crash is in:
const FileDescriptor* DescriptorPool::FindFileByName(const string&
name) const {
MutexLockMaybe lock(mutex_);
...
}
The "this" pointer is NULL. The DescriptorPool singleton methods are
called ( was not created properly?). The
DescriptorPool::generated_pool() is called and appears to be
initialised when stepping through the code. We have triple+ checked we
are linking against the debug libraries and are building debug.
Stack trace below:
WorkStateTask_unittest.exe!
google::protobuf::DescriptorPool::FindFileByName(const
std::basic_string<char,std::char_traits<char>,std::allocator<char> > &
name="invtaskmodel.proto") Line 873 + 0x3 bytes C++
WorkStateTask_unittest.exe!
invtaskmodel::protobuf_AssignDesc_invtaskmodel_2eproto() Line 195 +
0x2e bytes C++
WorkStateTask_unittest.exe!
google::protobuf::ProtobufOnceType::Init(void (void)*
init_func=0x0053c7b0) Line 79 + 0x5 bytes C++
WorkStateTask_unittest.exe!
google::protobuf::GoogleOnceInit(google::protobuf::ProtobufOnceType *
once=0x006971b4, void (void)* init_func=0x0053c7b0) Line 105 C++
WorkStateTask_unittest.exe!invtaskmodel::`anonymous
namespace'::protobuf_AssignDescriptorsOnce() Line 1269 + 0xf bytes C+
+
WorkStateTask_unittest.exe!
invtaskmodel::InversionTask::GetMetadata() Line 26904 C++
WorkStateTask_unittest.exe!
google::protobuf::Message::GetDescriptor() Line 296 + 0x32 bytes C++
WorkStateTask_unittest.exe!ProtocolsTestCase::testCreateInvTask()
Line 198 + 0xb bytes C++
WorkStateTask_unittest.exe!
CppUnit::TestCaller<ProtocolsTestCase>::runTest() Line 166 + 0x10
bytes C++
> cppunitd_dll.dll!CppUnit::TestSuccessListener::TestSuccessListener() +
> 0x1b588 bytes
Thanks in advance!
Stewart
On Apr 5, 3:07 am, Henner Zeller <[email protected]> wrote:
> On Mon, Apr 4, 2011 at 00:26, des fitzgerald
>
> <[email protected]> wrote:
> > Hi, below is more orless the same example in the on-line documentation
>
> > "the message Foo" example turned into a cppunit_test
>
> > I thought the DebugString method would always work, based upon what I
> > have read.
> > This crashes? any guidance?
>
> Where does it crash (stacktrace?). What compiler are you using ?
>
>
>
>
>
>
>
> > thanks
> > des
>
> > static std::string data; // Will store a serialized version of the
> > message.
> > void ProtocolsTestCase::testExerciseParsing() {
> > testCreateSerializedMessage();
>
> > // parse from string
> > testParseFromString();
>
> > //
> > // testDynamicParseFromString();
> > }
> > // get on top of dynamic creation of a protobuf message
> > void ProtocolsTestCase::testCreateSerializedMessage() {
> > // Create a message and serialize it.
> > Foo foo;
> > foo.set_text("Hello World!");
> > foo.add_numbers(1);
> > foo.add_numbers(5);
> > foo.add_numbers(42);
>
> > foo.SerializeToString(&data);
> > }
> > void ProtocolsTestCase::testParseFromString() {
> > // Parse the serialized message and check that it contains the
> > correct data.
> > Foo foo;
> > foo.ParseFromString(data);
>
> > CPPUNIT_ASSERT(foo.text() == "Hello World!");
> > CPPUNIT_ASSERT(foo.numbers_size() == 3);
> > CPPUNIT_ASSERT(foo.numbers(0) == 1);
> > CPPUNIT_ASSERT(foo.numbers(1) == 5);
> > CPPUNIT_ASSERT(foo.numbers(2) == 42);
> > std::string out = foo.DebugString();
> > lprintf("%s\n", out.c_str());
> > }
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Protocol Buffers" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group
> > athttp://groups.google.com/group/protobuf?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en.