The '-a' flag[0] which should list the full cmd line seems to be limited
to 4096 chars[1].

In most case it is more than enough, but not always the case for java
processes with long classpaths for instance as describe in the bug
description.

[0] -a, --list-full
              List the full command line as well as the process ID. (pgrep 
only.)

[1] pgrep.c
     44
     45 #define CMDSTRSIZE 4096
     46

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to procps in Ubuntu.
https://bugs.launchpad.net/bugs/1839329

Title:
  pgrep: Use POSIX _SC_ARG_MAX for maximum pgrep -f command line length

Status in procps package in Ubuntu:
  In Progress
Status in procps source package in Xenial:
  New
Status in procps source package in Bionic:
  New
Status in procps source package in Disco:
  New

Bug description:
  [Impact]
  The pgrep -f and pkill -f commands are unable to find processes strings in 
processes which are beyond the 4096th character. This often happens with Java 
command lines with long classpaths on the command line.

  [Test Case]
  A quick test to reproduce this is to vi a file using a filename over 4k (e.g. 
vi $(seq 1 1250| paste -s -d'_')_foo.txt) and leave vi running; then try 
running pgrep -af 'foo.txt' to find it.

  [Potential Regression[

  [Other Infos]
  This bug is a mirror of what has already been reported in GitLab, through the 
merge request #85 [1], and has been previously reported at the merge request 
#80 [2], with no response/reply.

  Let me know if further information is needed, at this point, to
  proceed.  Thanks!

  [1] https://gitlab.com/procps-ng/procps/merge_requests/85
  [2] https://gitlab.com/procps-ng/procps/merge_requests/80

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/procps/+bug/1839329/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to