[Bug 1874824] Re: pgrep reports error "cannot allocate" when run without stack limit

Ubuntu Foundations Team Bug Bot 1874824 at bugs.launchpad.net
Wed Mar 24 20:31:51 UTC 2021


The attachment "Hirsute debdiff" seems to be a debdiff.  The ubuntu-
sponsors team has been subscribed to the bug report so that they can
review and hopefully sponsor the debdiff.  If the attachment isn't a
patch, please remove the "patch" flag from the attachment, remove the
"patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe
the team.

[This is an automated message performed by a Launchpad user owned by
~brian-murray, for any issue please contact him.]

-- 
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1874824

Title:
  pgrep reports error "cannot allocate" when run without stack limit

Status in procps package in Ubuntu:
  Fix Committed
Status in procps source package in Focal:
  In Progress
Status in procps source package in Groovy:
  In Progress
Status in procps source package in Hirsute:
  Fix Committed
Status in procps package in Debian:
  New

Bug description:
  [Impact]

    - Users who have ulimit set high would see either slow
      or failed pgrep and pkill commands
    - Users who have ulimit set to unlimited would see
      failed pgrep and pkill commands
    - This bug occurs because the behavior of sysconf(_SC_ARG_MAX)
      changed with a newer version of the kernel.

  [Test Case]

    - set the ulimit to unlimited by running `ulimit -S -s unlimited`
    - run `pgrep bash` to see that the "cannot allocate" error is
       printed and the command has failed.

  [Where Problems Could Occur]

    - We have set upper and lower limits on the size of the malloc, but
      if further kernel versions break the call to sysconf in
      unexpected ways we could still see problems.

  [Original Description]

  If you have no stack limit (ulimit -S -s unlimited), any pgrep call
  will fail with an error:

  > pgrep vim
  pgrep: cannot allocate 4611686018427387903 bytes

  If you have a high stack limit (e.g. ulimit -S -s 500000), pgrep is
  very slow:

  > time pgrep vim
  2196
  real 8.48s user 8.40s syst 0.07s busy 99% rmem 253444

  The relevant upstream bug report could be: https://gitlab.com/procps-ng/procps/-/issues/152
  Archlinux bug report: https://bugs.archlinux.org/task/66093

  procps:
    Installed: 2:3.3.16-1ubuntu2
    500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

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



More information about the Ubuntu-sponsors mailing list