具有权限的Valgrind错误日志



我正在分析核心转储问题。我已经运行了valgrind并查看了错误日志。但我无法理解以下信息。有人能提供一些见解吗。我也尝试过gdb,但没有得到太多信息。我调查了其他线索,发现这可能是centos的问题。我使用的是CentOS 5.6版(最终版)。我听说glibc文件与centos5.6不兼容,但我对此不确定。任何时候都有人面临这个问题吗

==18035==
==18035== Jump to the invalid address stated on the next line
==18035==    at 0x0: ???
==18035==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==18035==
==18035==
==18035== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==18035==  Bad permissions for mapped region at address 0x0
==18035==    at 0x0: ???
==18035== Invalid free() / delete / delete[]
==18035==    at 0x47D951D: free (vg_replace_malloc.c:325)
==18035==    by 0x3141CD: ??? (in /lib/libc-2.5.so)
==18035==    by 0x313D46: ??? (in /lib/libc-2.5.so)
==18035==    by 0x47CC3B2: _vgnU_freeres (vg_preloaded.c:62)
==18035==  Address 0x198a55e0 is not stack'd, malloc'd or (recently) free'd
==18035==

跳转到下一行上指定的无效地址

这通常意味着两件事之一:

  1. 要么通过函数指针调用函数,而该指针是NULL,要么
  2. 您破坏了堆栈,返回地址被0s覆盖

来自GDB的崩溃堆栈跟踪可能在这里有所帮助。

如果这是堆栈损坏问题,请尝试使用AddressSanitizer(与Valgrind不同,它在检测堆栈溢出方面做得很好)。

最新更新