Error:
 
libprotobuf FATAL
..\src\google\protobuf\io\zero_copy_stream_impl.cc:377] CHECK
failed: buffer_used_ == buffer_size_:  BackUp() can only be called after
Next().
 
Stack trace:
 
  msvcr90d.dll!_NMSG_WRITE(int rterrnum=10)  Line 198 C
  msvcr90d.dll!abort()  Line 68 C
  GraphPerf.exe!google::protobuf::internal::LogMessage::Finish()  Line
173 C++
 
GraphPerf.exe!google::protobuf::internal::LogFinisher::operator=(google:
:protobuf::internal::LogMessage & other={...})  Line 177 C++
 
GraphPerf.exe!google::protobuf::io::CopyingOutputStreamAdaptor::BackUp(i
nt count=2202)  Line 378 + 0xa0 bytes C++
 
GraphPerf.exe!google::protobuf::io::CodedOutputStream::~CodedOutputStrea
m()  Line 526 C++
  GraphPerf.exe!ProtoBufStreamAdaptor::~ProtoBufStreamAdaptor()  Line 10
+ 0x59 bytes C++


________________________________

From: Kenton Varda [mailto:ken...@google.com] 
Sent: Monday, June 29, 2009 7:08 PM
To: Alex Black
Cc: Protocol Buffers
Subject: Re: Using CopyingOutputStreamAdaptor and CodedOutputStream





On Sun, Jun 28, 2009 at 7:30 AM, Alex Black <a...@alexblack.ca> wrote:



        Hi, I'm trying to use these to serialize messages to my own
stream.
        
        I have a couple of questions:
        
        1. If I use message.SerializeToCodedStream() do I still need to
write
        the size of the message to the stream on my own first?


Yes.
 

        2. My new code looks like this:
        
        MyStream myStream; // this implements CopyingOutputStream
        CopyingOutputStreamAdaptor protoBufStream(&myStream);
        CodedOutputStream codedOutputStream(&protoBufStream);
        
        Then I write messages like this:
        
        message.SerializeToCodedStream(&codedOutputStream);
        
        When the CodedOutputStream's destructor gets called, my program
aborts
        hard.. Looks like there is still 5192 bytes in its buffer, and I
think
        I need to call Flush() on it, but there is no flush?


What is the error message?  Stack trace?
 



        thx
        
        - Alex
        
        
                
        



--~--~---------~--~----~------------~-------~--~----~
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