Skip to content

Crossgen2 composite with JitOptimization causes R2R dump failures on linux #114504

@AndyAyersMS

Description

@AndyAyersMS

If we enable optimization in crossgen2-composite tests, we get invalid RVA failures in R2R dump on Linux.

https://dev.azure.com/dnceng-public/public/_build/results?buildId=1012253&view=ms.vss-test-web.build-test-results-tab

(part of #114464)

For example

Running CrossGen2:  /tmp/helix/working/A242093B/p/crossgen2/crossgen2 @/private/tmp/helix/working/A242093B/w/B7F50969/e/JIT/Intrinsics/CreateSpan_il/composite-r2r.dll.rsp  --composite 
Emitting R2R PE file: /private/tmp/helix/working/A242093B/w/B7F50969/e/JIT/Intrinsics/CreateSpan_il/composite-r2r.dll
Emitting R2R PE file: /private/tmp/helix/working/A242093B/w/B7F50969/e/JIT/Intrinsics/CreateSpan_il/CreateSpan_il.dll
Running R2RDump:  dotnet /tmp/helix/working/A242093B/p/R2RDump/R2RDump.dll --header --sc --in /private/tmp/helix/working/A242093B/w/B7F50969/e/JIT/Intrinsics/CreateSpan_il/composite-r2r.dll --out /private/tmp/helix/working/A242093B/w/B7F50969/e/JIT/Intrinsics/CreateSpan_il/composite-r2r.dll.r2rdump --val
Error: System.BadImageFormatException: Failed to convert invalid RVA to offset: 66830
   at ILCompiler.Reflection.ReadyToRun.PEReaderExtensions.GetOffset(PEReader reader, Int32 rva) in /_/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/PEReaderExtensions.cs:line 113
   at ILCompiler.Reflection.ReadyToRun.ReadyToRunReader.EnsureImportSections() in /_/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs:line 1497
   at R2RDump.TextDumper.DumpSectionContents(ReadyToRunSection section) in /_/src/coreclr/tools/r2rdump/TextDumper.cs:line 435
   at R2RDump.TextDumper.DumpSection(ReadyToRunSection section) in /_/src/coreclr/tools/r2rdump/TextDumper.cs:line 120
   at R2RDump.TextDumper.DumpHeader(Boolean dumpSections) in /_/src/coreclr/tools/r2rdump/TextDumper.cs:line 81
   at R2RDump.Program.Dump(ReadyToRunReader r2r) in /_/src/coreclr/tools/r2rdump/Program.cs:line 166
   at R2RDump.Program.Run() in /_/src/coreclr/tools/r2rdump/Program.cs:line 460

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions