Aggregate adjacent memory sizes regardless of r+x - #45401
Conversation
|
Tagging subscribers to this area: @eiriktsarpalis, @jeffhandley Issue DetailsWhen adjacent memory ranges of same module differ by permission, the
|
|
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): |
|
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? |
|
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? |
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. |
|
Installer failure |
|
@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! |
|
@adamsitnik has suggested we create a unit test that validates the new parsing logic using a fixed |
When adjacent memory ranges of same module differ by permission, the line should not be skipped due to the lack of readability/executability flags.
…at.ParseMapModules.cs Co-authored-by: Tom Deseyn <tom.deseyn@gmail.com>
…at.ParseMapModules.cs
|
iOS simulator launch failure is #45181. |
|
Thanks @am11 for fixing these issues! |
…at.ParseMapModules.cs
…at.ParseMapModules.cs
|
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. |
|
@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- |
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.