I am having problems where my message fails to serialize. A fatal exception
is thrown for the ' ResponseMessage.SerializeToCodedStream(coded_output);'.
ResponseMessage contains all the required fields, and is 104 bytes without
I am compiling this for 64 bit windows, using the 32bit protoc.exe.
// Send the response message
// Get the byte size of the response message
uint32_t response_message_size = ResponseMessage.ByteSize();
// Add the varint size to the total message size
uint32_t response_message_total_size = response_message_size
google::protobuf::io::ZeroCopyOutputStream* raw_output =
google::protobuf::io::CodedOutputStream* coded_output =
bytes_sent = m_Socket.send(buffer_stream.data());
catch( google::protobuf::FatalException )
bytes_sent = 0;
On Tuesday, February 7, 2012 7:45:29 AM UTC-8, Evan Jones wrote:
> On Feb 6, 2012, at 21:54 , Robby Zinchak wrote:
> > It turned out to be an uninitialized boolean. Properly setting the
> value in question seems to allow things to proceed normally.
> Ah! Interesting. So one of your .set_* properties is a boolean, and one of
> them was uninitialized? That would do it. This was discussed previously and
> dismissed as a "wont fix" problem, because it is hard/impossible to make
> portable code that will test for this:
> Although its somewhat confusing since WireFormatLite::WriteBoolNoTag
> contains code to try to avoid this problem, which GCC helpfully optimizes
> I am not able to get the exact crash as the one you reported, but I can
> get it to crash in MessageLite::SerializeWithCachedSizesToArray by creating
> a boolean with a value of 0x80 (serializing to two bytes instead of one,
> causing it to create a message larger than it expects). I can't figure out
> how it could crash at the point you report the crash, but that doesn't
> really matter.
> Glad you got it working,
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To view this discussion on the web visit
To post to this group, send email to email@example.com.
To unsubscribe from this group, send email to
For more options, visit this group at