我怎么告诉的valgrind到MEMCHECK派生进程? [英] How do I tell valgrind to memcheck forked processes?

查看:339
本文介绍了我怎么告诉的valgrind到MEMCHECK派生进程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个过程 X 我要检查与的valgrind 泄漏。问题是, X 是又是以Z 运行。我不能运行 X 独立的,因为以Z 设置为环境X ,如环境变量,命令行开关,由 X所需的文件


  1. 有什么办法,我可以告诉的valgrind 以Z 运行,但按照其发现的任何叉子和报告他们呢?

  2. 有什么办法,我可以告诉的valgrind 遵循任何叉子,但只在名为进程报告 X

  3. 有什么办法,我可以告诉的valgrind 附加到已经运行的过程中,我可以使用gdb的方式做?

我不知道这事,但我下Suse64 linux和的valgrind-2.4.0。

运行

谢谢!


解决方案

    微量的孩子= YES 选项 -
  1. Valgrind的给出的时,如下派生进程。

  2. 您应该能够通过使用合适的过滤器来实现这一目标。

  3. 没有。 Valgrind的挂接到模块加载code。使用LD_ preLOAD,所以连接到正在运行的进程是不可能的。

I have a process x that I want to check for leaks with valgrind. The problem is that x is run by y, and y in turn is run by z. I can't run x standalone because y and z setup the environment for x, such as environment variables, command line switches, files needed by x etc.

  1. Is there any way I can tell valgrind to run on z but to follow any forks it finds and report them too?
  2. Is there any way I can tell valgrind to follow any forks but only report on the process named x?
  3. Is there any way I can tell valgrind to attach to already-running process, the way I can do with gdb?

I don't know if this matters, but I'm running under Suse64 linux and valgrind-2.4.0.

Thanks!

解决方案

  1. Valgrind follows forked processes when given the --trace-children=yes option.
  2. You should be able to achieve this by using suitable filters.
  3. No. Valgrind hooks into the module loading code using LD_PRELOAD, so attaching to a running process is not possible.

这篇关于我怎么告诉的valgrind到MEMCHECK派生进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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