0

我有一个 ncurses 应用程序执行以下操作,有时在启动后立即执行,有时在一些摆弄后执行。

malloc: *** error for object 0x100300400: double free
Program received signal SIGABRT, Aborted
(gdb) where
#0 0x00007fff846a7426 in read ()
#1 0x00007fff83f3d775 in _nc_wgetch ()
#2 0x00007fff83f3de3f in wgetch ()
(and so on into my code)

有没有人对可能的事情有建议?

4

1 回答 1

2

看起来您正在使用 glibc,可能是在 x86_64 Linux 系统上。

在 Linux/x86_64 上用于任何类型的堆损坏的工具是Valgrind。它会立即为您提供答案,因此猜测问题可能出在哪里(并且可能在任何地方)是没有意义的。

于 2009-11-16T00:31:52.740 回答