[Bash-completion-devel] Bug#497540: procfs stores process name in a truncated form in /proc/<pid>/stat

David Paleino d.paleino at gmail.com
Thu Jan 29 10:32:48 UTC 2009


clone 497540 -1
reassign -1 src:linux-2.6
retitle -1 "procfs stores process name in a truncated form in /proc/<pid>/stat"
thanks

On Thu, 22 Jan 2009 00:13:39 +0200, Yanko Kaneti wrote:

> It would be nice if this worked but current release of procps trim the
> command name to 15 even if the ps comm  column is specified with
> additional width.  And these days there are many commands with names
> longer than 15  e.g. gnome-blah-blah..

Hello,
while fixing #497540 we stumbled upon a bug in procps. Trying to fix completion
for "killall", we wanted to use "ps axo comm" instead of "ps axo command", but
that truncates process names at 15 characters. It could've been a procps bug,
but the truncated form is really stored in /proc/<pid>/stat:

# cat /proc/12571/stat
12571 (hald-addon-stor) S 12519 12518 12518 0 -1 4194304 347 0 0 0 4 0 0 0 20 0
1 0 520073 3391488 260 4294967295 134512640 134528780 3220600864 3220600436
3084521718 0 0 4097 0 0 0 0 17 0 0 0 0 0 0
#

(that should've really been "hald-addon-storage")

This obviously breaks a number of applications depending on procfs to get the
process name.

Is there a reason for this 15-characters-limitation?

Kindly,
David

-- 
 . ''`.  Debian maintainer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://snipr.com/qa_page
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20090129/a5dea1e3/attachment-0001.pgp 


More information about the Bash-completion-devel mailing list