Skip Menu |
 

This queue is for tickets about the Proc-ProcessTable CPAN distribution.

Report information
The Basics
Id: 23792
Status: open
Priority: 0/
Queue: Proc-ProcessTable

People
Owner: Nobody in particular
Requestors: henry.gao [...] ubs.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: process CMD field truncate to 80 chars on Solaris
Download (untitled) / with headers
text/plain 262b
Looks like the proc::processTable Solaris implementation is the same as /usr/bin/ps - using psinfo->pr_psargs, which truncate CMD field to 80 chars. Is it possible to change it the same way as /usr/ucb/ps which uses /proc/<pid>/as? and doesn't have limitation
From: jloverso [...] mathworks.com
Download (untitled) / with headers
text/plain 1016b
On Tue Dec 05 02:16:31 2006, henry.gao@ubs.com wrote: Show quoted text
> Looks like the proc::processTable Solaris implementation is the same > as /usr/bin/ps - using psinfo->pr_psargs, which truncate CMD field to > 80 chars. Is it possible to change it the same way as /usr/ucb/ps > which uses /proc/<pid>/as? and doesn't have limitation
/usr/bin/ps and Proc::ProcessTable just read /proc, which gets all the data out of the kernel. The kernel on Solaris only stores the first 80 chars of the command line, so the whole command line is simply not available. What /usr/ucb/ps and (on 5.9 and later) pargs do to get the whole command line is to open up the address space of the process, grovel around for the pointer stored at argv, and then read that. It's a bit of ugly code, but it can be done -- but only for those processes that are running under the same uid as yourself. (/usr/ucb/ps used to be setuid root to allow it to show the whole command line of any process, but that changed in a security patch to Solaris 5.8)
From: jloverso [...] mathworks.com
Download (untitled) / with headers
text/plain 746b
In case anyone is interested, I've taken the OpenSolaris source for 'pargs' and stripped it down to just the command-line/argv reading code. My intention was to use this code to add full-command-line support for Proc::ProcessTable on solaris 5.8 (and later). I'm done the initial work in that I can simple a small app that read the command lines of other processes. What's left is for someone to use this to extend os/Solaris.c. I don't have time to work on this further, but if someone is interested, please contact me. Note: just like /usr/ucb/ps and 'pargs', this code runs unprivileged, so it only reads the command line for other processes running as the same uid as the inspecting process (or all processes if you are running as root)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.