<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Hi,<o:p></o:p></p><p class=MsoNormal>     I am observing a deadlock with llvm-lit on windows 7.<o:p></o:p></p><p class=MsoNormal>When I attached a debugger, the communicate() call is blocked.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>In file utils/lit/lit/TestRunner.py<o:p></o:p></p><p class=MsoNormal>>    # FIXME: There is probably still deadlock potential here. Yawn.<o:p></o:p></p><p class=MsoNormal>>   procData = [None] * len(procs)<o:p></o:p></p><p class=MsoNormal>>    procData[-1] = procs[-1].communicate()<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I am invoking python directly on windows to run the unit tests. <o:p></o:p></p><p class=MsoNormal>C:\Python27\python.exe C:\build\llvm\Release\bin\llvm-lit.py -v -j 12 --param build_mode=Release --param build_config=Win32 llvm_site_config=C:\llvm_on_win\nightly\build\llvm\tools\polly\test\lit.site.cfg test<o:p></o:p></p><p class=MsoNormal>Note: If I invoke with “-j 1” , the unit tests finish but took a lot of time. There is no deadlock. I am using python version 2.7.6.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>At this moment, I believe the issue is caused by stdout filling the OS buffer there by blocking the communicate() call.<o:p></o:p></p><p class=MsoNormal>It is possible some of the unit tests dump a lot of text/data to stdout. FYI, I have a couple of unit tests of my own in the code base.<o:p></o:p></p><p class=MsoNormal>On Linux, there is no deadlock but on windows I am hitting a deadlock 7 out of 10 times. I tried invoking python with “-u” but in vain.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>When I looked at llvm-lit code, I saw the code to avoid deadlocks but there was no guarantee, like the one I pasted above.<o:p></o:p></p><p class=MsoNormal>Would appreciate if some one take a look at it and provide more context on deadlocks.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>--Sumanth G<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>