Projects
Eulaceura:Mainline
iotop
_service:obs_scm:0004-Ignore-invalid-lines-in-p...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0004-Ignore-invalid-lines-in-proc-status-files.patch of Package iotop
From bd9396b2003a57077d2e7ca0b4b510537a24075c Mon Sep 17 00:00:00 2001 From: Paul Wise <pabs3@bonedaddy.net> Date: Fri, 25 May 2018 15:13:26 +0800 Subject: [PATCH 04/11] Ignore invalid lines in /proc/*/status files One Ubuntu Linux kernel security fix introduced a blank line. Some other Linux kernels may have invalid lines in the future. See-also: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1772671 Fixes: https://bugs.launchpad.net/ubuntu/+source/iotop/+bug/1772856 Reported-by: Paul Jaros <jaros.paul@gmail.com> Reported-in: <CAEh_nc0_DXTmfu16PxmVyrCi6QQeSrpnGGhtfNu60wJYfa_6Zw@mail.gmail.com> Traceback (most recent call last): File "/usr/sbin/iotop", line 17, in <module> main() File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 620, in main main_loop() File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 610, in <lambda> main_loop = lambda: run_iotop(options) File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 508, in run_iotop return curses.wrapper(run_iotop_window, options) File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper return func(stdscr, *args, **kwds) File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 501, in run_iotop_window ui.run() File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 155, in run self.process_list.duration) File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 434, in refresh_display lines = self.get_data() File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 415, in get_data return list(map(format, processes)) File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 388, in format cmdline = p.get_cmdline() File "/usr/lib/python2.7/dist-packages/iotop/data.py", line 292, in get_cmdline proc_status = parse_proc_pid_status(self.pid) File "/usr/lib/python2.7/dist-packages/iotop/data.py", line 196, in parse_proc_pid_status key, value = line.split(':\t', 1) ValueError: need more than 1 value to unpack --- iotop/data.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/iotop/data.py b/iotop/data.py index bf2e7b5..62626c3 100644 --- a/iotop/data.py +++ b/iotop/data.py @@ -193,7 +193,13 @@ def parse_proc_pid_status(pid): result_dict = {} try: for line in open('/proc/%d/status' % pid): - key, value = line.split(':', 1) + try: + key, value = line.split(':', 1) + except ValueError: + # Ignore lines that are not formatted correctly as + # some downstream kernels may have weird lines and + # the needed fields are probably formatted correctly. + pass result_dict[key] = value.strip() except IOError: pass # No such process -- 1.8.3.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2