[PATCH] D49159: [windows] Fix out-of-memory failure in some of the tests

Stella Stamenova via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 10 17:38:38 PDT 2018


You mean before making the call to ReadProcessMemory?

The address that is passed to ReadProcessMemory is already cast to a void* which is the correct input for the function. I am also not sure whether it is possible for ReadProcessMemory to always set the output size to a wrong value when it fails (so we should always set the size to 0 regardless).

Thanks,
-Stella

From: Zachary Turner <zturner at google.com>
Sent: Tuesday, July 10, 2018 4:01 PM
To: Stella Stamenova <stilis at microsoft.com>
Cc: reviews+D49159+public+f5176ed1b1117dd2 at reviews.llvm.org; aaron.lee.smith <aaron.lee.smith at gmail.com>; llvm-commits at lists.llvm.org
Subject: Re: [PATCH] D49159: [windows] Fix out-of-memory failure in some of the tests

Should we try to set protections on the page? What happens in vs if you do *((int*)unmapped address)
On Tue, Jul 10, 2018 at 3:44 PM Stella Stamenova <stilis at microsoft.com<mailto:stilis at microsoft.com>> wrote:
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.

Thanks,
-Stella

From: Zachary Turner <zturner at google.com<mailto:zturner at google.com>>
Sent: Tuesday, July 10, 2018 3:38 PM
To: reviews+D49159+public+f5176ed1b1117dd2 at reviews.llvm.org<mailto:reviews%2BD49159%2Bpublic%2Bf5176ed1b1117dd2 at reviews.llvm.org>
Cc: Stella Stamenova <stilis at microsoft.com<mailto:stilis at microsoft.com>>; aaron.lee.smith <aaron.lee.smith at gmail.com<mailto:aaron.lee.smith at gmail.com>>; llvm-commits at lists.llvm.org<mailto:llvm-commits at lists.llvm.org>
Subject: Re: [PATCH] D49159: [windows] Fix out-of-memory failure in some of the tests

Any idea Why does the call fail?
On Tue, Jul 10, 2018 at 3:26 PM Stella Stamenova via Phabricator <reviews at reviews.llvm.org<mailto:reviews at reviews.llvm.org>> wrote:
stella.stamenova created this revision.
stella.stamenova added reviewers: asmith, zturner.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D49159<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD49159&data=02%7C01%7Cstilis%40microsoft.com%7C80ff83845cc34705457908d5e6b90333%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636668604654845146&sdata=qcoocUDGhIqcuQvvOEKyi1JB9Op4fvCDCSOBoiAePlo%3D&reserved=0>

Files:
  source/Plugins/Process/Windows/Common/ProcessWindows.cpp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180711/f5d2247a/attachment.html>


More information about the llvm-commits mailing list