[lldb-dev] target delete doesn't drop file handles

Zachary Turner zturner at google.com
Tue Mar 24 16:08:38 PDT 2015

It looks like target delete has a --clean option which does what I need.
So I think that means the answer to my question of whether or not it's
important is yes, and so I'll probably just want to change the default
value from false to true on Windows.  Is there any precedent for having
command options take different default values on different platforms?

On Tue, Mar 24, 2015 at 3:53 PM Zachary Turner <zturner at google.com> wrote:

> I've tracked down the source of a bunch of test failures on Windows which
> are caused by file handle leaks.  The symptom of the problem is that if you
> run "file a.out" the file is locked after that, and you cannot delete it.
> This causes a bunch of tests to fail when "make clean" can't delete the
> file.
> Thas to do with the nature of the Windows kernel and how it treats memory
> mapped files.  Essentially what is happening is
> that ModuleList::GetSharedModule() is mmapping the file and intentionally
> leaking the handle.  So even doing target delete won't free the handle.
> I'm guessing this is an optimization, but how necessary is it?  Assuming
> it needs to stay, would it be reasonable for me to disable this intentional
> leak for Windows behind a preprocessor definition, make target delete
> remove the module from the shared module list, and update the test suite to
> always free created targets on teardown?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150324/c5c362e4/attachment.html>

More information about the lldb-dev mailing list