使用strace修复了挂起的内存问题 [英] Using strace fixes hung memory issue

查看:207
本文介绍了使用strace修复了挂起的内存问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在RHEL6.x(64位)上运行的多线程进程.

I have a multithreaded process running on RHEL6.x (64bit).

当我尝试启动该进程时,我发现该进程挂起并且大多数线程(同一进程)崩溃.一些线程等待线程之间的共享内存被创建(我看到所有共享内存都没有被创建).

I find that the process hangs and some threads (of the same process) crash most of the time when I try to bring up the process. Some threads wait for shared memory between the threads to get created (I can see that all of it does not get created).

但是当我使用strace时,该进程不会挂起,并且工作正常(应该创建的所有内存都已创建).即使在创建内存后中断strace,也可以使进程永久正常运行.

But when I use strace , the process does not hang and it works just fine (all of the memory that is supposed to be created, gets created). Even interrupting strace after the memory gets created, keeps the process running fine for good.

我已阅读:

strace修复挂起的进程

的确给了我一个主意.但是我仍然不清楚,因为没有提到他们使用的RHEL版本.

which did give me an idea. But I am still unclear on this as the version of RHEL that they have used is not mentioned.

此外,还有一点是,将内核更改为fedora(兼容)内核不会产生问题.

Also, another point is that, changing the kernel to a fedora (compatible) kernel did not produce the issue.

因此,我只想知道strace对流程有何影响? (或者只是链接中指出的只是返回到内核的堆栈)?

So, I would just like to know how exactly does strace affect a process ? (or is it just the stack that moves back to the kernel as pointed out in the link) ?

推荐答案

我还不能发表评论,但是在过去的工作中我看到了类似的事情.由于实际上没有给出确切的答案,因此我将继续进行以下操作:

I can't yet comment, but I've seen similar things in past work. Since there is not really a definitive answer to be given, I'm going to go with this:

由于时序问题,您在线程之间进入死锁的可能性有多大?通过strace来减慢程序执行的速度可以解决"这一问题?

What are the odds that you're entering a deadlock between threads due to timing issues, which get 'resolved' by strace slowing down the program execution?

如果您通过该过程而不是strace进行调试会发生什么?

What happens if you debug through the process, instead of strace?

这篇关于使用strace修复了挂起的内存问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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