severity 588249 wishlist thanks Hi
On Tue, Jul 06, 2010 at 03:41:18PM +0200, J G Miller wrote: > Package: libproc-processtable-perl > Version: 0.45-1 > Severity: normal > > Whilst setting up mon (monitoring system) with the ps.monitor script > which uses Proc::ProcessTable to get a list of the processes on the > system, I discovered that processes with very long names are being > truncated, thus causing a false alert in mon. > > Debugging the relevant part of the ps.monitor script -- > > use Proc::ProcessTable; > > my $process_table = new Proc::ProcessTable('cache_ttys' => 0 ); > > foreach $process ( @{$process_table->table} ) > { > printf ("Examining ->%s<-\n", $process->cmndline); > printf ("+++ Checking if ->%s<- is required\n\n", $process->fname); > } > > reveals that process name in fname is truncated at 15 characters > > Examining ->transmission-daemon<- > +++ Checking if ->transmission-da<- is required > > Thus it is evident that the width of fname should be increased > from 16 to 24 if possible. > > Obviously in its current form, checking of process names greater > than 15 characters will lead to false alarms in mon, and problems > in other packages which use this functionality. I think this is indeed not possible, but a comment from someone else is appreciated to confirm that in case: This seems to be a limitiation in linux itself, first in os/Linux.c we have: /* scan in pid, and the command, in linux the command is a max of 15 chars * plus a terminating NULL byte; prs->comm will be NULL terminated since * that area of memory is all zerored out when prs is allocated */ if (sscanf(stat_text, "%d (%15c", &prs->pid, prs->comm) != 2) goto done; In the Linux kernel itself, we have include/linux/elfcore.h: char pr_fname[16]; /* filename of executable */ So probably there is no work around this if you use fname. So as it is not really caused by fname in Proc::ProcessTable I think this is more like a wishlist, as it is by 'limitation' in the linux kernel. Comments? Bests Salvatore
signature.asc
Description: Digital signature