Suspicious C++ stringstream crashes, gcc 3.3.3

Joe Buck Joe.Buck@synopsys.COM
Mon May 24 21:54:00 GMT 2004


On Mon, May 24, 2004 at 03:18:54PM +0100, Andrew Walrond wrote:
> Are there any known stringstream problems in 3.3.3? I have a reproducible 
> crash which seems to scribble on the stack and causes a segfault. Bugzilla 
> searches haven't thrown up anything useful.
> 
> Usual story; If I put in debug code, it goes away, so I haven't been able to 
> isolate a small test case. But I am now pretty convinced that the problem 
> lies here.

This sounds like memory corruption.  If you scribble on the heap, a crash
can result at any later point that accesses the heap, including in
stringstream.  The fact that adding debug code makes it go away rings this
bell for me.

I would recommend the use of some memory-checking tool, for example,
valgrind if you're on an x86 gnu/linux box.



More information about the Gcc mailing list