What steps will reproduce the problem?
1. Run the generator on the attached .proto file (modified version of the
oneof.proto test)
2. Run the sample main.cpp
What is the expected output? What do you see instead?
I would expect the message to encode/decode properly. Instead, it seems to
encode to an empty array (bytes_written is 0 in the ostream). If we then try to
decode what we encoded (temporarily ignoring the fact that nothing was really
encoded), I see memory corruption, where msg1 actually is getting modified even
though I am decoding to msg2. This appears to be because the pb_field_t entries
generated for OneOfMessage_fields are bogus. In particular, data_offset is some
large number that ends up causing wrap around when it is used in
pb_field_iter_begin.
What version of the product are you using? On what operating system?
Saw this in both the git checkout a couple days ago and the latest 0.3.2
release. Running in Ubuntu 14.04 using gcc 4.8.2.
Please provide any additional information below.
I have the following options enabled:
PB_FIELD_32BIT
PB_NO_PACKED_STRUCTS
PB_BUFFER_ONLY
Original issue reported on code.google.com by sgeren...@gmail.com on 26 Jan 2015 at 10:14
Original issue reported on code.google.com by
sgeren...@gmail.com
on 26 Jan 2015 at 10:14Attachments: