[Bugme-new] [Bug 11764] New: prctl(PR_SET_NAME, ...) only sets 15 characters of name

bugme-daemon at bugzilla.kernel.org bugme-daemon at bugzilla.kernel.org
Tue Oct 14 22:28:42 PDT 2008


http://bugzilla.kernel.org/show_bug.cgi?id=11764

           Summary: prctl(PR_SET_NAME, ...) only sets 15 characters of name
           Product: Other
           Version: 2.5
     KernelVersion: 2.6.27
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Other
        AssignedTo: other_other at kernel-bugs.osdl.org
        ReportedBy: mike at trausch.us


Unknown whether this bug is long-term (since 2.6.9, which is when I think this
functionality was introduced) or if it is relatively recent.

When setting a process name using prctl(PR_SET_NAME, ...), only the first
fifteen characters of the supplied process name are retrievable.  It will set
the full process name, so prctl(PR_SET_NAME, "VeryLongProcessName", NULL, NULL,
NULL) will set it, and "killall VeryLongProcessName" will work from the
terminal, but /proc/<pid>/status (and prctl(PR_GET_NAME, pointer, NULL, NULL,
NULL), too) will only return the first 15 characters of the process name that
was set.

Am attaching a small C program to demonstrate this.  Example output of the
program:

Wednesday, 2008-Oct-15 at 01:26:30 - mbt at zest - Linux v2.6.27
Ubuntu Intrepid:[1-103/5664-0]:test> ./prctl ShortName          
Current process name:                            prctl
Setting process name:                        ShortName
New process name:                            ShortName

Wednesday, 2008-Oct-15 at 01:28:25 - mbt at zest - Linux v2.6.27
Ubuntu Intrepid:[1-104/5665-0]:test> ./prctl VeryLongProcessName
Current process name:                            prctl
Setting process name:              VeryLongProcessName
New process name:                      VeryLongProcess


-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


More information about the Bugme-new mailing list