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

[release/7.0] Fix max chunk size limiting #81607

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Feb 3, 2023

Backport of #81192 to release/7.0

/cc @janvorli

Customer Impact

When a customer application has a class with 170 or more methods, it causes access violation when creating temporary entry points. It occurs in some cases only though. Here are some of them:

  • Tiered compilation is turned off (DOTNET_TieredCompilation=0) and the class is loaded in a collectible assembly
  • Tiered compilation is turned off (DOTNET_TieredCompilation=0) and Rejit is turned off (DOTNET_ProfAPI_RejitOnAttach=0)
  • QuickJIT is turned off (System.Runtime.TieredCompilation.QuickJit setting is set to false or DOTNET_TC_QuickJit=0) and the assembly is not crossgened (or ReadyToRun is disabled using DOTNET_ReadyToRun=0).

Testing

Local manual testing of the affected scenario, CI tests.

Risk

Low, the change is in a frequently exercised code and affects only the case when it would cause the AV

@janvorli janvorli requested a review from jkotas February 3, 2023 21:50
@janvorli janvorli added this to the 7.0.x milestone Feb 3, 2023
@janvorli janvorli self-assigned this Feb 3, 2023
@janvorli janvorli added the Servicing-consider Issue for next servicing release review label Feb 3, 2023
@jeffschwMSFT jeffschwMSFT removed the Servicing-consider Issue for next servicing release review label Feb 6, 2023
@carlossanlop carlossanlop added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Feb 9, 2023
When the new stub heaps were implemented, the chunk size needed to be
limited so that all precodes for a chunk fit into a single memory page.
That was done in `MethodDescChunk::CreateChunk`. But it was discovered
now that there is another place where it needs to be limited, the
`MethodTableBuilder::AllocAndInitMethodDescChunk`. The
JIT\opt\ObjectStackAllocation\ObjectStackAllocationTests started to fail
in the outerloop due to too long chunk. The failure happens in crossgen2
as it is using a separate build of runtime in release and only that
uncovers the problem. And only when DOTNET_TieredCompilation=0 and
DOTNET_ProfApi_RejitOnAttach=0.

This change fixes the problem. With this change applied to the dotnet
runtime version used by the crossgen2 and patching it in place in the
.dotnet/shared/.... directory, the issue doesn't occur.

Close #81103
@carlossanlop carlossanlop force-pushed the backport/pr-81192-to-release/7.0 branch from dbf4532 to c55282f Compare February 10, 2023 22:27
@carlossanlop
Copy link
Member

@janvorli Friendly reminder that today is the Code Complete date for the March Servicing Release. If you'd like this change to be included in next month's release, please add the servicing-consider label and send an email to Tactics requesting approval. cc @jeffschwMSFT

@jeffschwMSFT
Copy link
Member

@carlossanlop thanks for the reminder. In this case, we decided to hold for more customer information before consider for servicing.

@carlossanlop
Copy link
Member

This is still marked as no-merge. Friendly reminder that the servicing branches open today.

@carlossanlop
Copy link
Member

I'm retargeting this PR to the new release/7.0-staging branch, which is the one that we will use from now on for servicing fixes.

Repo maintainers will now be allowed to merge their own servicing PR as long as it meets the requirements:

  • It is appoved by Tactics (signaled by adding the Servicing-approved label).
  • It's signed-off by an area owner.
  • The CI is green, or the failures are investigated as unrelated.
  • And if the PR touches an OOB package, the necessary OOB authoring changes are added.

The new process is described here: runtime/docs/project/library-servicing.md.

The infra team will be actively monitoring servicing PRs to ensure all requirements are met and to help with any issues.

Let me know if you have any questions.

@carlossanlop carlossanlop changed the base branch from release/7.0 to release/7.0-staging March 28, 2023 20:55
@carlossanlop
Copy link
Member

Friendly reminder: if you want this servicing fix to be included in the September 2023 Release, you'll have to merge this PR before August 14th.

@carlossanlop
Copy link
Member

@janvorli this hasn't been merged. Do we still want to keep it open?

@janvorli
Copy link
Member

We haven't seen a customer hit this issue, so let's close it.

@janvorli janvorli closed this Sep 11, 2023
@jkotas jkotas deleted the backport/pr-81192-to-release/7.0 branch September 11, 2023 20:19
@janvorli janvorli restored the backport/pr-81192-to-release/7.0 branch September 14, 2023 18:18
@janvorli janvorli reopened this Sep 14, 2023
@janvorli
Copy link
Member

@carlossanlop I have reopened this request since a customer has just hit the issue in .NET 7.

Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

approved. we will take for consideration in 7.0.x

@teo-tsirpanis
Copy link
Contributor

@janvorli, forgot to add Servicing-consider?

@janvorli janvorli added the Servicing-consider Issue for next servicing release review label Oct 9, 2023
@janvorli
Copy link
Member

janvorli commented Oct 9, 2023

@teo-tsirpanis yes, thank you for spotting that. And it was actually already approved on 9/20 by the tactics.

@janvorli
Copy link
Member

janvorli commented Oct 9, 2023

@carlossanlop should I actually set the label to servicing-approved then?

@jeffschwMSFT jeffschwMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Oct 9, 2023
@jeffschwMSFT
Copy link
Member

@janvorli is this still no merge?

@janvorli
Copy link
Member

janvorli commented Oct 9, 2023

@jeffschwMSFT no, it should not be marked as no merge.

@janvorli janvorli removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Oct 9, 2023
@jeffschwMSFT
Copy link
Member

@carlossanlop this is good to go. Thanks!

@carlossanlop
Copy link
Member

carlossanlop commented Oct 12, 2023

Note: it's targeting releass/7.0 again instead of release/7.0-staging but it's ok this time because the branches are currently open. I'll merge it.

Nevermind. I saw the title, not the branch. All good.

By the way, PR owners can merge their own PRs in servicing branches.

@carlossanlop carlossanlop merged commit 5d8b3d6 into release/7.0-staging Oct 12, 2023
111 of 113 checks passed
@carlossanlop carlossanlop deleted the backport/pr-81192-to-release/7.0 branch October 12, 2023 17:01
@ghost ghost locked as resolved and limited conversation to collaborators Nov 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-VM-coreclr Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants