FS#66093 - [procps-ng] Running pgrep fails

Attached to Project: Arch Linux
Opened by Benoit Pierre (bpierre) - Friday, 03 April 2020, 04:22 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Friday, 22 May 2020, 12:42 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Bartłomiej Piotrowski (Barthalion)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:

pgrep fails when not executed as root:

> pgrep something
pgrep: cannot allocate 4611686018427387903 bytes

Additional info:
* package version(s): procps-ng 3.3.16-1
* link to upstream bug report: this is fixed in procps' master https://gitlab.com/procps-ng/procps/-/commit/bb96fc42956c9ed926a1b958ab715f8b4a663dec

Steps to reproduce:

Run pgrep as a non-root user.
This task depends upon

Closed by  Bartłomiej Piotrowski (Barthalion)
Friday, 22 May 2020, 12:42 GMT
Reason for closing:  Fixed
Additional comments about closing:  procps-ng 3.3.16-2
Comment by Jonas Witschel (diabonas) - Friday, 03 April 2020, 09:56 GMT
Note that this doesn't happen in a default installation since the stack size is low enough (2 MB) by default, see the pthread_create man page (http://man7.org/linux/man-pages/man3/pthread_create.3.html). To reproduce, you temporarily need to lift this limit for your shell session by running "ulimit -s ulimited".
Comment by Sven (sve) - Sunday, 26 April 2020, 13:49 GMT
Any project that relies on pgrep or pkill is heavily affected. Note that even if you have a ulimit -s, the bug slows down pgrep. This slowdown is linear in the stack size. E.g. on an older PC, any simple pgrep call takes 30 sec if your stack is 500000, and 60 sec if it is 1000000!

Loading...