<div dir="ltr">On Fri, Jun 26, 2015 at 1:57 PM, Daniel Dunbar <span dir="ltr"><<a href="mailto:daniel@zuster.org" target="_blank">daniel@zuster.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi Jonathan,<div><br></div><div>When I try your patch on OS X, the test suite just hangs. Unfortunately I don't have much time to investigate...</div></div></blockquote><div><br></div><div>I investigate a little bit, and I believe what happens is that executeCommand() is hanging in p.communicate(), because the file descriptors haven't necessarily been closed. It did look like I could fix this by explicitly forcing a close on the file descriptors in _safely_kill(), e.g.:</div><div>                os.close(popen.stdout.fileno())</div><div>                os.close(popen.stderr.fileno())</div><div>but I'm not confident that is reliable.</div><div><br></div><div>Getting the kind of behavior right is tricky,  esp.  while trying to be cross platform, and getting it right in Python where it isn't obvious what layers like subprocess() are doing makes me nervous. Also, I know there are some gotchas here on Windows that I would want to know are covered. Do you have access to all three major platforms to test this logic on?</div><div><br></div><div>Also, note that kill() will deadlock if it is ever called since both it and _handler() try to take the lock. In this example, it means that if I Ctrl-C lit after it hangs in the above then it will deadlock in the context manager __exit__ function.<br></div><div><br></div><div> - Daniel</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><span class=""><font color="#888888"><div><br></div><div> - Daniel</div><div><br></div></font></span></div><div class=""><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 4, 2015 at 11:33 AM, Jonathan Roelofs <span dir="ltr"><<a href="mailto:jonathan@codesourcery.com" target="_blank">jonathan@codesourcery.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Addressed the bug @ericwf pointed out.<br>
<div><div><br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D6584&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=HFfSUJsiJO94yYlJWYBDU4D0B4wXsFdYrhArjBp_FAE&s=kWIKcHBH0T2mnvQ-hsp7bCpx1LrnoCt7RwlpRRizjJo&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D6584</a><br>
<br>
Files:<br>
  utils/lit/lit/LitConfig.py<br>
  utils/lit/lit/TestRunner.py<br>
  utils/lit/lit/formats/base.py<br>
  utils/lit/lit/main.py<br>
  utils/lit/lit/util.py<br>
  utils/lit/tests/Inputs/timeout/infloop.py<br>
  utils/lit/tests/Inputs/timeout/lit.cfg<br>
  utils/lit/tests/Inputs/timeout/short.py<br>
  utils/lit/tests/timeout.py<br>
<br>
EMAIL PREFERENCES<br>
  <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_settings_panel_emailpreferences_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=HFfSUJsiJO94yYlJWYBDU4D0B4wXsFdYrhArjBp_FAE&s=_e0T1SzqaZ_NnRmOCs0o951ayc9uA_BwQFmQdLvVg2E&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>