proto buff crash

799 views
Skip to first unread message

jjshang

unread,
Feb 26, 2012, 10:25:25 PM2/26/12
to Protocol Buffers
hi,

we use proto buff for our c-s application. We find there seem to be no
problems if server proto's optional, repeated field do not exist in
client's proto, so our server and client use different proto defines,
and it works well.

But recently there happens some crash in client proto buff code when
server send a lot of undefined complicate nested optional/repeated
field to client.

app.exe!
std::basic_string<char,std::char_traits<char>,std::allocator<char>
>::`scalar deleting destructor'() + 0x9 字节 C++
app.exe!google::protobuf::UnknownField::Delete() 行177 + 0x1f 字节 C++
app.exe!google::protobuf::UnknownFieldSet::ClearFallback() 行58 C++
app.exe!google::protobuf::UnknownFieldSet::~UnknownFieldSet() 行51 C+
+
app.exe!MyProtoInner::~MyProtoInner() 行15119 + 0x4a 字节 C++
app.exe!MyProtoInner::`scalar deleting destructor'() + 0x8 字节 C++
app.exe!
google::protobuf::internal::RepeatedPtrFieldBase::Destroy<google::protobuf::RepeatedPtrField<MyProtoInner>::TypeHandler>()
行622 + 0x11 字节 C++
app.exe!MyProto::~MyProto() 行16864 + 0x10 字节 C++

It seems happen in memory release procedure, and if we bring the 5
lines proto buff relative code to a gtest, it crash in same place
steady. Can anybody help?

Pherl Liu

unread,
Mar 20, 2012, 3:53:36 PM3/20/12
to jjshang, Protocol Buffers
It sounds like a memory ownership issue. Basically the message object owns the fields (including the unknown fields). From the stack trace, the string is probably freed before the destructor is called. Could you please write a simple function that could reproduce this issue?


--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.


Reply all
Reply to author
Forward
0 new messages