[lldb-dev] Leaks from static variables

Kate Stone via lldb-dev lldb-dev at lists.llvm.org
Mon Aug 1 15:33:08 PDT 2016


Agreed that it’s a defect and should be addressed.  It mostly a question of prioritization relative to other work, so knowing about a specific scenario where this is a pressing issue would be valuable.

Kate Stone k8stone at apple.com <mailto:k8stone at apple.com>
 Xcode Low Level Tools

> On Aug 1, 2016, at 3:25 PM, Zachary Turner via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> 
> If you're linking against liblldb you can't rely on the os cleaning up because you could unload liblldb before shutting down the process.
> 
> Also it's good practice to do explicit cleanup since its not always just a simple matter of releasing resources, sometimes actual shutdown code needs to be interspersed with the cleanup 
> On Mon, Aug 1, 2016 at 3:15 PM Kate Stone via lldb-dev <lldb-dev at lists.llvm.org <mailto:lldb-dev at lists.llvm.org>> wrote:
> Greg Clayton will almost certainly want to weigh in here when he returns next week.  Generally speaking, we’ve had a long tail of issues that only show up during teardown that we’re avoiding.  Leaking resources that will be reclaimed by the OS when the process terminates is a non-issue.  If there are specific scenarios where a long-lived process leaks significant content that isn’t an effective cache for subsequent use, please outline how that manifests.
> 
> Kate Stone k8stone at apple.com <mailto:k8stone at apple.com>
>  Xcode Low Level Tools
> 
> 
>> On Aug 1, 2016, at 2:40 PM, Vedant Kumar via lldb-dev <lldb-dev at lists.llvm.org <mailto:lldb-dev at lists.llvm.org>> wrote:
>> 
> 
>> Hi lldb-dev,
>> 
>> It looks like the debugger initializes static variables in llvm (see:
>> SystemInitializerFull::Initialize()), but, AFAICT, it never cleans them up.
>> 
>> Does this cause memory leaks? I'd assumed that it's necessary to call
>> llvm_shutdown() somewhere to avoid this kind of leak.
>> 
>> Is there a buildbot I can check that tests an address-sanitized version of
>> lldb?
>> 
>> thanks,
>> vedant
> 
>> _______________________________________________
>> lldb-dev mailing list
>> lldb-dev at lists.llvm.org <mailto:lldb-dev at lists.llvm.org>
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev <http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev>
> 
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org <mailto:lldb-dev at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev <http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev>
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20160801/caa1443b/attachment-0001.html>


More information about the lldb-dev mailing list