Uh oh!
There was an error while loading. Please reload this page.
Aggregate adjacent memory sizes regardless of r+x - #45401
Conversation
ghost
commented
Dec 1, 2020
Tagging subscribers to this area: @eiriktsarpalis, @jeffhandley Issue DetailsWhen adjacent memory ranges of same module differ by permission, the
|
am11
commented
Dec 1, 2020
cc @stephentoub Tested with dotnet console template. e.g. before: after (extracted the built tarball from artifacts/packages/Shipping directory and copied runtime/.dotnet/sdk over): |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
eiriktsarpalis
commented
Dec 3, 2020
Would it be possible to write a test that verifies the new behaviour? Presumably there would no longer be any duplicates in the process modules for the current process? |
am11
commented
Dec 3, 2020
Currently we have a test validating that these properties do not throw: runtime/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs Lines 624 to 627 in 4a743ac Also there is a test which asserts that getting modules multiple times subsequently result in the same modules. Is there anything else we could validate? |
eiriktsarpalis
commented
Dec 3, 2020
What issue is the PR meant to be addressing? Presumably adjacent regions with different permission sets would be reported as separate modules? Looking at the Would this be reported differently after your changes? Or am I misunderstanding something? |
It was based on this discussion type thread: #45180.
From the example, this PR would only affect the value of Before: After: Before we were stopping at the row without r and x permission. PR continues to sum all consecutive nodes of the same module (unless end address of previous and start address of current mismatch). |
Ok, so the issue concerned reporting incorrect sizes? Thanks for clarifying. |
am11
commented
Dec 4, 2020
Installer failure |
adamsitnik
commented
Dec 7, 2020
@am11 is there any chance that you could split the PR into two commits: the actual fix and the refactoring? It would make reviewing much easier for us. Thank you! |
eiriktsarpalis
commented
Dec 7, 2020
@adamsitnik has suggested we create a unit test that validates the new parsing logic using a fixed |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
When adjacent memory ranges of same module differ by permission, the line should not be skipped due to the lack of readability/executability flags.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…at.ParseMapModules.cs Co-authored-by: Tom Deseyn <tom.deseyn@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
…at.ParseMapModules.cs
am11
commented
Dec 10, 2020
iOS simulator launch failure is #45181. |
Uh oh!
There was an error while loading. Please reload this page.
tmds
commented
Dec 10, 2020
Thanks @am11 for fixing these issues! |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…at.ParseMapModules.cs
…at.ParseMapModules.cs
Uh oh!
There was an error while loading. Please reload this page.
eiriktsarpalis
commented
Dec 10, 2020
Nit: I'm finding the parsing method hard to follow, mainly because it is cobbling together line parsing concerns with process module parsing concerns. I took the liberty of refactoring your code in a branch of my own, kindly consider including something like that. |
am11
commented
Dec 10, 2020
@eiriktsarpalis, thanks a lot. Based on:
from https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/exceptions-and-performance#try-parse-pattern, I have also found non- |
eiriktsarpalis
commented
Dec 10, 2020
Agreed. It's internal as well so won't die on that hill :-) |
When adjacent memory ranges of same module differ by permission, the
line should not be skipped due to the lack of readability/executability
flags.