The pdump Script

Edit: Do you know about this now?

Originally posted August 4, 2015 on AIXchange

Do you have a hung process on your AIX machine? Do you need more information about a running process? These are just two instances where the pdump script could help you:

The pdump script extracts information from the running process by using the kdb command and other AIX tools. This script can be especially helpful if you suspect the process is in a hung state or is suspected to be in an infinite loop.

The pdump.sh data gathering process includes:

  • svmon
  • proctree
  • thread information
  • user area information
  • lock information
  • current stack information

In order to use the script
Step 1. Determine what process is hung.

If you suspect a process is hung, first find its <pid#> using the ps command. Then, using proctree <pid#>, check if that process has child processes that it might be waiting on. If the parent process is waiting on a child process, then you should first try running pdump.sh on the last child found in the proctree.

Step 2. Run pdump on the process.
pdump.sh <pid#>
Where <pid#> is the process id that is suspected to be hung or looping.

If you cannot determine which specific process is hung, you may simply run pdump.sh against PID 1 (the init process) as a start point for investigation:
    pdump.sh 1

Tips
It is often helpful to run two pdumps on the same process at 60 second intervals. This will allow IBM AIX support center representatives to verify if that process made any progress in that time frame. Capture this information and include it in the test case you upload to IBM.

Try running pdump with only the -l flag (long mode) unless instructed by your support representative to do otherwise. The -d flag (call dbx) might fail to attach to the process when it is hung in kernel mode.

You can copy the script from here. Change the permissions to 700 before running it for the first time.

Have you tried this tool? Were you even aware of it?