Skip to end of metadata
Go to start of metadata


Prints a stack trace for a running process.

When a server appears to be hung, the stack trace is useful to SAP Support for determining just what internal code is being executed.

Here's a shell script that will collect pstack output in individual files, one per dataserver process.

----------------------

#!/bin/sh

for i in `ps -ef | grep dataserver | grep -v grep| awk '{print $2}'`

do

echo "Running pstack on pid ${i}"

pstack $i > pstack.${i}.out

echo ""

done

----------------------

Example of usage:

You can get the process id from "showserver"

$ showserver
0 S bret 38593 38592 0 80 0 - 1073998679 futex_ Sep29 ? 02:29:08 /user/bret/rel1604/ASE-16_0/bin/dataserver -d/user/bret/rel1604/data/master.dat2 -e/user/bret/rel1604/ASE-16_0/install/rel1604_bret2.log -c/user/bret/rel1604/ASE-16_0/rel1604_bret2.cfg -M/user/bret/rel1604/ASE-16_0 -N/user/bret/rel1604/ASE-16_0/sysam/rel1604_bret2.properties -i/user/bret/rel1604 -srel1604_bret2

pass the pid to pstack:


$ pstack 38593
Thread 16 (Thread 0x7fbff8aee700 (LWP 38608)):
#0 0x0000003ac8633727 in sigwaitinfo () from /lib64/libc.so.6
#1 0x000000000226b79c in kisigwait ()
#2 0x0000000002257939 in krtctskRun ()
#3 0x000000000225c74c in ktskRun ()
#4 0x000000000228df6a in kt__RTCMain ()
#5 0x000000000229d279 in thread_create_handler ()
#6 0x0000003ac8a07aa1 in start_thread () from /lib64/libpthread.so.0
#7 0x0000003ac86e8c4d in clone () from /lib64/libc.so.6
Thread 15 (Thread 0x7f7ff8aed700 (LWP 38609)):
#0 0x0000003ac8a0b68c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x000000000224d36a in kcvWait ()
#2 0x000000000224d0ec in bcqDequeue ()
#3 0x00000000022624f3 in kbctMain ()
#4 0x0000000002257939 in krtctskRun ()
#5 0x000000000225c74c in ktskRun ()
#6 0x000000000228df6a in kt__RTCMain ()
#7 0x000000000229d279 in thread_create_handler ()
#8 0x0000003ac8a07aa1 in start_thread () from /lib64/libpthread.so.0
#9 0x0000003ac86e8c4d in clone () from /lib64/libc.so.6
Thread 14 (Thread 0x7f3ff8aec700 (LWP 38610)):
#0 0x0000003ac8a0b68c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x000000000224d36a in kcvWait ()
#2 0x000000000224d0ec in bcqDequeue ()
#3 0x00000000022624f3 in kbctMain ()
#4 0x0000000002257939 in krtctskRun ()
#5 0x000000000225c74c in ktskRun ()
#6 0x000000000228df6a in kt__RTCMain ()
#7 0x000000000229d279 in thread_create_handler ()
#8 0x0000003ac8a07aa1 in start_thread () from /lib64/libpthread.so.0
#9 0x0000003ac86e8c4d in clone () from /lib64/libc.so.6
Thread 13 (Thread 0x7efff8aeb700 (LWP 38611)):
#0 0x0000003ac8a0b68c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x000000000224d36a in kcvWait ()
#2 0x000000000224d0ec in bcqDequeue ()
#3 0x00000000022624f3 in kbctMain ()
#4 0x0000000002257939 in krtctskRun ()
#5 0x000000000225c74c in ktskRun ()
#6 0x000000000228df6a in kt__RTCMain ()
#7 0x000000000229d279 in thread_create_handler ()
#8 0x0000003ac8a07aa1 in start_thread () from /lib64/libpthread.so.0
#9 0x0000003ac86e8c4d in clone () from /lib64/libc.so.6
Thread 12 (Thread 0x7ebff8aea700 (LWP 38612)):
#0 0x0000003ac8a0b68c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x000000000224d36a in kcvWait ()
#2 0x000000000224d0ec in bcqDequeue ()
#3 0x00000000022624f3 in kbctMain ()
#4 0x0000000002257939 in krtctskRun ()
#5 0x000000000225c74c in ktskRun ()
#6 0x000000000228df6a in kt__RTCMain ()
#7 0x000000000229d279 in thread_create_handler ()
#8 0x0000003ac8a07aa1 in start_thread () from /lib64/libpthread.so.0
#9 0x0000003ac86e8c4d in clone () from /lib64/libc.so.6
Thread 11 (Thread 0x7e7ff8ae9700 (LWP 38613)):
#0 0x0000003ac8a0ba5e in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x000000000224d41b in kcvTimedWait ()
#2 0x000000000228bcf3 in ktMuxThreadSleep ()
#3 0x000000000228c9b6 in kt__MuxMain ()
#4 0x000000000229d279 in thread_create_handler ()
#5 0x0000003ac8a07aa1 in start_thread () from /lib64/libpthread.so.0
#6 0x0000003ac86e8c4d in clone () from /lib64/libc.so.6
Thread 10 (Thread 0x7e3ff8ae8700 (LWP 38614)):
#0 0x0000003ac8a0ba5e in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x000000000224d41b in kcvTimedWait ()
#2 0x000000000228bcf3 in ktMuxThreadSleep ()
#3 0x000000000228c9b6 in kt__MuxMain ()
#4 0x000000000229d279 in thread_create_handler ()
#5 0x0000003ac8a07aa1 in start_thread () from /lib64/libpthread.so.0
#6 0x0000003ac86e8c4d in clone () from /lib64/libc.so.6
Thread 9 (Thread 0x7dfff8ae7700 (LWP 38615)):
#0 0x0000003ac8a0ba5e in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x000000000224d41b in kcvTimedWait ()
#2 0x000000000228bcf3 in ktMuxThreadSleep ()
#3 0x000000000228c9b6 in kt__MuxMain ()
#4 0x000000000229d279 in thread_create_handler ()
#5 0x0000003ac8a07aa1 in start_thread () from /lib64/libpthread.so.0
#6 0x0000003ac86e8c4d in clone () from /lib64/libc.so.6
Thread 8 (Thread 0x7dbff8ae6700 (LWP 38616)):
#0 0x0000003ac8a0e82d in read () from /lib64/libpthread.so.0
#1 0x00000000024de303 in comn__sig_catcher_thread ()
#2 0x000000000229d279 in thread_create_handler ()
#3 0x0000003ac8a07aa1 in start_thread () from /lib64/libpthread.so.0
#4 0x0000003ac86e8c4d in clone () from /lib64/libc.so.6
Thread 7 (Thread 0x7d7ff8ae5700 (LWP 38617)):
#0 0x0000003ac8a0b68c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00000000024dce7e in comn_wait_cond ()
#2 0x0000000002493413 in rman__thread ()
#3 0x000000000229d279 in thread_create_handler ()
#4 0x0000003ac8a07aa1 in start_thread () from /lib64/libpthread.so.0
#5 0x0000003ac86e8c4d in clone () from /lib64/libc.so.6
Thread 6 (Thread 0x7d3ff8ae4700 (LWP 38618)):
#0 0x0000003ac8a0b68c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00000000024dce7e in comn_wait_cond ()
#2 0x0000000002493413 in rman__thread ()
#3 0x000000000229d279 in thread_create_handler ()
#4 0x0000003ac8a07aa1 in start_thread () from /lib64/libpthread.so.0
#5 0x0000003ac86e8c4d in clone () from /lib64/libc.so.6
Thread 5 (Thread 0x7cfff8ae3700 (LWP 38619)):
#0 0x0000003ac8a0b68c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00000000024dce7e in comn_wait_cond ()
#2 0x0000000002493413 in rman__thread ()
#3 0x000000000229d279 in thread_create_handler ()
#4 0x0000003ac8a07aa1 in start_thread () from /lib64/libpthread.so.0
#5 0x0000003ac86e8c4d in clone () from /lib64/libc.so.6
Thread 4 (Thread 0x7cbff8ae2700 (LWP 38620)):
#0 0x0000003ac86df403 in poll () from /lib64/libc.so.6
#1 0x00000000024970fc in sybnet__async_poll ()
#2 0x000000000229d279 in thread_create_handler ()
#3 0x0000003ac8a07aa1 in start_thread () from /lib64/libpthread.so.0
#4 0x0000003ac86e8c4d in clone () from /lib64/libc.so.6
Thread 3 (Thread 0x7c7ff3fff700 (LWP 38621)):
#0 0x0000003ac86e9243 in epoll_wait () from /lib64/libc.so.6
#1 0x000000000228a7e6 in ksepollnetctlrWaitForCompletion ()
#2 0x000000000222c421 in iocRunController ()
#3 0x0000000002257939 in krtctskRun ()
#4 0x000000000225c74c in ktskRun ()
#5 0x000000000228df6a in kt__RTCMain ()
#6 0x000000000229d279 in thread_create_handler ()
#7 0x0000003ac8a07aa1 in start_thread () from /lib64/libpthread.so.0
#8 0x0000003ac86e8c4d in clone () from /lib64/libc.so.6
Thread 2 (Thread 0x7c3ff3ffe700 (LWP 38622)):
#0 0x0000003ef8c00614 in ?? () from /lib64/libaio.so.1
#1 0x0000000002235f05 in basis_dpoll ()
#2 0x00000000022343f7 in udcPoll ()
#3 0x000000000222c421 in iocRunController ()
#4 0x0000000002257939 in krtctskRun ()
#5 0x000000000225c74c in ktskRun ()
#6 0x000000000228df6a in kt__RTCMain ()
#7 0x000000000229d279 in thread_create_handler ()
#8 0x0000003ac8a07aa1 in start_thread () from /lib64/libpthread.so.0
#9 0x0000003ac86e8c4d in clone () from /lib64/libc.so.6
Thread 1 (Thread 0x7fbfff98d740 (LWP 38593)):
#0 0x0000003ac8a0b68c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x0000000002270a17 in kistartup ()
#2 0x00000000018220fa in c_main ()
#3 0x0000003ac861ed20 in __libc_start_main () from /lib64/libc.so.6
#4 0x0000000001821789 in _start ()

  • No labels