Skip to content

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

Merged
VSadov merged 3 commits into
dotnet:mainfrom
VSadov:mapSwitch
Apr 4, 2023
Merged

VSadov merged 3 commits into
dotnet:mainfrom
VSadov:mapSwitch

Conversation

@VSadov

@VSadov VSadov commented Mar 30, 2023 •

Copy link
Copy Markdown
Member

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 ghost added the area-VM-coreclr label Mar 30, 2023
@ghost ghost assigned VSadov Mar 30, 2023
@ghost

ghost commented Mar 30, 2023

Copy link
Copy Markdown

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

VSadov commented Mar 31, 2023

Copy link
Copy Markdown
Member Author

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
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

VSadov commented Apr 1, 2023

Copy link
Copy Markdown
Member Author

CC: @tommcdon

@VSadov VSadov closed this Apr 1, 2023
@VSadov VSadov reopened this Apr 1, 2023
@VSadov

VSadov commented Apr 1, 2023

Copy link
Copy Markdown
Member Author

close/reopen to ustuck the CLA check

@janvorli janvorli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thank you!

@VSadov

VSadov commented Apr 4, 2023

Copy link
Copy Markdown
Member Author

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.

Labels

area-AssemblyLoader-coreclr only use for closed issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants