<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Apr 23, 2014 at 10:30 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.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"><div class="">On Wed, Apr 23, 2014 at 10:21 PM, Nico Weber <<a href="mailto:thakis@chromium.org">thakis@chromium.org</a>> wrote:<br>

> On Wed, Apr 23, 2014 at 10:09 PM, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>> wrote:<br>
>><br>
>><br>
>><br>
>><br>
>> On Thu, Apr 24, 2014 at 1:53 AM, Nico Weber <<a href="mailto:thakis@chromium.org">thakis@chromium.org</a>> wrote:<br>
>>><br>
>>> Do you have a bot that provides an up-to-date list of these reports?<br>
>><br>
>><br>
>> No bot, but I've just updated <a href="http://llvm.org/bugs/show_bug.cgi?id=19521" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=19521</a><br>
>> with the new log.<br>
>> The leak from <a href="http://llvm.org/bugs/show_bug.cgi?id=19520" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=19520</a> appears over 1000<br>
>> times while running check-clang,<br>
>> so I suppressed it, all other leaks are in the log:<br>
>> <a href="http://llvm.org/bugs/attachment.cgi?id=12428" target="_blank">http://llvm.org/bugs/attachment.cgi?id=12428</a><br>
>> Quite a few still.<br>
><br>
><br>
> Down from 4200 to 1500 (or 2500, if you don't count the 1000 suppressed),<br>
> that's good progress :-)<br>
><br>
> Many of these are in CGDebugInfo<br>
<br>
</div>Could you point me to the bugs/stack traces/repro steps for CGDebugInfo leaks?<br></blockquote><div><br></div><div>Extract and open the file Kostya attached, look for "leak of". About the first 40% are in CGDebugInfo. (Search for "CGDebugInfo::" for example). You're looking for stacks like</div>
<div><br></div><div><div>Direct leak of 536 byte(s) in 1 object(s) allocated from:</div><div>    #0 0x7ba998 in __interceptor_malloc /home/kcc/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:75</div><div>    #1 0x1e8f933 in llvm::MDNode::getTemporary(llvm::LLVMContext&, llvm::ArrayRef<llvm::Value*>) /home/kcc/llvm/lib/IR/Metadata.cpp:285</div>
<div>    #2 0x6332104 in llvm::DIBuilder::createForwardDecl(unsigned int, llvm::StringRef, llvm::DIDescriptor, llvm::DIFile, unsigned int, unsigned int, unsigned long, unsigned long, llvm::StringRef) /home/kcc/llvm/lib/IR/DIBuilder.cpp:905</div>
<div>    #3 0x36027a9 in clang::CodeGen::CGDebugInfo::getOrCreateRecordFwdDecl(clang::RecordType const*, llvm::DIDescriptor) /home/kcc/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp:626</div><div>    #4 0x361b4c1 in clang::CodeGen::CGDebugInfo::CreateLimitedType(clang::RecordType const*) /home/kcc/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp:2305</div>
<div>    #5 0x36113a8 in clang::CodeGen::CGDebugInfo::getOrCreateLimitedType(clang::RecordType const*, llvm::DIFile) /home/kcc/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp:2260</div><div>    #6 0x360fb99 in clang::CodeGen::CGDebugInfo::CreateTypeDefinition(clang::RecordType const*) /home/kcc/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp:1537</div>
</div><div><br></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 class=""><div class="h5"><br>
> and some in CodeGenFunction – if someone<br>
> who knows that code could look at these (it's probably just 2-4 bugs),<br>
> that'd be a huge help.<br>
><br>
>><br>
>><br>
>><br>
>> There are also 14  leaks while running check-llvm, added a separate log:<br>
>> <a href="http://llvm.org/bugs/attachment.cgi?id=12429" target="_blank">http://llvm.org/bugs/attachment.cgi?id=12429</a><br>
>><br>
>><br>
>>><br>
>>> r207031 probably fixes many of the convertCommentToXML stacks.<br>
>><br>
>> Thanks for this and all the other fixes!<br>
>><br>
>> --kcc<br>
>>><br>
>>><br>
>>><br>
>>> On Wed, Apr 23, 2014 at 6:25 AM, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>><br>
>>> wrote:<br>
>>>><br>
>>>> Manuel mentions that clang has some intentional leaks.<br>
>>>> That's right, and we handle them using BuryPointer<br>
>>>> (./lib/Frontend/CompilerInvocation.cpp).<br>
>>>> So if there are more *intentional* leaks we need to bury them too to let<br>
>>>> LSan find the interesting ones.<br>
>>>><br>
>>>> --kcc<br>
>>>><br>
>>>><br>
>>>> On Wed, Apr 23, 2014 at 4:25 PM, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>><br>
>>>> wrote:<br>
>>>>><br>
>>>>> Hi,<br>
>>>>><br>
>>>>> TL;DR: there are tons of leaks in Clang, please help us fix them.<br>
>>>>><br>
>>>>> We have a build bot that runs clang bootstrap under AddressSanitizer<br>
>>>>> (ASan).<br>
>>>>> LeakSanitizer (LSan, a leak detector that runs as part of ASan) is<br>
>>>>> enabled on that bot,<br>
>>>>> but as we've learned today only on part of the bootstrap actually runs<br>
>>>>> LSan.<br>
>>>>> LSan is enabled by the env. var ASAN_OPTIONS=detect_leaks=1 and we have<br>
>>>>> this env. var. set on the bot so the 3-rd stage build uses it.<br>
>>>>> However the lit runner clears the environment and the lit<br>
>>>>> tests were not running under lsan until today, when I tried to enable<br>
>>>>> lsan by default.<br>
>>>>><br>
>>>>> This has discovered tons of leaks and I reverted the change.<br>
>>>>> The leaks happen in various modes that are not exercised during regular<br>
>>>>> self-compilation on linux,<br>
>>>>> e.g. static analyzer, -emit-llvm, Windows ABI, etc.<br>
>>>>> I've filed a few bugs (19520 19522 19523 19524) but there are dozens<br>
>>>>> more reports left.<br>
>>>>><br>
>>>>> If you care about leaks in clang, please check<br>
>>>>> <a href="http://llvm.org/bugs/attachment.cgi?id=12423" target="_blank">http://llvm.org/bugs/attachment.cgi?id=12423</a><br>
>>>>> and see if any of these leaks are in your code.<br>
>>>>><br>
>>>>> Thanks,<br>
>>>>><br>
>>>>> --kcc<br>
>>>><br>
>>>><br>
>>>><br>
>>>> _______________________________________________<br>
>>>> cfe-dev mailing list<br>
>>>> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
>>>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
>>>><br>
>>><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
><br>
</div></div></blockquote></div><br></div></div>