Hi.

Compiled and installed protobuf-2.4.1, Oracle Linux 6, 64 bit kernel.

This piece of code failed with SIGSEGV. The code is ran on a newly
created pthread:


    while (1) {

        Agent agent;
        if (!agent.ParseFromZeroCopyStream(fis)) {
            DBG("Failed to receive message, closing socket\n");
            break;
        }
   ....
   }


Core was generated by `./out/agent -D'.
Program terminated with signal 11, Segmentation fault.
#0  0x000000000040b8db in
google::protobuf::internal::RepeatedPtrFieldBase::Get<google::protobuf::RepeatedPtrField<LastSeq>::TypeHandler>
(
    this=0x7f20680053b8, index=0)
    at /usr/local/include/google/protobuf/repeated_field.h:660
660       return *cast<TypeHandler>(elements_[index]);
Missing separate debuginfos, use: debuginfo-install
glibc-2.12-1.47.el6_2.9.x86_64 libgcc-4.4.6-3.el6.x86_64 libstdc+
+-4.4.6-3.el6.x86_64
(gdb) where
#0  0x000000000040b8db in
google::protobuf::internal::RepeatedPtrFieldBase::Get<google::protobuf::RepeatedPtrField<LastSeq>::TypeHandler>
(
    this=0x7f20680053b8, index=0)
    at /usr/local/include/google/protobuf/repeated_field.h:660
#1  0x000000000040b822 in
google::protobuf::RepeatedPtrField<LastSeq>::Get (
    this=0x7f20680053b8, index=0)
    at /usr/local/include/google/protobuf/repeated_field.h:860
#2  0x000000000040b388 in Agent_LoadParams::generators
(this=0x7f2068005380,
    index=0) at agent/shoal.pb.h:1536
#3  0x000000000040fa80 in Agent_LoadParams::IsInitialized (
    this=0x7f2068005380) at gen/proto/cpp/agent/shoal.pb.cc:1122
#4  0x0000000000410c6a in Agent_SetTargetDetails::IsInitialized (
    this=0x7f2068005990) at gen/proto/cpp/agent/shoal.pb.cc:1448
#5  0x00000000004119f4 in Agent::IsInitialized (this=0x7f206f7fde30)
    at gen/proto/cpp/agent/shoal.pb.cc:1711
#6  0x000000000041d5e1 in InlineMergeFromCodedStream
(this=0x7f206f7fde30,
    input=0x7f206f7fddb0) at google/protobuf/message_lite.cc:122
#7  InlineParseFromCodedStream (this=0x7f206f7fde30,
input=0x7f206f7fddb0)
    at google/protobuf/message_lite.cc:132
#8  google::protobuf::MessageLite::ParseFromCodedStream
(this=0x7f206f7fde30,
    input=0x7f206f7fddb0) at google/protobuf/message_lite.cc:161
#9  0x000000000041d846 in
google::protobuf::MessageLite::ParseFromZeroCopyStream
(this=0x7f206f7fde30, input=<value optimized out>)
    at google/protobuf/message_lite.cc:170
#10 0x0000000000403d33 in msg_proc (arg=0x7f20700008c0) at agent/
agent.C:279
#11 0x000000365a0077f1 in start_thread () from /lib64/libpthread.so.0
#12 0x00000036598e5ccd in clone () from /lib64/libc.so.6
(gdb) list
655
656     template <typename TypeHandler>
657     inline const typename TypeHandler::Type&
658     RepeatedPtrFieldBase::Get(int index) const {
659       GOOGLE_DCHECK_LT(index, size());
660       return *cast<TypeHandler>(elements_[index]);
661     }
662
663     template <typename TypeHandler>
664     inline typename TypeHandler::Type*
(gdb) print elements_
$1 = (void **) 0xc0000000c
(gdb) print *elements_
Cannot access memory at address 0xc0000000c

Any clue on where to dig?

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

Reply via email to