Skip to content

Regression: rewritten program name gets truncated if it contains a ‘/’ #1817

@edgar-bonet

Description

@edgar-bonet

Some programs rewrite their command line, adding slashes that can confuse htop. Older versions of htop, however, dealt with this gracefully. For example, here is an SSH server and its descendants, on Debian trixie, as shown by htop 3.3.0, with the option “Show program path” unchecked:

└─ sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
   └─ sshd-session: debian [priv]
      └─ sshd-session: debian@pts/0
         └─ -bash
            └─ tmux

In contrast, both htop 3.4.0 and the current main show:

└─ sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
   └─ sshd-session: debian [priv]
      └─ 0
         └─ -bash
            └─ tmux

Notice the process in the middle of the list, which was displayed as sshd-session: debian@pts/0 and is now displayed as 0. FWIW, the corresponding file /proc/$pid/cmdline contains "sshd-session: debian@pts/0\0\0\0\0\0\0\0\0\0\0".

The same issue affects a PHP process:

  • htop 3.3.0: php-fpm: master process (/etc/php/8.4/fpm/php-fpm.conf)
  • htop 3.4.0: php-fpm.conf)

I git-bisected the issue to commit 1f664ee.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions