Why does iotop cause python crash with error as "IOError [Errno 32] Broken pipe" ?
Issue
iotopis crashing while use withpipe
$ sudo iotop -qqqb -n 1 |head -2
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]
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
- However it works fine when use as below
[root@test 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
Environment
- Red Hat Enterprise Linux 6.6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
