Bug 14251 - ps output broken with 6 digit pids
Summary: ps output broken with 6 digit pids
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.30.x
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-30 20:32 UTC by Matt
Modified: 2021-10-07 16:38 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt 2021-09-30 20:32:53 UTC
Overview: The output of busybox ps omits whitespace between the pid and username for processes with 6 digit pids only.

Steps to reproduce: Run busybox ps on a system with pids >99999, such as debian bullseye.

Actual results:

# busybox ps
4255 mrc      /bin/bash
18577 root     {cron} /usr/sbin/CRON -f
60890 mrc      tr -d %
103236root     {cron} /usr/sbin/CRON -f
600177mrc      /bin/bash
1456558 mrc      /bin/bash

Expected results: One or more whitespace characters after the pid and before the username.
Comment 1 Denys Vlasenko 2021-10-07 15:26:19 UTC
What version this is?

commit 3106784e654e7443ab724d927f9de0230adbe5ac
Date:   Fri May 3 09:49:56 2019 +0200

    ps: ensure fields are separated by at least one space, closes 11826
Comment 2 Matt 2021-10-07 16:38:06 UTC
The version in debian bullseye is 1.30.1.  A bit surprising that the version wasn't bumped between buster and bullseye.  I think buster had a lower max pid so maybe this issue wasn't apparent on that version.  In any case, looks like the bug has been fixed, thanks.