Operating System - HP-UX
1755737 Members
3686 Online
108837 Solutions
New Discussion юеВ

Re: Utility equivalent of PSTACK in HPUX

 
Avinash_2
Occasional Contributor

Utility equivalent of PSTACK in HPUX

Is there a utility available on HPUX 10.20 that can print the stack trace for each thread in a process (similar to /usr/proc/bin/pstack on Solaris)? I need to trouble shoot a problem where a multi-threaded process has become hung. I tried running PUMA but it crashes as soon as i click on the button "Collect Performance Data" with the follwing error:
X Error: BadName (named color or font does not exist)
Request major Code 45
Request minor Code 0
Resource ID 0x44000c4
Error Serial #966

I am really stuck at this point and any help will be appreciated.

Regards,
Avinash
9 REPLIES 9
ranganath ramachandra
Esteemed Contributor

Re: Utility equivalent of PSTACK in HPUX

have you tried gdb ?
 
--
ranga
[i work for hpe]

Accept or Kudo

Steven E. Protter
Exalted Contributor

Re: Utility equivalent of PSTACK in HPUX

Might want to think about tusc, though it is process id based.

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/tusc-7.5/

Might like this one too. Its old though.

Trace
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/trace-1.6/

Never used the second.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Avinash_2
Occasional Contributor

Re: Utility equivalent of PSTACK in HPUX

I have tried GDB and attached the process to it using FILE and attach commands. Then I gace "thread apply all bt" but I do not get the traces of all threads.
I tried to produce a core dump by issuing a "Kill -s sigquit" on the hung process but its so hung that I am not able to get a core file. The only thing that works is "Kill -9" but that does not give a core and I have then no way of knowing where the process is stuck. Any ideas as to how I can get the core dump or the stack trace will be great.

Regards,
Avinash
Mike Stroyan
Honored Contributor

Re: Utility equivalent of PSTACK in HPUX

The PUMA problem is a missing font. If you use a remote X server you may need to run an X font server on your HP-UX system and add that to the font path of your X server. That will help the X server to find the fonts that PUMA requests.

There is a good receipe for setting up the font server in this thread-
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x66f235067c18d6118ff40090279cd0f9,00.html

Avinash_2
Occasional Contributor

Re: Utility equivalent of PSTACK in HPUX

Thanks a lot. Now am able to run puma but the new problem is that puma is not attaching itself to already running process. I can run a new process from puma and get its data but when i try to attach a already running process, it gives an error message stating that it failed to attach to the process. Any idea why????
Mike Stroyan
Honored Contributor

Re: Utility equivalent of PSTACK in HPUX

The most common cause for failed attach is having an executable on a soft NFS mount point.

Given the other bad behavior of the process that you are trying to examine, I would expect that this failed attach is caused by the same bad state that prevents gdb and even core dumps from working.
Mike Stroyan
Honored Contributor

Re: Utility equivalent of PSTACK in HPUX

The most common cause for failed attach is having an executable on a soft NFS mount point.

The second most common cause is trying to attach to a setuid process.

Given the other bad behavior of the process that you are trying to examine, I would expect that this failed attach is caused by the same bad state that prevents gdb and even core dumps from working.
Mike Stroyan
Honored Contributor

Re: Utility equivalent of PSTACK in HPUX

The most common cause for failed attach is having an executable on a soft NFS mount point.

The second most common cause is trying to attach to a setuid process. The attach mechanism in puma is basically the same ptrace used by gdb.

Given the other bad behavior of the process that you are trying to examine, I would expect that this failed attach is caused by the same bad state that prevents gdb and even core dumps from working.
Mike Stroyan
Honored Contributor

Re: Utility equivalent of PSTACK in HPUX

I thought I had cancelled those first two drafts. :-)