Red Hat Bugzilla – Bug 480582
cdrom/dvd test hangs (using hts-5.3-12 in rhel4 i386 and hts-5.3-14 in x86_64)
Last modified: 2014-03-25 20:56:08 EDT
Description of problem:
when tried to run the cdrom test suite,the progress of running cdrom.py hang,and will not work again
Version-Release number of selected component (if applicable):
linux-2.6.9-78.12.ELsmp i386 rhel4 U8
Steps to Reproduce:
1.hts plan -t cdrom -e
2.hts run -t cdrom
3.wait for the running process
the process of running cdrom.py hang,and will not work again
the process could run till the return result of code=0
please attach /var/hts/results.xml
Created attachment 329419 [details]
the result.xml file
Also found this bug in rhel4.8 AS x86_64 system with hts-5.3-14.
Created attachment 329681 [details]
/var/hts/results.xml for x86_64
the reason this test hangs is because the following statement(in the opticalDiskTest.py file) hangs while trying to find all the UDIs on RHEL4:
udiList = lshalCommand.getStringList(regex="udi = \'(?<udi>[^\']+)\'", regexGroup="udi")
what I find out is: not only the ".getStringList()" hangs here, but following methods also will hang:
udiList = lshalCommand.run()
udiList = lshalCommand.echo()
I think the key issue is the "lshalCommand". the command to run here is "lshal", it has huge amount of outputs on stdout. I tried to replace "lshal" with another command --> "tree /proc", which also has huge outputs on stdout, the ".getStringList()" and ".run()" and ".echo()" also hung. But if I replace "lshal" with "lshal > /tmp/lshal.log" , which has no output on stdout, the ".echo()" no longer hangs, it returns with an error message telling me the command has output on stderr.
the simple steps to re-produce this error are:
1) # cd /usr/share/hts/lib/hts/
2) # python
3) >>> from command import Command, HTSCommandException
4) >>> lshalCommand = Command("lshal")
5) >>> udiList = lshalCommand.echo()
Guess this should be a general issue ? maybe about the buffer ?
the old cdrom test won't have this issue on RHEL4, because it uses another way to find all the UDIs:
lshalOutput = commands.getoutput("lshal | grep 'udi =' | sed /info.udi/d | colrm 1 6")
*** Bug 480583 has been marked as a duplicate of this bug. ***
Created attachment 329731 [details]
command.py patch changing to read pipe before waiting
This patch changes the command class to call readlines before calling wait on the pipe to prevent a process/subprocess deadlock.
Please try the command.py patch to see if it eliminates the hang.
Created attachment 329763 [details]
command.py patch - revised error handling
Created attachment 329766 [details]
opticalDiskTest.py patch for RHEL4-specific issues
This patch to opticalDiskTest (used by cdrom and dvd tests) fixes issues arising on RHEL4 related to reduced HAL services and use of Kudzu.
Created attachment 329767 [details]
htskudzu.py patch for accessing kudzu-discovered devices by UDI
Verified both cdrom and dvd test passed in hts-5.3.15.el4.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.