Skip to content

crossgen2 AccessViolation in ProfileDataManager.GetAllowSynthesis during win-x86 SDK crossgen layout #125699

@steveisok

Description

@steveisok

Summary

crossgen2 crashes with an AccessViolationException while processing PGO instrumentation data during the SDK crossgen (ReadyToRun) layout step on win-x86. The crash occurs in ILCompiler.ProfileDataManager.GetAllowSynthesis and appears to be a threading/memory corruption issue in the PGO data path.

Crash Stack

Process terminated. Access Violation: Attempted to read or write protected memory.
   at ILCompiler.ProfileDataManager.GetAllowSynthesis(Compilation, MethodDesc, Boolean&) + 0x31
   at Internal.JitInterface.CorInfoImpl.getPgoInstrumentationResults(...) + 0xab
   at Internal.JitInterface.CorInfoImpl._getPgoInstrumentationResults(...) + 0x60
   at Internal.JitInterface.CorInfoImpl.JitCompileMethod(...) + 0xc5
   at Internal.JitInterface.CorInfoImpl.CompileMethodInternal(IMethodNode, MethodIL) + 0xc4
   at Internal.JitInterface.CorInfoImpl.CompileMethod(MethodWithGCInfo, Logger) + 0x3f2
   at ILCompiler.ReadyToRunCodegenCompilation.<>c__DisplayClass50_0.<ComputeDependencyNodeDependencies>g__CompileOneMethod|5(...) + 0x37e
   at ILCompiler.ReadyToRunCodegenCompilation.<>c__DisplayClass50_0.<ComputeDependencyNodeDependencies>g__CompileOnThread|4(Int32) + 0x37
   at ILCompiler.ReadyToRunCodegenCompilation.<>c__DisplayClass50_0.<ComputeDependencyNodeDependencies>g__CompilationThread|3(Object) + 0x43
   at System.Threading.Thread.StartThread(IntPtr)
   at System.Threading.Thread.ThreadEntryPoint(IntPtr)

Build

Analysis

  • The crash is in crossgen2's PGO data processing path during multi-threaded R2R compilation.
  • CompileOnThreadCompileOneMethodgetPgoInstrumentationResultsGetAllowSynthesis suggests multiple compilation threads reading ProfileDataManager state.
  • The AV at GetAllowSynthesis+0x31 likely dereferences a null or corrupt pointer in PGO schema data.
  • x86-only — this targets win-x86 (32-bit). Could be pointer truncation, address space pressure, or an x86-specific codegen bug.
  • Non-deterministic — single occurrence in this window but possibly related to a parallel IBCMerge PGO crash on internal builds (dotnet/dotnet#4138), also x86-only.

Possibly Related

dotnet/dotnet#4138 — IBCMerge BadImageFormatException processing PGO profile data on Windows_Pgo_x86. Different tool (IBCMerge vs crossgen2) but same class of problem: PGO data corruption/crash isolated to x86 platforms.

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions