linux libio status

H.J. Lu hjl@lucon.org
Thu Oct 16 12:53:00 GMT 1997


> 
> I previously wrote:
> > By the way strstream seems to be broken if you let it dynamically allocate
> > it's own buffer.  The following program gives a segmentation fault:
> > 
> > #include <cstdlib>
> > #include <string>
> > #include <strstream.h>
> > main()
> > {
> >   ostrstream os;
> >   os << "testing " << 123 << ends;
> >   string s = os.str();
> >   exit(0);
> > }
> > 
> 
> My previous problems with strstream and dynamically allocated buffers appears
> to be gone.
> 
> Upon looking at the call trace in gdb this program goes into an infinite 
> recursion on the basic_string<> ctor until __builtin_new() finally dies 
> giving a segmentation fault.

That is a bug in basic_string.


H.J.



More information about the Gcc mailing list