Can I make valgrind ignore glibc libraries?

后端 未结 4 989
青春惊慌失措
青春惊慌失措 2020-12-17 18:23

Is it possible to tell valgrind to ignore some set of libraries? Specifically glibc libraries..

Actual Problem: I have some code that runs fine in normal execution.

4条回答
  •  有刺的猬
    2020-12-17 19:07

    You probably want to ask about this on the Valgrind user's mailing list (which is extremely helpful). You can suppress output from certain calls, however, suppressing the noise is all you are doing. The calls are still going through Valgrind.

    To accomplish what you need, you (ideally) match Valgrind appropriately with glibc or use the macros in valgrind/valgrind.h to work around them. Using those, yes, you can tell valgrind not to touch certain things. I'm not sure what calls are borking everything, however you can also (selectively) not run bits of code in your own program if its run under valgrind. See the RUNNING_ON_VALGRIND macro in valgrind/valgrind.h.

    The other thing that comes to mind is to make sure that Valgrind was compiled correctly to deal with threads. Keep in mind that atomic operations under Valgrind could cause your program to crash during racey operations, where it otherwise might not, if not properly configured.

    If you have been swapping versions of valgrind and glibc, there's a chance you found a match, but incorrectly configured valgrind at build time.

提交回复
热议问题