rmsock bug and workaround

I found a bug in rmsock on AIX 6.1 TL9 recently which caused a server crash. If run on a socket ID that has disappeared, the server just dumps and reboots.

I came up with a work around for identifying process owners of open TCP sockets in AIX without using rmsock. Do the following using the AIX debugger kdb:

–       Run ‘netstat -A’ with any other flags you desire. Grab the socket ID from the first column and start up ‘kdb’.
–       Run ‘sockinfo <sockID from above> tcpcb’ and hit <enter> repeatedly until you get to the bottom
–       Grab the PID number right after the word ACTIVE as below:

proc/fd: fd: 14
SLOT NAME     STATE      PID    PPID          ADSPACE  CL #THS

pvproc+099400  613*oracle   ACTIVE 2650070 0000001 0000000AEF722590   0 0001

–       Run ‘hcal’ on the PID, still inside kdb, to convert to dec:

(0)> hcal 2650070
Value hexa: 02650070          Value decimal: 40173680

–       Exit out to a promt and use ‘ps’ grepping for the decimal PID to find the process.

All without risking a crash.

This entry was posted in AIX and tagged , , , , , . Bookmark the permalink.

1 Response to rmsock bug and workaround

Leave a Reply