ArtVandelay
04-16-2007, 06:47 AM
I'm trying to debug a program I wrote that has a weird crash that
happens only on rare occasions. (doing this on Fedora 5)
I always seem to not be able to reproduce it when I run it
from gdb.
It's my understanding that you can get your program back
to that horrible state again within gdb using the core file.
It doesn't say "core dumped" when it crashes though, so
the first quesion would be "is there a core file?"
If there is, where is it? I ran find from the root dir
and the only thing that looked non-application specific
was /dev/core, but gdb wasn't able to use this, suggesting
that this isn't the matching core file.
This problem would be easy if I was smart enough to
run from gdb every time, but I'm not smart enough and it only
ever happens when I don't (Murphy's Law).
Here's the error, by the way:
[gjduff@minidex y25]$ ./zexe
*** glibc detected *** ./zexe: free(): invalid pointer: 0x099cfca8 ***
======= Backtrace: =========
/lib/libc.so.6[0x1fda68]
/lib/libc.so.6(__libc_free+0x78)[0x200f6f]
/usr/lib/libSDL-1.2.so.0(SDL_FreeSurface+0xc0)[0x6584ff0]
./zexe[0x804d9bc]
./zexe[0x804cfeb]
/lib/libc.so.6(__libc_start_main+0xdc)[0x1af4e4]
./zexe(__gxx_personality_v0+0x7d)[0x8049131]
======= Memory map: ========
00110000-00131000 r-xp 00000000 fd:00 1052207 /usr/lib/libjpeg.so.62.0.0
00131000-00132000 rwxp 00020000 fd:00 1052207 /usr/lib/libjpeg.so.62.0.0
0017d000-00196000 r-xp 00000000 fd:00 5821472 /lib/ld-2.4.so
...
other various crap / libraries in memory
...
05444000-05526000 r-xp 00000000 fd:00 1060220 /usr/lib/libstdc++.so.6.0.8
0552600Aborted
happens only on rare occasions. (doing this on Fedora 5)
I always seem to not be able to reproduce it when I run it
from gdb.
It's my understanding that you can get your program back
to that horrible state again within gdb using the core file.
It doesn't say "core dumped" when it crashes though, so
the first quesion would be "is there a core file?"
If there is, where is it? I ran find from the root dir
and the only thing that looked non-application specific
was /dev/core, but gdb wasn't able to use this, suggesting
that this isn't the matching core file.
This problem would be easy if I was smart enough to
run from gdb every time, but I'm not smart enough and it only
ever happens when I don't (Murphy's Law).
Here's the error, by the way:
[gjduff@minidex y25]$ ./zexe
*** glibc detected *** ./zexe: free(): invalid pointer: 0x099cfca8 ***
======= Backtrace: =========
/lib/libc.so.6[0x1fda68]
/lib/libc.so.6(__libc_free+0x78)[0x200f6f]
/usr/lib/libSDL-1.2.so.0(SDL_FreeSurface+0xc0)[0x6584ff0]
./zexe[0x804d9bc]
./zexe[0x804cfeb]
/lib/libc.so.6(__libc_start_main+0xdc)[0x1af4e4]
./zexe(__gxx_personality_v0+0x7d)[0x8049131]
======= Memory map: ========
00110000-00131000 r-xp 00000000 fd:00 1052207 /usr/lib/libjpeg.so.62.0.0
00131000-00132000 rwxp 00020000 fd:00 1052207 /usr/lib/libjpeg.so.62.0.0
0017d000-00196000 r-xp 00000000 fd:00 5821472 /lib/ld-2.4.so
...
other various crap / libraries in memory
...
05444000-05526000 r-xp 00000000 fd:00 1060220 /usr/lib/libstdc++.so.6.0.8
0552600Aborted