[llvm] r219244 - [Bugpoint] Close error log in ProcessFailure. Bugpoint had been failing to close

Lang Hames lhames at gmail.com
Tue Oct 7 15:37:58 PDT 2014


Valgrind's man page had this to say:

--track-fds=<yes|no> [default: no]
        When enabled, Valgrind will print out a list of open file
descriptors on exit.

It might be possible to write a test to count the open handles after
running a small test case, but I don't have a working copy of bugpoint to
test with.

- Lang.


On Tue, Oct 7, 2014 at 3:16 PM, David Blaikie <dblaikie at gmail.com> wrote:

>
>
> On Tue, Oct 7, 2014 at 2:47 PM, Lang Hames <lhames at gmail.com> wrote:
>
>> Author: lhames
>> Date: Tue Oct  7 16:47:23 2014
>> New Revision: 219244
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=219244&view=rev
>> Log:
>> [Bugpoint] Close error log in ProcessFailure. Bugpoint had been failing
>> to close
>> this, and in some circumstances (e.g. reducing particularly large
>> test-cases)
>> this was causing bugpoint to be killed for hitting open file-handle
>> limits.
>>
>> No test case: I was only able to trigger this with test cases taking
>> upwards of
>> 10 mins to run.
>>
>
> 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)
>
>
>>
>>
>> Modified:
>>     llvm/trunk/tools/bugpoint/ToolRunner.cpp
>>
>> Modified: llvm/trunk/tools/bugpoint/ToolRunner.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ToolRunner.cpp?rev=219244&r1=219243&r2=219244&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/tools/bugpoint/ToolRunner.cpp (original)
>> +++ llvm/trunk/tools/bugpoint/ToolRunner.cpp Tue Oct  7 16:47:23 2014
>> @@ -141,21 +141,13 @@ static std::string ProcessFailure(String
>>
>>    // Rerun the compiler, capturing any error messages to print them.
>>    SmallString<128> ErrorFilename;
>> -  int ErrorFD;
>>    std::error_code EC = sys::fs::createTemporaryFile(
>> -      "bugpoint.program_error_messages", "", ErrorFD, ErrorFilename);
>> +      "bugpoint.program_error_messages", "", ErrorFilename);
>>    if (EC) {
>>      errs() << "Error making unique filename: " << EC.message() << "\n";
>>      exit(1);
>>    }
>>
>> -#ifdef _WIN32
>> -  // Close ErrorFD immediately, or it couldn't be reopened on Win32.
>> -  // FIXME: We may have an option in openFileForWrite(), not to use
>> ResultFD
>> -  // but to close it.
>> -  delete new raw_fd_ostream(ErrorFD, true);
>> -#endif
>> -
>>    RunProgramWithTimeout(ProgPath, Args, "", ErrorFilename.str(),
>>                          ErrorFilename.str(), Timeout, MemoryLimit);
>>    // FIXME: check return code ?
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141007/6678dc75/attachment.html>


More information about the llvm-commits mailing list