CodedInputStream has total bytes limit:
https://github.com/google/protobuf/blob/master/src/google/protobuf/io/coded_stream.h#L587

Make sure you don't hit this limit (if you do, use
CodedInputStream::SetTotalBytesLimit to set a larger limit).

On Sun, Nov 16, 2014 at 2:48 AM, Alexey Chernushev <
alexey.chernus...@gmail.com> wrote:

> Hi!
> I have problem with repeated double field in deserializing process. I want
> to read 300 messages from protobuf file, but ReadRaw got failed in last
> message (sometimes 10 before last, it depended on number of encoding type).
> I've prepared little example where I am reproducing that error
>
> https://gist.github.com/alexeyche/d6af8a43d346edc12868
>
> Could you please say, am I doing something wrong?
>
> $ protoc -I. --cpp_out=. ./time_series.proto
> $ g++ main.cpp time_series.pb.cc -std=c++11 -L/usr/local/lib -lprotobuf
> -I/usr/local/include
> $ ./a.out synthetic_control_TRAIN out.pb
>
> ...reading and printing all messages and on 299 message...
>
> Can't do ReadRaw of message size 489
> terminate called without an active exception
>
> ===
> synthetic_control_TRAIN file you can get here
> https://yadi.sk/d/gxZy8JSvcjiVD
>
> If ignore bad status of ReadRaw, then repeated field of last message will
> be with almost zeros (e.g. 15e-17) in the end. Maybe it's memory leak?
>
>
> my machine:
>
> $ protoc --version
> libprotoc 2.6.1
>
> $ g++ -v
> Using built-in specs.
> COLLECT_GCC=g++
> COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
> Target: x86_64-linux-gnu
> Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
> 4.8.1-10ubuntu9' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs
> --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
> --program-suffix=-4.8 --enable-shared --enable-linker-build-id
> --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
> --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls
> --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
> --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin
> --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
> --enable-gtk-cairo
> --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre
> --enable-java-home
> --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64
> --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64
> --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
> --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686
> --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic
> --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
> --target=x86_64-linux-gnu
> Thread model: posix
> gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu9)
>
> $ uname -a
> Linux alexeyche-Lenovo-G780 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9
> 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
>
>  --
> 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 http://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to