[Bug 1932523] Re: iotop can raise UnicodeDecodeError because /proc/pid/status can have non-utf-8 data in Name
** Changed in: iotop (Debian) Status: Unknown => Confirmed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1932523 Title: iotop can raise UnicodeDecodeError because /proc/pid/status can have non-utf-8 data in Name To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/iotop/+bug/1932523/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1932523] Re: iotop can raise UnicodeDecodeError because /proc/pid/status can have non-utf-8 data in Name
Thanks, I have forward-ported the patch, added a commit message and pushed the patch upstream: https://repo.or.cz/iotop.git/commit/443737ec620a699286b9b2e44dbcaac53f553812 At some point in the next few weeks I'll make a new release, upload it to Debian and get it synced to Ubuntu. Since the patch is only a workaround, it would be good to have a proper fix; guess the encoding using chardet or similar and coerce the bytes into Unicode. Any help with that is welcome. status fixcommitted ** Bug watch added: Debian Bug tracker #737043 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737043 ** Also affects: iotop (Debian) via https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737043 Importance: Unknown Status: Unknown -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1932523 Title: iotop can raise UnicodeDecodeError because /proc/pid/status can have non-utf-8 data in Name To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/iotop/+bug/1932523/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1932523] Re: iotop can raise UnicodeDecodeError because /proc/pid/status can have non-utf-8 data in Name
Hi Paul, You can write any commit message that you find appropriate, I'm not familiar with common practices in the project and probably my English not so good. You also can made that commit without my attribution: this change is so simple that anyone can made it. I do not want to put progress of fixing bugs to the bureaucracy. But if you wish, you can use the following attributes: name: Yanichkin Alexander email: alexander_ser...@mail.ru -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1932523 Title: iotop can raise UnicodeDecodeError because /proc/pid/status can have non-utf-8 data in Name To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/iotop/+bug/1932523/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1932523] Re: iotop can raise UnicodeDecodeError because /proc/pid/status can have non-utf-8 data in Name
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 # lxc shell iotop-bug1932523 $ apt update && apt install -y iotop gcc $ echo -e '#include \nint main(){sleep(1000);return 0;}' | gcc -x c -o 'Инстанц�' - $ ./Инстанц� ## $ iotop Traceback (most recent call last): File "/usr/sbin/iotop", line 17, in 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 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. ** Changed in: iotop (Ubuntu) Status: New => Triaged ** Changed in: iotop (Ubuntu) Importance: Undecided => Medium -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1932523 Title: iotop can raise UnicodeDecodeError because /proc/pid/status can have non-utf-8 data in Name To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/iotop/+bug/1932523/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1932523] Re: iotop can raise UnicodeDecodeError because /proc/pid/status can have non-utf-8 data in Name
The attachment "fix-iotop-encoding-errors.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team. [This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.] ** Tags added: patch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1932523 Title: iotop can raise UnicodeDecodeError because /proc/pid/status can have non-utf-8 data in Name To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/iotop/+bug/1932523/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs