我正在运行 pstack 来查找在两台机器(均为 RHEL)上运行的应用程序的函数堆栈
在我的一台机器中,它按预期工作
[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 ()
然而在其他机器中它只是打印线程的名称
[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)):
我一直在寻找解决这个问题的方法,但没有取得太大成功。我发现的唯一重要信息是这里
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.
在两台机器上的 /lib64/libpthread.so.0 上执行 nm 时,我能找到的唯一与调试相关的字段是“__pthread_debug”,但它同时存在于两台机器中。
将不胜感激的帮助。
答案1
因此,事实证明,由于回溯无法正常工作,设置中的 python 安装出现了问题,修复 python 安装解决了该问题。