0

I am trying to use pstack to print the stacktrace of all threads of specific process, but I get only the main thread.

According to the pstack description:
pstack - print a stack trace of a running process
...
If the process is part of a thread group, then pstack will print out a stack trace for each of the threads in the group.

I used gdb to attach to the process and verified that there are more threads. I run pstack with one of threads id, and got the requested result.
[I also used ps -j and saw other processes with the same group id, but I don't think it is relevant]

I read related pstack questions, but didn't see anything that can help me. Also searched google, but didn't see anyone asking about it.

Thanks


I didn't notice that "For thread information to be dumped, you have to use the debug-aware version of the LinuxThreads libpthread.so library."

si_s
  • 21
  • 3
  • 1
    Welcome to Stack Overflow. This is not a good way to ask a question here. Did you try anything so far to solve your problem? Show your effort first so people might show theirs. Please read [FAQ](http://stackoverflow.com/tour), [How to Ask](http://stackoverflow.com/help/how-to-ask) and [help center](http://stackoverflow.com/help) as a start. – Nahuel Ianni Oct 30 '14 at 13:43
  • The question was edited. Is it better? – si_s Nov 03 '14 at 09:33

1 Answers1

1

The problem is in the libpthread.so library version. According to http://linuxcommand.org/man_pages/pstack1.html: "For thread information to be dumped, you have to use the debug-aware version of the LinuxThreads libpthread.so library."

Since I can't replace the library, I will find the thread ids separately and use pstack on each. Hope it will help someone.

si_s
  • 21
  • 3