I just observed the same and by following the workaround (changing 
bool->int) solved it but...

Do we always have to do that or protobuf library has a fix for this?
If so which version?

at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb) where
#0 0x0000003f2f234ff9 in __GI_raise (sig=sig@entry=6)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x0000003f2f238068 in __GI_abort () at abort.c:89
#2 0x00007ffff2f325b5 in _gnu_cxx::_verbose_terminate_handler ()
#3 0x00007ffff2f30726 in _cxxabiv1::_terminate (handler=<optimized out>)
#4 0x00007ffff2f30753 in std::terminate ()
#5 0x00007ffff2f3097e in _cxxabiv1::_cxa_throw (obj=0x7fffdc028600,
tinfo=<optimized out>, dest=<optimized out>)
#6 0x00007ffff70ba618 in google::protobuf::internal::LogMessage::Finish (
this=0x7fffeca9b8f0) at google/protobuf/stubs/common.cc:195
#7 0x00007ffff70ba648 in google::protobuf::internal::LogFinisher::operator= 
this=this@entry=0x7fffeca9b8af, other=...)
at google/protobuf/stubs/common.cc:203
#8 0x00007ffff70ce0da in 
(this=<optimized out>, target=0x7fffdc027c18 "\n\020\b")
--Type <return> to continue, or q <return> to quit--
at google/protobuf/message_lite.cc:224
#9 0x00007ffff70cdb91 in 
(this=this@entry=0x7fffeca9ba30, output=output@entry=0x7fffeca9ba20)
at google/protobuf/message_lite.cc:283
#10 0x00007ffff70cdbf5 in google::protobuf::MessageLite::AppendToString (
this=this@entry=0x7fffeca9ba30, output=output@entry=0x7fffeca9ba20)
at google/protobuf/message_lite.cc:274
#11 0x00007ffff70cdd40 in google::protobuf::MessageLite::SerializeToString (
this=this@entry=0x7fffeca9ba30, output=output@entry=0x7fffeca9ba20)
at google/protobuf/message_lite.cc:292"
On Wednesday, July 2, 2014 at 5:54:05 PM UTC-5, prot...@googlecode.com 
> Comment #4 on issue 593 by dave.b...@gmail.com: FatalException on calling 
> SerializeAsString() 
> http://code.google.com/p/protobuf/issues/detail?id=593 
> 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. 
> -- 
> You received this message because this project is configured to send all   
> issue notifications to this address. 
> You may adjust your notification preferences at: 
> https://code.google.com/hosting/settings 

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to