Should we try to set protections on the page?  What happens in vs if you do *((int*)unmapped address)<br><div class="gmail_quote"><div dir="ltr">On Tue, Jul 10, 2018 at 3:44 PM Stella Stamenova <<a href="mailto:stilis@microsoft.com">stilis@microsoft.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div class="m_-61954173723032666WordSection1">
<p class="MsoNormal">The memory address that we are reading from is invalid in the test that is failing – it has not been initialized, so it points to an invalid location. ReadProcessMemory can fail for a number of reasons and in this case I believe it’s because
 it doesn’t have access to read from that particular memory location.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<p class="MsoNormal">-Stella<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><b>From:</b> Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> <br>
<b>Sent:</b> Tuesday, July 10, 2018 3:38 PM<br>
<b>To:</b> <a href="mailto:reviews%2BD49159%2Bpublic%2Bf5176ed1b1117dd2@reviews.llvm.org" target="_blank">reviews+D49159+public+f5176ed1b1117dd2@reviews.llvm.org</a><br>
<b>Cc:</b> Stella Stamenova <<a href="mailto:stilis@microsoft.com" target="_blank">stilis@microsoft.com</a>>; aaron.lee.smith <<a href="mailto:aaron.lee.smith@gmail.com" target="_blank">aaron.lee.smith@gmail.com</a>>; <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<b>Subject:</b> Re: [PATCH] D49159: [windows] Fix out-of-memory failure in some of the tests<u></u><u></u></p></div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_-61954173723032666WordSection1">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Any idea Why does the call fail?<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">On Tue, Jul 10, 2018 at 3:26 PM Stella Stamenova via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal" style="margin-bottom:12.0pt">stella.stamenova created this revision.<br>
stella.stamenova added reviewers: asmith, zturner.<br>
Herald added a subscriber: llvm-commits.<br>
<br>
When ReadProcessMemory fails, bytes_read is sometimes set to a large garbage value. In that case, we need to set it back to zero before returning or the garbage value will be used to allocate memory later causing LLDB to crash with an out of memory error.<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD49159&data=02%7C01%7CSTILIS%40microsoft.com%7C2d1f183f0e124d7c994208d5e6b5c66a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636668590753332113&sdata=ZOP6%2B2oxEkIvmonPJneFZLVLwAJoHuO8RxU1uxw1WSg%3D&reserved=0" target="_blank">https://reviews.llvm.org/D49159</a><br>
<br>
Files:<br>
  source/Plugins/Process/Windows/Common/ProcessWindows.cpp<u></u><u></u></p>
</blockquote>
</div>
</div>
</div>

</blockquote></div>