btop icon indicating copy to clipboard operation
btop copied to clipboard

[BUG] Commands from proc section showing in the wrong position

Open jaskij opened this issue 2 years ago • 3 comments

Describe the bug

I believe this is caused by the command itself containing a newline or something like that. You can see the two lines in the process section missing commands entirely.

This commands are ran inside an LXC container.

To Reproduce

I can describe my setup, but do not know which steps are crucial to reproduce. This stopped some time into the build though.

  • host is Arch
  • btop installed via the official package
  • an LXC container with images:debian/bullseye
  • running a Yocto build inside

Expected behavior

Commands properly showing in the process list.

Screenshots

image

Info (please complete the following information):

  • btop++ version: 1.2.6
  • Binary: from Arch repos
  • Architecture: x86_64
  • Platform: Linux
  • (Linux) Kernel: 5.15.41-1-lts
  • Terminal used: Terminator
  • Font used: JetBrainsMono Nerd Font Regular

Additional context

$ cat btop.log 

2022/05/26 (20:31:21) | ===> btop++ v.1.2.6
2022/05/26 (20:31:21) | DEBUG: Starting in DEBUG mode!
2022/05/26 (20:31:21) | INFO: Logger set to DEBUG
2022/05/26 (20:31:21) | DEBUG: Setting LC_ALL=en_US.utf8
2022/05/26 (20:31:21) | INFO: Running on /dev/pts/4

GDB Backtrace

n/a

jaskij avatar May 26 '22 18:05 jaskij

@jaskij Can't reproduce this with newlines or escape characters: image

Any special characters looks to be already "unescaped" in /proc/[pid]/cmdline where the process command line is collected from.

So that shouldn't be the issue.

Can you try catching the output of /proc/[pid]/cmdline of that sh process when it's running?

aristocratos avatar May 26 '22 20:05 aristocratos

I will try, although it was quite ephemeral. Might be it was simply very long, but you probably handle that already. Maybe \t?

I'll try tomorrow.

jaskij avatar May 26 '22 20:05 jaskij