#1057714 htop: newlines in cmdline rendered as U+FFFD

Package:
htop
Source:
htop
Description:
interactive processes viewer
Submitter:
наб
Date:
2024-04-25 17:57:12 UTC
Severity:
normal
Tags:
#1057714#5
Date:
2023-12-07 13:40:36 UTC
From:
To:
Dear Maintainer,

From my palmtop rn:
  └─ /bin/sh -c make -C /lib/modules/6.5.0-5-amd64/build CC=gcc-13 \ �  \ �M="$PWD"  O=/lib/modules/6.5.0-5-amd64/build CONFIG_ZFS=m modules

and
-- >8 --
$ cat /proc/59470/cmdline
/bin/sh-cmake -C /lib/modules/6.5.0-5-amd64/build CC=gcc-13 \
          \
        M="$PWD"  O=/lib/modules/6.5.0-5-amd64/build CONFIG_ZFS=m modules

$ hd /proc/59470/cmdline
00000000  2f 62 69 6e 2f 73 68 00  2d 63 00 6d 61 6b 65 20  |/bin/sh.-c.make |
00000010  2d 43 20 2f 6c 69 62 2f  6d 6f 64 75 6c 65 73 2f  |-C /lib/modules/|
00000020  36 2e 35 2e 30 2d 35 2d  61 6d 64 36 34 2f 62 75  |6.5.0-5-amd64/bu|
00000030  69 6c 64 20 43 43 3d 67  63 63 2d 31 33 20 5c 0a  |ild CC=gcc-13 \.|
00000040  09 20 20 5c 0a 09 4d 3d  22 24 50 57 44 22 20 20  |.  \..M="$PWD"  |
00000050  4f 3d 2f 6c 69 62 2f 6d  6f 64 75 6c 65 73 2f 36  |O=/lib/modules/6|
00000060  2e 35 2e 30 2d 35 2d 61  6d 64 36 34 2f 62 75 69  |.5.0-5-amd64/bui|
00000070  6c 64 20 43 4f 4e 46 49  47 5f 5a 46 53 3d 6d 20  |ld CONFIG_ZFS=m |
00000080  6d 6f 64 75 6c 65 73 00                           |modules.|
00000088
-- >8 --

These are 0A, so newlines.
These should get transliterated to spaces for display, just like the NULs.

Best,
наб

#1057714#10
Date:
2023-12-07 20:05:33 UTC
From:
To:
Oddly, I cannot reproduce this on bookworm (htop 3.2.2-2 as well)
by running the same cmdline (
-- >8 --
sh -c 'make -C /lib/modules/6.5.0-5-amd64/build CC=gcc-13 \
          \
        M="$PWD"  O=/lib/modules/6.5.0-5-amd64/build CONFIG_ZFS=m modules; sleep 100'
-- >8 --
) explicitly.

#1057714#15
Date:
2023-12-13 10:51:16 UTC
From:
To:
You found two issues here, which we track upstream as

https://github.com/htop-dev/htop/issues/1345 and
https://github.com/htop-dev/htop/issues/1346

Thank you very much for submitting your bug report.

/DLange