Open GoogleCodeExporter opened 9 years ago
Additional notes:
The error seems to happen only for embedded messages that contain a bool value.
Other embedded messages seem to work as expected
Original comment by manfred....@posteo.de
on 4 Jan 2014 at 12:50
Did such an error occur before? Please let me know if you require additional
information or the .proto-files
Original comment by manfred....@posteo.de
on 6 Jan 2014 at 4:20
Program throwing exceptions indeterminately suggests multi-threading bugs.
Original comment by xiaof...@google.com
on 10 Jan 2014 at 12:27
This exact same issue occurs for me too - and when I replace the usage of all
bools with uint32s, the problem goes away.
Looking through the source code, it seems that the only way in which the
_has_error flag can be set is if _Next returns false. The check that dies is in
message_lite.cc:224, and from a cursor examination the only code path that
would cause the error is if the return value of GetCachedSize() is insufficient
to serialise the message.
The reason this happens with bools is that a bool is always considered to be
one byte, but if your bool value is unitialised (as mine was) then when
protobuf actually tries to serialise the value it may end up using more than
one byte.
IMHO protobuf should assert if you try to set a value other than 0 or 1 into a
bool. This would catch the error where it actually occurs, rather than later on
when it attempts to serialise the data.
Original comment by dave.b...@gmail.com
on 2 Jul 2014 at 10:53
Original issue reported on code.google.com by
manfred....@posteo.de
on 3 Jan 2014 at 6:33