Valgrind:禁用条件跳转(或整个库)检查 [英] Valgrind: disable conditional jump (or whole library) check

查看:95
本文介绍了Valgrind:禁用条件跳转(或整个库)检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用OpenSSL API开发应用程序.众所周知,OpenSSL使用大量的全局变量,这些变量被Valgrind视为错误(条件跳转或移动..."等).因此,Valgrind的输出被共享库中的错误所阻塞.这对于调试目的非常不方便,因为每次我得到:

I am developing application using OpenSSL API. As it known, OpenSSL uses miriades of global variables which are taken by Valgrind as errors ("conditional jump or move..." etc). Thus the Valgrind's output gets clogged with errors from shared libraries. This is very inconvenient for debug purposes, because every time I get:

总共检测到

个错误总数超过 X 个.我不再报告了. 最终错误计数将不准确.去修复你的程序!

More than X total errors detected. I'm not reporting any more. Final error counts will be inaccurate. Go fix your program!

问题是:

  1. 我可以在Valgrind中禁用方库(在我的情况下为 -lssl -lcrypto )吗?
  2. 或者我可以仅关注绝对丢失"的错误吗?

  1. Can I disable party libraries (-lssl and -lcrypto in my case) memory checks in Valgrind?
  2. OR can I focus only on "definitly lost" errors?

谢谢.

推荐答案

Valgrind可以配置为抑制库中的错误.

Valgrind can be configured to suppress errors in libraries.

关于此的详细信息,您可以在这里找到: http://valgrind.org/docs/manual/manual-core.html#manual-core.suppress

Details on this you find here: http://valgrind.org/docs/manual/manual-core.html#manual-core.suppress

来自上面链接的网页:

注意:到目前为止,添加抑制的最简单方法是使用核心命令行选项"中介绍的--gen-suppressions = yes选项.这将自动生成抑制.但是,为了获得最佳结果,您可能需要手动编辑--gen-suppressions = yes的输出,在这种情况下,建议通读本节.

Note: By far the easiest way to add suppressions is to use the --gen-suppressions=yes option described in Core Command-line Options. This generates suppressions automatically. For best results, though, you may want to edit the output of --gen-suppressions=yes by hand, in which case it would be advisable to read through this section.

这篇关于Valgrind:禁用条件跳转(或整个库)检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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