I can confirm this bug. Here are the steps to reproduce it:
# lxc launch images:ubuntu/focal iotop-bug1932523
# lxc shell iotop-bug1932523
$ apt update && apt install -y iotop gcc
$ echo -e '#include <unistd.h>\nint main(){sleep(1000);return 0;}' | gcc -x c -o 'Инстанц�' -
$ ./Инстанц�
## <Type Control-Z here to put the program in the backgroun>
$ iotop
Traceback (most recent call last):
File "/usr/sbin/iotop", line 17, in <module>
main()
File "/usr/lib/python3/dist-packages/iotop/ui.py", line 737, in main
main_loop()
File "/usr/lib/python3/dist-packages/iotop/ui.py", line 727, in <lambda>
main_loop = lambda: run_iotop(options)
File "/usr/lib/python3/dist-packages/iotop/ui.py", line 620, in run_iotop
return curses.wrapper(run_iotop_window, options)
File "/usr/lib/python3.8/curses/__init__.py", line 105, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/lib/python3/dist-packages/iotop/ui.py", line 612, in run_iotop_window
ui.run()
File "/usr/lib/python3/dist-packages/iotop/ui.py", line 188, in run
self.refresh_display(iterations == 0, total, current,
File "/usr/lib/python3/dist-packages/iotop/ui.py", line 476, in refresh_display
lines = self.get_data()
File "/usr/lib/python3/dist-packages/iotop/ui.py", line 457, in get_data
return list(map(format, processes))
File "/usr/lib/python3/dist-packages/iotop/ui.py", line 432, in format
cmdline = p.get_cmdline()
File "/usr/lib/python3/dist-packages/iotop/data.py", line 308, in get_cmdline
proc_status = parse_proc_pid_status(self.pid)
File "/usr/lib/python3/dist-packages/iotop/data.py", line 210, in parse_proc_pid_status
for line in open('/proc/%d/status' % pid):
File "/usr/lib/python3.8/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 20: invalid continuation byte
I was able to verify that this bug still happens on impish, using a recent version of iotop (0.6-24-g733f3f8-1.1).
@Mingun, I think the best course of action for this bug is to contact upstream and suggest the patch to them first. Woud you be willing to do that, please?
Thank you for your bug report.
I can confirm this bug. Here are the steps to reproduce it:
# lxc launch images:ubuntu/focal iotop-bug1932523 sleep(1000) ;return 0;}' | gcc -x c -o 'Инстанц�' - python3/ dist-packages/ iotop/ui. py", line 737, in main python3/ dist-packages/ iotop/ui. py", line 727, in <lambda> python3/ dist-packages/ iotop/ui. py", line 620, in run_iotop wrapper( run_iotop_ window, options) python3. 8/curses/ __init_ _.py", line 105, in wrapper python3/ dist-packages/ iotop/ui. py", line 612, in run_iotop_window python3/ dist-packages/ iotop/ui. py", line 188, in run refresh_ display( iterations == 0, total, current, python3/ dist-packages/ iotop/ui. py", line 476, in refresh_display python3/ dist-packages/ iotop/ui. py", line 457, in get_data python3/ dist-packages/ iotop/ui. py", line 432, in format python3/ dist-packages/ iotop/data. py", line 308, in get_cmdline pid_status( self.pid) python3/ dist-packages/ iotop/data. py", line 210, in parse_proc_ pid_status proc/%d/ status' % pid): python3. 8/codecs. py", line 322, in decode decode( data, self.errors, final)
# lxc shell iotop-bug1932523
$ apt update && apt install -y iotop gcc
$ echo -e '#include <unistd.h>\nint main(){
$ ./Инстанц�
## <Type Control-Z here to put the program in the backgroun>
$ iotop
Traceback (most recent call last):
File "/usr/sbin/iotop", line 17, in <module>
main()
File "/usr/lib/
main_loop()
File "/usr/lib/
main_loop = lambda: run_iotop(options)
File "/usr/lib/
return curses.
File "/usr/lib/
return func(stdscr, *args, **kwds)
File "/usr/lib/
ui.run()
File "/usr/lib/
self.
File "/usr/lib/
lines = self.get_data()
File "/usr/lib/
return list(map(format, processes))
File "/usr/lib/
cmdline = p.get_cmdline()
File "/usr/lib/
proc_status = parse_proc_
File "/usr/lib/
for line in open('/
File "/usr/lib/
(result, consumed) = self._buffer_
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 20: invalid continuation byte
I was able to verify that this bug still happens on impish, using a recent version of iotop (0.6-24- g733f3f8- 1.1).
@Mingun, I think the best course of action for this bug is to contact upstream and suggest the patch to them first. Woud you be willing to do that, please?
Thank you.