This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Suspicious C++ stringstream crashes, gcc 3.3.3
- From: Joe Buck <Joe dot Buck at synopsys dot COM>
- To: Andrew Walrond <andrew at walrond dot org>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 24 May 2004 14:54:11 -0700
- Subject: Re: Suspicious C++ stringstream crashes, gcc 3.3.3
- References: <200405241518.54408.andrew@walrond.org>
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.