<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 7, 2014 at 2:47 PM, Lang Hames <span dir="ltr"><<a href="mailto:lhames@gmail.com" target="_blank">lhames@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: lhames<br>
Date: Tue Oct  7 16:47:23 2014<br>
New Revision: 219244<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=219244&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=219244&view=rev</a><br>
Log:<br>
[Bugpoint] Close error log in ProcessFailure. Bugpoint had been failing to close<br>
this, and in some circumstances (e.g. reducing particularly large test-cases)<br>
this was causing bugpoint to be killed for hitting open file-handle limits.<br>
<br>
No test case: I was only able to trigger this with test cases taking upwards of<br>
10 mins to run.<br></blockquote><div><br></div><div>Does Valgrind report leaked file handles, by chance? Could see if it reports it on a small test case (& we do have Valgrind bots - but I guess they would've found this bug on some other bugpoint test case (if we have any) already)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Modified:<br>
    llvm/trunk/tools/bugpoint/ToolRunner.cpp<br>
<br>
Modified: llvm/trunk/tools/bugpoint/ToolRunner.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ToolRunner.cpp?rev=219244&r1=219243&r2=219244&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ToolRunner.cpp?rev=219244&r1=219243&r2=219244&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/tools/bugpoint/ToolRunner.cpp (original)<br>
+++ llvm/trunk/tools/bugpoint/ToolRunner.cpp Tue Oct  7 16:47:23 2014<br>
@@ -141,21 +141,13 @@ static std::string ProcessFailure(String<br>
<br>
   // Rerun the compiler, capturing any error messages to print them.<br>
   SmallString<128> ErrorFilename;<br>
-  int ErrorFD;<br>
   std::error_code EC = sys::fs::createTemporaryFile(<br>
-      "bugpoint.program_error_messages", "", ErrorFD, ErrorFilename);<br>
+      "bugpoint.program_error_messages", "", ErrorFilename);<br>
   if (EC) {<br>
     errs() << "Error making unique filename: " << EC.message() << "\n";<br>
     exit(1);<br>
   }<br>
<br>
-#ifdef _WIN32<br>
-  // Close ErrorFD immediately, or it couldn't be reopened on Win32.<br>
-  // FIXME: We may have an option in openFileForWrite(), not to use ResultFD<br>
-  // but to close it.<br>
-  delete new raw_fd_ostream(ErrorFD, true);<br>
-#endif<br>
-<br>
   RunProgramWithTimeout(ProgPath, Args, "", ErrorFilename.str(),<br>
                         ErrorFilename.str(), Timeout, MemoryLimit);<br>
   // FIXME: check return code ?<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>