[wasm][R2R] Fix Crst level violation between NativeImageEagerFixups and PregeneratedStringThunks#131355
Open
lewing wants to merge 1 commit into
Open
[wasm][R2R] Fix Crst level violation between NativeImageEagerFixups and PregeneratedStringThunks#131355lewing wants to merge 1 commit into
lewing wants to merge 1 commit into
Conversation
…nd PregeneratedStringThunks
During a composite R2R load on WebAssembly, the eager-fixup path takes
CrstPregeneratedStringThunks while already holding CrstNativeImageEagerFixups.
Both were assigned the same rank (level 7) because neither declared an ordering
relative to the other, so the nested acquisition trips the Crst level
consistency check ("Can't take level 7 lock ... because you already holding
level 7 lock ...").
Declare NativeImageEagerFixups AcquiredBefore PregeneratedStringThunks in
CrstTypes.def and regenerate crsttypes_generated.h (NativeImageEagerFixups is
now level 8, above PregeneratedStringThunks at 7), making the nested
acquisition well-ordered.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 50ddfb2c-b6f8-4847-81e7-44d37d44a175
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts CoreCLR Crst lock-order metadata to establish a defined ordering between NativeImageEagerFixups and PregeneratedStringThunks, preventing checked-build Crst level violations when both locks are acquired on the WASM R2R path.
Changes:
- Updates
CrstTypes.defto specifyNativeImageEagerFixupsis acquired beforePregeneratedStringThunks(and still beforeUnresolvedClassLock). - Regenerates
crsttypes_generated.h, updatingCrstNativeImageEagerFixups’s computed level from 7 to 8 to satisfy the new ordering constraint.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/coreclr/inc/CrstTypes.def | Adds the AcquiredBefore PregeneratedStringThunks dependency for NativeImageEagerFixups to define lock acquisition order. |
| src/coreclr/inc/crsttypes_generated.h | Regenerated Crst level map reflects the new ordering by bumping CrstNativeImageEagerFixups from level 7 to 8. |
Contributor
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The WASM R2R path acquires the
NativeImageEagerFixupsandPregeneratedStringThunksCrsts without a defined acquisition order between them, which trips a Crst level violation.Add an
AcquiredBefore PregeneratedStringThunksedge toNativeImageEagerFixupsinCrstTypes.defso the two locks have a well-defined ordering, and regeneratecrsttypes_generated.h(CrstNativeImageEagerFixups level 7 -> 8). Nothing acquiresNativeImageEagerFixupsbefore another lock, so the change does not cascade to any other Crst level.Note
This pull request was authored with assistance from GitHub Copilot.