I don't experience this crash but looking at the proposed fix it certainly seems like a plausible explanation. Seems to me like something should transfer ownership though rather than duplicating the handle<br><div class="gmail_quote">On Thu, May 21, 2015 at 9:52 AM Colin Riley <<a href="mailto:colin@codeplay.com">colin@codeplay.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Windows 7 64, Debug, latest vs13.</div><div bgcolor="#FFFFFF" text="#000000"><br>
<br>
<div>On 21/05/2015 17:39, Oleksiy Vyalov
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi Colin,
<div><br>
</div>
<div>could you give more context about crash - what build
configuration do you use (debug, release,..) and which OS?</div>
<div>I'm running this code on Windows 7 and haven't noticed any
failures.</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, May 21, 2015 at 8:57 AM, Colin
Riley <span dir="ltr"><<a href="mailto:colin@codeplay.com" target="_blank">colin@codeplay.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> <br>
Zachary, do you see this on windows at all? Tip for us
results in crashes when releasing file descriptors without
the below fix. <br>
<br>
Colin
<div>
<div><br>
<br>
<div>On 19/05/2015 12:52, Aidan Dodds wrote:<br>
</div>
</div>
</div>
<blockquote type="cite">
<div>
<div>Hi, <br>
<br>
We have been seeing a crash on windows when
connecting to an android target using lldb-server. <br>
I am not sure if this affects other platforms too. <br>
I think this was introduced with <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D9056&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=DDUMf06MYELAe1Nlv7KChiwJLLHbYha4jtK_AOiWqwQ&m=V1ewZGdJuY4KKJmhMOnfCP2natAzSjG_hC_aAOsSoJg&s=nDFiITYkv0UK-Sav1a3RVEgZYkZKSAog_d5nkg9sJSE&e=" target="_blank">http://reviews.llvm.org/D9056</a>.
<br>
<br>
I tracked the crash back to the workings of
ModuleCache::GetAndPut(). <br>
<br>
The crash seems to be due to a file descriptor being
released twice, once by the original "File
lock_file" and again by the "LockFile lock" who
share the same file descriptor. <br>
<br>
The file descriptor sharing happens because of this
line: <br>
ModuleCache.cpp @ 164 <br>
LockFile lock (lock_file.GetDescriptor ()); <br>
<br>
Both destructors attempt to release effectively the
same file descriptor. I was able to fix the crash
by duplicating the file handle in the lock file
constructor using _dup(). (patch attached) <br>
I wasn't sure if this was the right fix however. Has
anyone else seen this? <br>
Should "File lock_file" perhaps transfer its file
descriptor completely rather then share it? <br>
<br>
Thanks, <br>
Aidan <br>
<br>
<fieldset></fieldset>
<br>
</div>
</div>
<pre>_______________________________________________
lldb-dev mailing list
<a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a>
</pre>
</blockquote>
<br>
<pre cols="72">--
- Colin Riley
Senior Director,
Parallel/Graphics Debugger Systems
Codeplay Software Ltd
45 York Place, Edinburgh, EH1 3HP
Tel: 0131 466 0503
Fax: 0131 557 6600
Website: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.codeplay.com&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=DDUMf06MYELAe1Nlv7KChiwJLLHbYha4jtK_AOiWqwQ&m=V1ewZGdJuY4KKJmhMOnfCP2natAzSjG_hC_aAOsSoJg&s=8a9Rq1sp08RPPL--yxbQ6RLp06uoKyimpAPgHlxTgJw&e=" target="_blank">http://www.codeplay.com</a>
Twitter: <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__twitter.com_codeplaysoft&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=DDUMf06MYELAe1Nlv7KChiwJLLHbYha4jtK_AOiWqwQ&m=V1ewZGdJuY4KKJmhMOnfCP2natAzSjG_hC_aAOsSoJg&s=2PoUHKemOi1LGftJsibdlMkptNiBebAzPjSKmIVAZxs&e=" target="_blank">https://twitter.com/codeplaysoft</a>
This email and any attachments may contain confidential and /or privileged information and is for use by the addressee only. If you are not the intended recipient, please notify Codeplay Software Ltd immediately and delete the message from your computer. You may not copy or forward it,or use or disclose its contents to any other person. Any views or other information in this message which do not relate to our business are not authorized by Codeplay software Ltd, nor does this message form part of any contract unless so stated.
As internet communications are capable of data corruption Codeplay Software Ltd does not accept any responsibility for any changes made to this message after it was sent. Please note that Codeplay Software Ltd does not accept any liability or responsibility for viruses and it is your responsibility to scan any attachments.
Company registered in England and Wales, number: 04567874
Registered office: 81 Linkfield Street, Redhill RH1 6BY </pre>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div>
<div dir="ltr"><span style="color:rgb(85,85,85);font-family:sans-serif;line-height:20px;background-color:rgb(255,255,255);border-width:2px 0px 0px;border-style:solid;border-color:rgb(213,15,37);padding-top:2px;margin-top:2px">Oleksiy
Vyalov |</span><span style="color:rgb(85,85,85);font-family:sans-serif;line-height:20px;background-color:rgb(255,255,255);border-width:2px 0px 0px;border-style:solid;border-color:rgb(51,105,232);padding-top:2px;margin-top:2px"> Software
Engineer |</span><span style="color:rgb(85,85,85);font-family:sans-serif;line-height:20px;background-color:rgb(255,255,255);border-width:2px 0px 0px;border-style:solid;border-color:rgb(0,153,57);padding-top:2px;margin-top:2px"> <a href="mailto:ovyalov@google.com" target="_blank">ovyalov<font color="#1155cc">@google.com</font></a></span></div>
</div>
</div>
</blockquote>
<br>
<pre cols="72">--
- Colin Riley
Senior Director,
Parallel/Graphics Debugger Systems
Codeplay Software Ltd
45 York Place, Edinburgh, EH1 3HP
Tel: 0131 466 0503
Fax: 0131 557 6600
Website: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.codeplay.com&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=DDUMf06MYELAe1Nlv7KChiwJLLHbYha4jtK_AOiWqwQ&m=V1ewZGdJuY4KKJmhMOnfCP2natAzSjG_hC_aAOsSoJg&s=8a9Rq1sp08RPPL--yxbQ6RLp06uoKyimpAPgHlxTgJw&e=" target="_blank">http://www.codeplay.com</a>
Twitter: <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__twitter.com_codeplaysoft&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=DDUMf06MYELAe1Nlv7KChiwJLLHbYha4jtK_AOiWqwQ&m=V1ewZGdJuY4KKJmhMOnfCP2natAzSjG_hC_aAOsSoJg&s=2PoUHKemOi1LGftJsibdlMkptNiBebAzPjSKmIVAZxs&e=" target="_blank">https://twitter.com/codeplaysoft</a>
This email and any attachments may contain confidential and /or privileged information and is for use by the addressee only. If you are not the intended recipient, please notify Codeplay Software Ltd immediately and delete the message from your computer. You may not copy or forward it,or use or disclose its contents to any other person. Any views or other information in this message which do not relate to our business are not authorized by Codeplay software Ltd, nor does this message form part of any contract unless so stated.
As internet communications are capable of data corruption Codeplay Software Ltd does not accept any responsibility for any changes made to this message after it was sent. Please note that Codeplay Software Ltd does not accept any liability or responsibility for viruses and it is your responsibility to scan any attachments.
Company registered in England and Wales, number: 04567874
Registered office: 81 Linkfield Street, Redhill RH1 6BY </pre>
</div></blockquote></div>