RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1330965 - iotop causes python crash while using with pipe
Summary: iotop causes python crash while using with pipe
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: iotop
Version: 6.6
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Michal Hlavinka
QA Contact: Tereza Cerna
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-27 11:29 UTC by Manish Saxena
Modified: 2020-12-11 12:10 UTC (History)
5 users (show)

Fixed In Version: iotop-0.3.2-9.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-21 11:15:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
backported fix (681 bytes, patch)
2016-11-02 22:23 UTC, Michal Hlavinka
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0726 0 normal SHIPPED_LIVE iotop bug fix update 2017-03-21 12:43:00 UTC

Description Manish Saxena 2016-04-27 11:29:05 UTC
Description of problem:

[root@vm232 etc]# iotop -qqqb -n 1  | tail -5
 4603 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % console-kit-daemon --no-daemon
 4604 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % console-kit-daemon --no-daemon
 4605 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % console-kit-daemon --no-daemon
 4606 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % console-kit-daemon --no-daemon
 4607 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % console-kit-daemon --no-daemon
[root@vm232 etc]# iotop -qqqb -n 1  | head -5
 4608 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % console-kit-daemon --no-daemon
    1 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % init
    2 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kthreadd]
    3 rt/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [migration/0]
    4 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [ksoftirqd/0]
Traceback (most recent call last):
  File "/usr/sbin/iotop", line 16, in <module>
    main()
  File "/usr/lib/python2.6/site-packages/iotop/ui.py", line 559, in main
    main_loop()
  File "/usr/lib/python2.6/site-packages/iotop/ui.py", line 549, in <lambda>
    main_loop = lambda: run_iotop(options)
  File "/usr/lib/python2.6/site-packages/iotop/ui.py", line 445, in run_iotop
    return run_iotop_window(None, options)
  File "/usr/lib/python2.6/site-packages/iotop/ui.py", line 440, in run_iotop_window
    ui.run()
  File "/usr/lib/python2.6/site-packages/iotop/ui.py", line 120, in run
    self.process_list.duration)
  File "/usr/lib/python2.6/site-packages/iotop/ui.py", line 399, in refresh_display
    print l
IOError: [Errno 32] Broken pipe
[root@vm232 etc]# rpm -qa | grep iotop
iotop-0.3.2-7.el6.noarch
[root@vm232 etc]# 
[root@vm232 etc]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.7 (Santiago)
[root@vm232 etc]#

Version-Release number of selected component (if applicable):

iotop-0.3.2-7.el6.noarch

How reproducible:
Everytime

Steps to Reproduce:
# iotop -qqqb -n 1  | head -5  

Actual results:

Python traceback failed 

[root@vm232 etc]# iotop -qqqb -n 1  | head -5
 4608 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % console-kit-daemon --no-daemon
    1 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % init
    2 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kthreadd]
    3 rt/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [migration/0]
    4 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [ksoftirqd/0]
Traceback (most recent call last):
  File "/usr/sbin/iotop", line 16, in <module>
    main()
  File "/usr/lib/python2.6/site-packages/iotop/ui.py", line 559, in main
    main_loop()
  File "/usr/lib/python2.6/site-packages/iotop/ui.py", line 549, in <lambda>
    main_loop = lambda: run_iotop(options)
  File "/usr/lib/python2.6/site-packages/iotop/ui.py", line 445, in run_iotop
    return run_iotop_window(None, options)
  File "/usr/lib/python2.6/site-packages/iotop/ui.py", line 440, in run_iotop_window
    ui.run()
  File "/usr/lib/python2.6/site-packages/iotop/ui.py", line 120, in run
    self.process_list.duration)
  File "/usr/lib/python2.6/site-packages/iotop/ui.py", line 399, in refresh_display
    print l
IOError: [Errno 32] Broken pipe

Expected results:
There should be no crash

Additional info:

Comment 3 Manish Saxena 2016-09-02 05:55:34 UTC
Reopening as customer need to fixed in RHEL 6.9

Comment 7 Michal Hlavinka 2016-11-02 22:23:11 UTC
Created attachment 1216792 [details]
backported fix

Comment 9 Tereza Cerna 2016-11-08 09:41:49 UTC
============================
Verified in:
    iotop-0.3.2-9.el6.noarch
PASS
============================

# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.9 Beta (Santiago)

# rpm -q iotop
iotop-0.3.2-9.el6.noarch

# iotop -qqqb -n 1  | tail -5
 1478 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % mingetty /dev/tty5
 1479 be/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % udevd -d
 1480 be/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % udevd -d
  969 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % dhclient -H unused-4-151 -1 -q -cf /etc/dhcp/dhclient-eth0.conf -lf /var/lib/dhclient/dhclient-eth0.leases -pf /var/run/dhclient-eth0.pid eth0
 1482 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % mingetty /dev/tty6

# iotop -qqqb -n 1  | head -5
    1 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % init
    2 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kthreadd]
 1027 be/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % auditd
    4 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [ksoftirqd/0]
    5 rt/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [stopper/0]

============================
Reproduced in:
    iotop-0.3.2-7.el6.noarch
FAIL
============================

# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.7 (Santiago)

# rpm -q iotop
iotop-0.3.2-7.el6.noarch
 
# iotop -qqqb -n 1  | tail -5  
 1507 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % mingetty /dev/tty5
 1509 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % mingetty /dev/tty6
 1617 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % bash -l
 1001 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % dhclient -1 -q -cf /etc/dhcp/dhclient-eth0.conf -lf /var/lib/dhclient/dhclient-eth0.leases -pf /var/run/dhclient-eth0.pid eth0
 1520 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % sshd: root@pts/0
 
# iotop -qqqb -n 1  | head -5  
    1 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % init
    2 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kthreadd]
    3 rt/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [migration/0]
    4 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [ksoftirqd/0]
    5 rt/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [stopper/0]
Traceback (most recent call last):
  File "/usr/sbin/iotop", line 16, in <module>
    main()
  File "/usr/lib/python2.6/site-packages/iotop/ui.py", line 559, in main
    main_loop()
  File "/usr/lib/python2.6/site-packages/iotop/ui.py", line 549, in <lambda>
    main_loop = lambda: run_iotop(options)
  File "/usr/lib/python2.6/site-packages/iotop/ui.py", line 445, in run_iotop
    return run_iotop_window(None, options)
  File "/usr/lib/python2.6/site-packages/iotop/ui.py", line 440, in run_iotop_window
    ui.run()
  File "/usr/lib/python2.6/site-packages/iotop/ui.py", line 120, in run
    self.process_list.duration)
  File "/usr/lib/python2.6/site-packages/iotop/ui.py", line 400, in refresh_display
    sys.stdout.flush()
IOError: [Errno 32] Broken pipe

Comment 11 errata-xmlrpc 2017-03-21 11:15:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0726.html


Note You need to log in before you can comment on or make changes to this bug.