【发布时间】:2011-05-30 11:13:18
【问题描述】:
可能重复:
glibc detected error
嗨, 当我在开关盒中按下一个选项时收到此错误时,我正在使用 GNU C++ 执行我的项目。由于程序的其余部分执行良好,我留下了这个错误。我不知道它是什么以及为什么会发生。请解释并指导我从哪里开始查看我的程序。
错误详情:
*** glibc detected *** ./test.out: free(): invalid pointer: 0xbfb1c874 ***
======= Backtrace: =========
/lib/libc.so.6[0x55c0f1]
/lib/libc.so.6(cfree+0x90)[0x55fbc0]
./test.out[0x809f855]
./test.out[0x804fbc0]
./test.out[0x804f9bb]
./test.out[0x80502bb]
./test.out[0x805084e]
./test.out[0x8050d07]
/lib/libc.so.6(__libc_start_main+0xdc)[0x508e8c]
./test.out[0x8049981]
======= Memory map: ========
004f3000-00631000 r-xp 00000000 08:01 6148422 /lib/libc-2.5.so
00631000-00633000 r-xp 0013e000 08:01 6148422 /lib/libc-2.5.so
00633000-00634000 rwxp 00140000 08:01 6148422 /lib/libc-2.5.so
00634000-00637000 rwxp 00634000 00:00 0
0078d000-007a7000 r-xp 00000000 08:01 6152013 /lib/ld-2.5.so
007a7000-007a8000 r-xp 00019000 08:01 6152013 /lib/ld-2.5.so
007a8000-007a9000 rwxp 0001a000 08:01 6152013 /lib/ld-2.5.so
007f9000-0081e000 r-xp 00000000 08:01 6148435 /lib/libm-2.5.so
0081e000-0081f000 r-xp 00024000 08:01 6148435 /lib/libm-2.5.so
0081f000-00820000 rwxp 00025000 08:01 6148435 /lib/libm-2.5.so
00b18000-00b23000 r-xp 00000000 08:01 6148439 /lib/libgcc_s-4.1.2-20080825.so.1
00b23000-00b24000 rwxp 0000a000 08:01 6148439 /lib/libgcc_s-4.1.2-20080825.so.1
08048000-080c6000 r-xp 00000000 00:1e 736543 /users/guest10/shashi/Demo/src/test.out
080c6000-080c7000 rwxp 0007e000 00:1e 736543 /users/guest10/shashi/Demo/src/test.out
080c7000-080cc000 rwxp 080c7000 00:00 0
08d05000-218b1000 rwxp 08d05000 00:00 0 [heap]
b7e00000-b7e21000 rwxp b7e00000 00:00 0
b7e21000-b7f00000 ---p b7e21000 00:00 0
b7fab000-b7fac000 rwxp b7fab000 00:00 0
b7fc4000-b7fc7000 rwxp b7fc4000 00:00 0
b7fc7000-b7fc8000 r-xp b7fc7000 00:00 0 [vdso]
bfb0b000-bfb21000 rw-p bffe9000 00:00 0 [stack]
Abort
请帮忙..谢谢你的建议
【问题讨论】:
-
我对 glibc 的堆调试了解不多,但是……当你用
-g编译时,堆栈会变得更好吗?当你这样做并在gdb下运行它怎么样?