How to use pstack and gcore to gather additional data for Support

Article: 100022539
Last Published: 2020-08-05
Ratings: 7 1
Product(s): InfoScale & Storage Foundation

Problem

How to use pstack and gcore to gather additional data for Support

Solution

Problem Description

Support will occasionally request data outputs from the pstack and gcore commands. These commands are available in Solaris, HP-UX, AIX, and LINUX.
 
 
Related Article: Using vxgetcore to gather application core dump info for analysis
https://www.veritas.com/support/en_US/article.100014329


pstack

The pstack command will print a hexadecimal dump of the process stack, thus providing important information about a suspect process on the affected system.

# pstack 1094
1094:   /usr/lib/sendmail -bd -q15m
fefc6004 pollsys  (ffbfd080, 3, ffbfd128, 0)
fef66f20 pselect  (ffbfd080, feff2530, feff2530, 40, ffbfd128, 0) + 1c8
fef67298 select   (8, ffbfdb18, 0, 0, ffbfdb10, 109400) + a0
0002852c getrequests (121744, 7, 7, 11c388, 11c2f8, 3) + 690
00048a94 main     (0, 13f800, 64, 10f800, 121c00, e8c00) + 5b68
0001f6e0 _start   (0, 0, 0, 0, 0, 0) + 108

This command can also used on core files.

# pstack core.httpd.1008
core 'core.httpd.1008' of 1008: /opt/IBMHTTPD/bin/httpd
-----------------  lwp# 1 / thread# 1  --------------------
0002e3e8 ???????? (ffbeee7c, 1425, d, a16f0, 82b68, 9b098)
00031188 main     (1, ffbeef94, 96408, ff238018, ff23b03c, 82cf0) + 478
00031bec parse_byterange (1, ffbeef94, ffbeef9c, 96000, 0, 0) + 484
00017308 load_module (0, 0, 0, 0, 0, 0) + 140
-----------------  lwp# 2 / thread# 2  --------------------
ff21ad54 _signotifywait (ff16e000, 0, 0, ff23b540, 0, 0) + 8
ff151ae4 thr_yield (0, 0, 0, 0, 0, 0) + 8c
-----------------  lwp# 3 / thread# 3  --------------------
ff21b3e0 _lwp_sema_wait (fe30de30, ff16e000, 0, fe30dd78, 250c4, 0) + c
ff14944c _swtch   (fe30dd78, fe30dd78, ff16e000, 5, 1000, 1) + 424
ff14d8a4 _reap_wait (ff172a08, 20a38, 0, ff16e000, 0, 0) + 38
ff14d5fc _reaper  (ff16ee30, ff255d18, ff172a08, ff16ee08, 0,
fe400000) + 38
ff15ba1c _thread_start (0, 0, 0, 0, 0, 0) + 40
#

This command is available and usable also in HP-UX, AIX, and LINUX

gcore
The gcore command is used to manually generate a core dump. A core dump is a snapshot of the memory occupied by a process plus additional debugging information. Core files are typically generated when a process terminates unexpectedly. This article describes manually generating a core file from a running process
 
This command is available and usable only on Solaris and LINUX.
 
Solution
 
Both the gcore and pstack commands are typically used together in a troubleshooting procedure:
 

To get the pstack and gcore, here is the procedure:

1) Get the process ID of the suspect process:

# ps -eaf | grep -i  suspect_process

2) Use the process ID to generate the gcore:

# gcore <proc_id>
 
 
A file core.<proc_id> is generated in the current directory.


3) Now generate the pstack based on the generated gcore file:

# pstack core.<proc_id>

4) Now create a compressed tar ball with the gcore.xxx and output of the pstack command.

 




 
 

 

Was this content helpful?