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) ?
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With