我可以做的valgrind忽视的glibc库? [英] Can I make valgrind ignore glibc libraries?
问题描述
是否有可能告诉Valgrind的忽略一些的库?
具体的glibc库。
Is it possible to tell valgrind to ignore some set of libraries? Specifically glibc libraries..
实际的问题:
我有一个运行在正常执行一些罚款code。无泄漏等。
Actual Problem: I have some code that runs fine in normal execution. No leaks etc.
当我试图通过Valgrind的运行它,我得到核心转储和程序重新启动/停止。
When I try to run it through valgrind, I get core dumps and program restarts/stops.
核心通常指向glibc的功能(通常fseek的,互斥等)。
据我所知,可能有一些问题不兼容的glibc / Valgrind的版本。
Core usually points to glibc functions (usually fseek, mutex etc). I understand that there might be some issue with incompatible glibc / valgrind version.
我尝试过各种版本的Valgrind的和glibc的版本,但没有运气。
有什么建议么?
I tried various valgrind releases and glibc versions but no luck. Any suggestions?
推荐答案
这可能不回答你的问题,但会提供你如何燮preSS某些错误的细节(这其他人提到,但有就不详细说明了):
This probably doesn't answer your question, but will provide you the specifics of how to suppress certain errors (which others have alluded to but have not described in detail):
首先,运行的valgrind
如下:
valgrind --gen-suppressions=all --log-file=valgrind.out ./a.out
现在输出文件 valgrind.out
将包含一些自动生成的SUP pression块这样的:
Now the output file valgrind.out
will contain some automatically-generated suppression blocks like the following:
{
stupid sendmsg bug: http://sourceware.org/bugzilla/show_bug.cgi?id=14687
Memcheck:Param
sendmsg(mmsg[0].msg_hdr)
fun:sendmmsg
obj:/usr/lib/libresolv-2.17.so
fun:__libc_res_nquery
obj:/usr/lib/libresolv-2.17.so
fun:__libc_res_nsearch
fun:_nss_dns_gethostbyname4_r
fun:gaih_inet
fun:getaddrinfo
fun:get_socket_fd
fun:main
}
在哪里愚蠢SENDMSG虫和链接是我添加引用此块的名称。现在,该块保存到 sendmsg.supp
,并告诉的valgrind
关于下一次运行该文件:
Where "stupid sendmsg bug" and the link are the name that I added to refer to this block. Now, save that block to sendmsg.supp
and tell valgrind
about that file on the next run:
valgrind --log-file=valgrind --suppressions=sendmsg.supp ./a.out
和的valgrind
将慷慨地忽略那个愚蠢的错误上游
And valgrind
will graciously ignore that stupid upstream bug.
这篇关于我可以做的valgrind忽视的glibc库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!