Using strace fixes hung memory issue

倾然丶 夕夏残阳落幕 提交于 2019-12-07 01:04:26

问题


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).

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.

I have read this:

strace fixes hung process

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.

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

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) ?


回答1:


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:

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?

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



来源:https://stackoverflow.com/questions/21433864/using-strace-fixes-hung-memory-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!