Problem : Understanding Pstack outout

Problem : Understanding Pstack outout

Hi Experts,

I’m  trying to understand the pstack output. Below the pstack run on the oracle listener process.
Could please explain me in understanding this in detail….

[oracle@testnet ~]$ ps -ef | grep listener
oracle   24544     1  0 Apr09 ?        00:00:01 /oracle/home10gr1/bin/tnslsnr testlistener -inherit

[oracle@testnet shashi]$ pstack 24544
Thread 3 (Thread -1222665296 (LWP 24545)):

#0  0x0090a7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x009b2b86 in __nanosleep_nocancel () from /lib/tls/libc.so.6
#2  0x009b298c in sleep () from /lib/tls/libc.so.6
#3  0xb72909af in ons_receivethread () from /oracle/home10gr1/lib/libons.so
Thread 2 (Thread -1233155152 (LWP 24546)):
#0  0x0090a7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x00b8ab26 in pthread_cond_wait@@GLIBC_2.3.2 ()
#2  0x00b8b16e in pthread_cond_wait@GLIBC_2.0 () from /lib/tls/libpthread.so.0
#3  0xb729127f in ons_recvthread_getsocket ()
#4  0xb7297c0c in recvctx () from /oracle/home10gr1/lib/libons.so
#5  0x080ed150 in ?? ()
#6  0xb7291726 in ons_sendthread () from /oracle/home10gr1/lib/libons.so
#7  0xb67f84c8 in ?? ()
#8  0x00000000 in ?? ()
Thread 1 (Thread -1222072640 (LWP 24544)):
#0  0x0090a7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x009e61d4 in poll () from /lib/tls/libc.so.6
#2  0xb78092d3 in __PGOSF41_ntevpque ()
#3  0xb7807198 in ntevque () from /oracle/home10gr1/lib/libclntsh.so.10.1
#4  0xb77e638a in nsevwait () from /oracle/home10gr1/lib/libclntsh.so.10.1
#5  0x08056867 in nsglma ()
#6  0x0804c22f in main ()


 

Solution: Understanding Pstack outout

Your program has 3 threads. For each thread, you can read the stack from top to bottom (ie. the function calls made) :

1) the first thread is the receivethread. The main function of this thread is ons_receivethread(). It’s currently in sleep state.

2) the second thread is the sendthread. The main function of this thread is ons_sendthread(). It’s currently in pthread_cond_wait state in the ons_recvthread_getsocket() function.

3) the third thread is the main thread. It runs the main() function of the program. It’s currently blocked on poll().

So, you have three threads that are all blocked now. That might be normal, but are you seeing a deadlock situation by any chance ?