I've been using protobuf 2.3.0 for several weeks, using
SerializeToString.  The
other day, I switched to using SerializeToOstream, and started seeing
the
following invalid write and double free errors reported by valgrind
when my
program is terminated;

==15778== Invalid write of size 4
==15778==    at 0x6623464:
google::protobuf::FileDescriptorTables::~FileDescriptorTables()
(hashtable:532)
==15778==    by 0x4D821BE: __run_exit_handlers (exit.c:78)
==15778==    by 0x4D8222E: exit (exit.c:100)
==15778==    by 0x4D69BDD: (below main) (libc-start.c:258)
==15778==  Address 0x635dc80 is 0 bytes inside a block of size 48
free'd
==15778==    at 0x4024851: operator delete(void*) (vg_replace_malloc.c:
387)
==15778==    by 0x4D821BE: __run_exit_handlers (exit.c:78)
==15778==    by 0x4D8222E: exit (exit.c:100)
==15778==    by 0x4D69BDD: (below main) (libc-start.c:258)
==15778==
==15778== Invalid free() / delete / delete[]
==15778==    at 0x4024851: operator delete(void*) (vg_replace_malloc.c:
387)
==15778==    by 0x4D821BE: __run_exit_handlers (exit.c:78)
==15778==    by 0x4D8222E: exit (exit.c:100)
==15778==    by 0x4D69BDD: (below main) (libc-start.c:258)
==15778==  Address 0x635dc80 is 0 bytes inside a block of size 48
free'd
==15778==    at 0x4024851: operator delete(void*) (vg_replace_malloc.c:
387)
==15778==    by 0x4D821BE: __run_exit_handlers (exit.c:78)
==15778==    by 0x4D8222E: exit (exit.c:100)
==15778==    by 0x4D69BDD: (below main) (libc-start.c:258)

The above are one example of several reports.  it appears there is one
set of
these for each proto message I have defined.

I've tried to recreate this error in a smaller example program for
several days
without success.  Am wondering if anyone on the list has seen this
problem, and
knows what might cause it?

I'm using SerializeToOstream in basically the following manner;


  char buf[512];
  std::stringbuf sbuf;
  sbuf.pubsetbuf((char*)buf, 512);
  std::ostream os(&sbuf);
  message.SerializeToOstream(&os);

Any feedback on how to further debug this problem would be
appreciated.

--CB

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@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