Your message dated Mon, 9 Feb 2026 09:20:55 +0100
with message-id <[email protected]>
and subject line Re: Bug#1127408: pstree incorrectly displays and duplicates 
arguments for sh -c commands
has caused the Debian Bug report #1127408,
regarding pstree incorrectly displays and duplicates arguments for sh -c 
commands
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1127408: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1127408
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
On Mon, Feb 09, 2026 at 08:24:28AM +1100, Craig Small wrote:
The duplicates are what the kernel is reporting, the ^@ is nul which
separates command line options.
$ cat -e /proc/7393/cmdline
/bin/sh^@-c^@less -A -F -X^@less -A -F -X^@

So yes, I totally agree it looks strange, but the strangeness is actually
there!

I concur with that assessment, and it is actually git doubling this:

execve("/bin/sh", ["/bin/sh", "-c", "less +R +F -X", "less +R +F -X"]

Wondering whether that's a bug in git.

Greetings
Marc


--
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421

--- End Message ---

Reply via email to