This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFA: Add -static-libstdc++ option to g++
- From: NightStrike <nightstrike at gmail dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: Dave Korn <dave dot korn dot cygwin at googlemail dot com>, Ian Lance Taylor <iant at google dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 1 Jul 2009 09:54:43 -0400
- Subject: Re: PATCH RFA: Add -static-libstdc++ option to g++
- References: <m3vdmrxww8.fsf@pepe.airs.com> <b609cb3b0906281024x7b163c61x77c9e19f0b193db4@mail.gmail.com> <b609cb3b0906292156t353d5c27k664c842113fba0d8@mail.gmail.com> <m3my7py81e.fsf@google.com> <b609cb3b0906302116r2b647f33y2ec4a52a472326fe@mail.gmail.com> <4A4B478B.3060600@gmail.com> <4A4B49F5.108@redhat.com>
On Wed, Jul 1, 2009 at 7:35 AM, Andrew Haley<aph@redhat.com> wrote:
> Dave Korn wrote:
>> NightStrike wrote:
>>
>>> (gdb) run
>>> Starting program:
>>> /home/nightstrike/root-x86_64-pc-linux-64/bin/x86_64-w64-mingw32-g++
>>> -v
>>> *** glibc detected *** malloc(): memory corruption (fast):
>>> 0x0000000000543570 ***
>>>
>>> Program received signal SIGABRT, Aborted.
>>> 0x00002aaaaabf207b in raise () from /lib/libc.so.6
>>> (gdb) bt
>>> #0 ?0x00002aaaaabf207b in raise () from /lib/libc.so.6
>>> #1 ?0x00002aaaaabf384e in abort () from /lib/libc.so.6
>>> #2 ?0x00002aaaaac285f9 in __libc_message () from /lib/libc.so.6
>>> #3 ?0x00002aaaaac2fbee in _int_malloc () from /lib/libc.so.6
>>> #4 ?0x00002aaaaac3116d in malloc () from /lib/libc.so.6
>>> #5 ?0x0000000000419a98 in xmalloc (size=3651) at
>>> ../../gcc/libiberty/xmalloc.c:147
>>
>> ? Argh. ?Sorry for leading you slightly astray; the tricky thing about malloc
>> overwrite bugs is that they generally don't hit until a *later* malloc or free
>> tries to (re/de-)allocate the following memory area.
>>
>> ? You might be able to get at it by breakpointing at the start of the arg
>> handling code in g++spec.c, and setting a watchpoint on one-after-the-end-of
>> the argv array, for example.
>
> Valgrind Memcheck is your friend.
>
> Andrew.
>
I don't know how to use that. Is it available on the compile farm?