Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a diagnostic switch to turn off the use of file mapping in PE loader. #84151

Merged
merged 3 commits into from
Apr 4, 2023

Conversation

VSadov
Copy link
Member

@VSadov VSadov commented Mar 30, 2023

Introducing unsupported/internal DOTNET_PELoader_DisableMapping switch.

The switch is available in both debug and release builds.
Setting DOTNET_PELoader_DisableMapping to not 0 will force the fallback paths in PE loader where file sections are copied to preallocated memory ranges instead of being mapped.

We needed to turn off file mapping in a few scenarios recently when narrowing down the root cause of bugs.
Without a switch, turning off the file mapping is nontrivial and especially so in a singlefile scenario.

@ghost
Copy link

ghost commented Mar 30, 2023

Tagging subscribers to this area: @agocke, @vitek-karas, @VSadov
See info in area-owners.md if you want to be subscribed.

Issue Details

We needed this in a few scenarios recently when narrowing down the root cause of bugs. Without a switch, turning off the file mapping is nontrivial and especially so in a singlefile scenario.

=== in progress.

Need to:

  • test manually to make sure the switch really does what it is supposed to do.
  • make the default state "off". (run tests with "on" to make sure it is ok).
Author: VSadov
Assignees: VSadov
Labels:

area-AssemblyLoader-coreclr, area-Single-File, area-VM-coreclr

Milestone: -

@VSadov
Copy link
Member Author

VSadov commented Mar 31, 2023

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@VSadov VSadov marked this pull request as ready for review April 1, 2023 01:49
@VSadov VSadov requested a review from janvorli April 1, 2023 01:49
@VSadov
Copy link
Member Author

VSadov commented Apr 1, 2023

CC: @tommcdon

@VSadov VSadov closed this Apr 1, 2023
@VSadov VSadov reopened this Apr 1, 2023
@VSadov
Copy link
Member Author

VSadov commented Apr 1, 2023

close/reopen to ustuck the CLA check

Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@VSadov
Copy link
Member Author

VSadov commented Apr 4, 2023

Thanks!!

@VSadov VSadov merged commit 47fe1d1 into dotnet:main Apr 4, 2023
@VSadov VSadov deleted the mapSwitch branch April 4, 2023 03:30
@ghost ghost locked as resolved and limited conversation to collaborators May 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants