Go to main content

Managing System Information, Processes, and Performance in Oracle® Solaris 11.4

Exit Print View

Updated: April 2019
 
 

Debugging a Process

The pargs command and the preap command improve process debugging. The pargs command prints the arguments and environment variables that are associated with a live process or core file. The preap command removes defunct (zombie) processes. A zombie process has not yet had its exit status claimed by its parent. These processes are generally harmless but can consume system resources if they are numerous. You can use the pargs and preap commands to examine any process that you have the privileges to examine. When you become an administrator, you can examine any process.

For information about using the preap command, see the preap(1) man page. For information about the using the pargs command, see the pargs(1) man page. Also, see the proc(1) man page.

Example 9  Debugging a Process (pargs)

The pargs command is unable to display all the arguments that are passed to a process with the ps command. The following example shows how to use the pargs command in combination with the pgrep command to display all the arguments that are passed to a process.

# pargs `pgrep ttymon`
579:	/usr/lib/saf/ttymon -g -h -p system-name console login:  
-T sun -d /dev/console -l 
argv[0]: /usr/lib/saf/ttymon
argv[1]: -g
argv[2]: -h
argv[3]: -p
argv[4]: system-name console login: 
argv[5]: -T
argv[6]: sun
argv[7]: -d
argv[8]: /dev/console
argv[9]: -l
argv[10]: console
argv[11]: -m
argv[12]: ldterm,ttcompat
548:	/usr/lib/saf/ttymon
argv[0]: /usr/lib/saf/ttymon

The following example shows how to use the pargs –e command to display the environment variables that are associated with a process.

$ pargs -e 6763
6763: tcsh
envp[0]: DISPLAY=:0.0