*** buffer overflow detected *** error

Andrew Haley aph@redhat.com
Fri Nov 28 10:59:00 GMT 2008


ying lcs wrote:
> On Thu, Nov 27, 2008 at 4:06 AM, Andrew Haley <aph@redhat.com> wrote:
>> ying lcs wrote:
>>
>>> I have a c++ application compiled using gcc. But i get this exception
>>> when i execute it.
>>> Can you please tell me how can I trouble-shoot it?
>> Either
>>
>> a.  Run in gdb, and look at where the buffer overflow happens, or
>> b.  Run under Valgrid's memcheck.
\
>>
> Thanks. But it appears it crashes inside libc?

Doesn't look like it to me.  The buffer overflow was detected by
libc.  You have to look at the buffer in question and see where it's
overflowing.  It's near impossible here because you don't have debuginfo
for the libraries.

> And when I compile the same code in Ubuntu 8.04. It works. But now I
> do that in Ubuntu 8.10. I get this error:
> 
> [Switching to Thread 0xb733f700 (LWP 16842)]
> 0xb7f9e430 in __kernel_vsyscall ()
> (gdb) bt
> #0  0xb7f9e430 in __kernel_vsyscall ()
> #1  0xb74b7880 in raise () from /lib/tls/i686/cmov/libc.so.6
> #2  0xb74b9248 in abort () from /lib/tls/i686/cmov/libc.so.6
> #3  0xb74f510d in ?? () from /lib/tls/i686/cmov/libc.so.6
> #4  0xb7586558 in __fortify_fail () from /lib/tls/i686/cmov/libc.so.6
> #5  0xb7584680 in __chk_fail () from /lib/tls/i686/cmov/libc.so.6
> #6  0xb7584de8 in __realpath_chk () from /lib/tls/i686/cmov/libc.so.6
> #7  0x0804f914 in XPCOMGlueLoad (
>     xpcomFile=0xbfc9ee64 "/media/olddata/objdir/ss3/dist/bin/libxpcom.so")
>     at /usr/include/bits/stdlib.h:46
> #8  0x0804f7c5 in XPCOMGlueStartup (xpcomFile=0x0)
>     at /home/yinglcs/firefox-3.0/mozilla/xpcom/glue/standalone/nsXPCOMGlue.cpp:70
> #9  0x0804bbd0 in main (argc=1, argv=0xbfc9ff14)
>     at /home/yinglcs/firefox-3.0/mozilla/embedding/browser/gtk/tests/TestGtkEmbed.cpp:212

Probably the same problem.  Someone is writing outside the memory
that's been allocated.

Andrew.



More information about the Gcc-help mailing list