Package: psmisc
Version: 23.7-2
Severity: minor
File: /usr/bin/pstree

Thanks for providing pstree. I use it almost daily instead of having to 
remember the proper options for ps.

When using pstree -apl, shell commands invoked via sh -c have their 
arguments displayed incorrectly - they appear duplicated. Parenthetical 
formatting would help to distinguish them from process names.

This makes legitimate process trees appear broken and causes users to 
troubleshoot non-existent configuration issues.

Steps to Reproduce:

Start a process that uses sh -c to invoke a command with arguments, such 
as:

$ git log --max-count=1
(Git uses sh -c to invoke the pager)

Keep the pager open. Run pstree -apl in a different window and search 
for the git log process

The sh -c invocation should display arguments like this (suggested 
formatting):

|-bash,223670
|   `-git,229284 log --max-count=1
|       `-sh,229285 -c less -F -R -X
|           `-less,229286 -F -R -X

If the process replaces its name, parenthesis could/should be used.

Actual Output:
|-bash,223670
|   `-git,229284 log --max-count=1
|       `-sh,229285 -c less -F -R -X less -F -R -X
|           `-less,229286 -F -R -X

The command string less -F -R -X appears twice on the sh line

This creates confusion. It looks like something is misconfigured when 
it's actually normal

Running `ps` on the `less` process confirms only one instance exists 
with correct arguments:

$ ps 229286
   PID TTY      STAT   TIME COMMAND
229286 pts/10   S+     0:00 less -F -R -X

-- System Information:
Debian Release: forky/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'oldstable-security'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), 
(500, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.18.8+deb14-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages psmisc depends on:
ii  libc6      2.42-11+b1
ii  libtinfo6  6.6+20251231-1

psmisc recommends no packages.

psmisc suggests no packages.

-- no debconf information

Reply via email to