Fix R2RDump ArgumentOutOfRangeException for composite LVB images#126387
Open
Fix R2RDump ArgumentOutOfRangeException for composite LVB images#126387
Conversation
In Large Version Bubble (LVB) composite mode, ManifestReferenceAssemblies contains more entries than ReadyToRunAssemblyHeaders because the manifest includes extra assembly references for the version bubble. The loop in DumpHeader iterated over all manifest references but indexed into the shorter assembly headers list, causing an ArgumentOutOfRangeException. Add a bounds check to break out of the loop when assembly headers are exhausted. Cherry-picked from jtschuster/runtime@a6713cc Co-authored-by: jtschuster <36744439+jtschuster@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/66878142-2700-416a-bb14-609f819de1a5
Copilot
AI
changed the title
[WIP] Fix R2RDump crashing with ArgumentOutOfRangeException
Fix R2RDump ArgumentOutOfRangeException for composite LVB images
Apr 1, 2026
Member
|
/azp run runtime-coreclr crossgen2-composite |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries |
This was referenced Apr 1, 2026
Open
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a crash in R2RDump when dumping composite Large Version Bubble (LVB) ReadyToRun images where manifest AssemblyRef entries outnumber actual component assembly headers.
Changes:
- Add a bounds check in the composite component-assembly dump loop to stop iterating once
assemblyIndexreaches_r2r.ReadyToRunAssemblyHeaders.Count, preventingArgumentOutOfRangeException.
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.
In Large Version Bubble (LVB) composite R2R images,
ManifestReferenceAssembliescontains more entries thanReadyToRunAssemblyHeaders— the manifest includes extra version-bubble assembly references beyond the actual component assemblies.TextDumper.DumpHeaderiterated over the manifest list while indexing into the shorter headers list, throwingArgumentOutOfRangeException.Changes
src/coreclr/tools/r2rdump/TextDumper.cs: Add a bounds check in the composite assembly loop to break whenassemblyIndex >= ReadyToRunAssemblyHeaders.Count, preventing the out-of-range access when manifest references outnumber assembly headers.Original prompt
This pull request was created from Copilot chat.