2

I am running pstack to find function stack for my application running on two machines (both RHEL)

In one of my machine it is working as expected

[root@civ4cez191 bin]# pstack 22947
Thread 2 (Thread 0x7f63cbe7d700 (LWP 22949)):
#0  0x0000003c3640f0cd in pause () from /lib64/libpthread.so.0
#1  0x0000000000485a78 in _signalWaitThread(void*) ()
#2  0x0000003c36407aa1 in start_thread () from /lib64/libpthread.so.0
#3  0x0000003c360e8aad in clone () from /lib64/libc.so.6
Thread 1 (Thread 0x7f63d2d07700 (LWP 22947)):
#0  0x0000003c360e1523 in select () from /lib64/libc.so.6
#1  0x00000000004ccc36 in TFDSETSelect(void*, void*, int) ()
#2  0x00000000004cb50f in SvrInit1(unsigned int (*)(void*, void**), unsigned int (*)(void*, void*, void**, unsigned int*), void (*)(void*), unsigned int (*)(unsigned short, unsigned short), void (*)(unsigned short, unsigned short), void (*)(unsigned short, unsigned short), unsigned short, unsigned char, unsigned short, unsigned char) ()
#3  0x00000000004259f0 in main ()

However in other machine it is just printing name of the threads

[root@civ4cez194 bin]# pstack 12672
Thread 7 (Thread 0x7f01892e2700 (LWP 12674)):
Thread 6 (Thread 0x7f0188aa0700 (LWP 12743)):
Thread 5 (Thread 0x7f0188a1e700 (LWP 7090)):
Thread 4 (Thread 0x7f0188a5f700 (LWP 7127)):
Thread 3 (Thread 0x7f01889dd700 (LWP 7178)):
Thread 2 (Thread 0x7f0188ae1700 (LWP 7235)):
Thread 1 (Thread 0x7f0193ca0740 (LWP 12672)):

I have looked for a way to resolve this but haven't had much success. Only significant information I found was here

For thread information to be dumped, you have to use the debug-aware version of the LinuxThreads libpthread.so library.
(To check, run nm(1) on your pthreads library, and
make sure that the symbol "__pthread_threads_debug" is defined.) Threads are not supported with the newer NPTL libpthread.so library.

On doing nm on /lib64/libpthread.so.0 on both the machines, the only debug related field I could find was "__pthread_debug", however it is present in both.

Will appreciate help.

6
  • The message says to look for __pthread_threads_debug and you say you found __pthread_debug.  They’re not the same. Please do not respond in comments; edit your question to make it clearer and more complete. – G-Man Says 'Reinstate Monica' May 21 '18 at 3:26
  • Ah, I was confused by the statement “In one of my machine[s] it is working as expected”.   Actually the issue is that one machine is working unexpectedly, and the other is failing as expected. – G-Man Says 'Reinstate Monica' May 21 '18 at 17:33
  • I didn't understand previous comment @G-Man – Gaurav May 21 '18 at 17:55
  • I’m saying that, if __pthread_threads_debug must be defined for pstack to work correctly (to dump thread information), and __pthread_threads_debug isn’t defined on either machine, then it’s a mystery why the first machine is working.  I guess I was being a little snarky; I apologize.  But I’m serious. P.S. It would be nice if you would identify the source of that “For thread information to be dumped” statement. – G-Man Says 'Reinstate Monica' May 21 '18 at 19:19
  • @G-Man Sorry The link was removed while copy pasting from stackoverflow editing it. – Gaurav May 21 '18 at 19:30
0

So it turns out there was issue with python installation on the setup due to which backtrace was not working, fixing python installation fixed the problem.

Not the answer you're looking for? Browse other questions tagged or ask your own question.