Valgrind是否存在误报问题? [英] Are there known false positives issues with Valgrind?

查看:361
本文介绍了Valgrind是否存在误报问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Valgrind有没有任何已知的误报?我使用 fmemopen 函数获得'条件跳转或移动取决于未初始化的值',写入C并用GCC编译。我可以确定它是真实的吗?



编辑:是否有已知问题不在压缩文件中?有没有什么事情可以在程序中做,这并不是真正的错误,但Valgrind会说他们是?如果有已知的问题,列表会很好。

解决方案

是的,Valgrind存在误报,这就是为什么它有例如,特定的glibc和gcc版本的压缩文件。假如你正在使用较老的valgrind和更新的gcc和glibc,也就是valgrind 3.3和glibc 2.9,那么可能会出现误报。



尽管如此,你仍然需要研究问题并找出它是否真的是一个误报(如果事实证明是这样的话,你可以自己写一个抑制),或者它是你的程序中的一个真正的bug。



没有简单快捷的方式来说明这里发生了什么,但是在这种情况下,我会怀疑您将代码中未初始化的值传递给库代码。尝试Valgrind选项 - track-origins = yes 。它会显示未初始化值的来源。如果它是你的代码,可能你应该初始化它。如果它在库中,可能是误报,或者仍然是库调用参数的错误值可能导致它,请检查它们。


Are there any known false positives with Valgrind? I get a 'Conditional jump or move depends on uninitialised value(s)' with the fmemopen function, writing in C and compiling with GCC. Can I be sure it's real?

EDIT: Are there known issues that are not in the suppression files? Are there some things one can do in a program, that are not really errors but Valgrind will say they are? If there are known issues, a list would be nice.

解决方案

Yes, there are false positives with Valgrind, that's why it has suppression files for particular glibc and gcc versions, for example. The false positives may arise if you are using older valgrind with newer gcc and glibc, i.e., valgrind 3.3 with glibc 2.9.

Having said that, you still have to look into issue and find out if it is really a false positive (if that turns out to be the case, you can write a suppression for it yourself) or is it a real bug in your program.

There is no quick and easy way to say what is going on here, but in this case I'd suspect that you are passing uninitialized value from your code to library code. Try Valgrind option --track-origins=yes. It will show where the uninitialized value came from. If it is your code, probably you should initialize it. If it's inside library, it could be the false positive or, still, bad values of library call arguments might be causing it, so check those.

这篇关于Valgrind是否存在误报问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆