Skip to content

[Build Failure] Crossgen2 AccessViolationException in Dictionary<Utf8String,_>.FindValue during maccatalyst-arm64 R2R build #134157

Description

@AndyAyersMS

Description

The maccatalyst-arm64 Release AllSubsets_CoreCLR_Smoke CI job intermittently fails during R2R compilation of test binaries with a crossgen2 crash:

Microsoft.NET.CrossGen.targets(497,5): error : Fatal error.
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at Internal.Text.Utf8String.GetHashCode()
   at System.Collections.Generic.Dictionary`2[[Internal.Text.Utf8String, ILCompiler.ReadyToRun, ...],[System.__Canon, ...]].FindValue(Internal.Text.Utf8String)
   at ILCompiler.ObjectWriter.ObjectWriter.GetUndefinedSymbols()
   at ILCompiler.ObjectWriter.ObjectWriter.EmitObject(System.IO.Stream, ...)
   at ILCompiler.DependencyAnalysis.ReadyToRunObjectWriter.EmitReadyToRunObjects(...)
   at ILCompiler.DependencyAnalysis.ReadyToRunObjectWriter.EmitObject(...)
   at ILCompiler.ReadyToRunCodegenCompilation.Compile(System.String)
   at ILCompiler.Program.RunSingleCompilation(...)
   at ILCompiler.Program.Run()
   at ILCompiler.Program.Main(System.String[])

Failing project: src/tests/FunctionalTests/iOS/Simulator/CoreCLR/iOS.CoreCLR.R2R.Test.csproj

Observed build: Build 1598031, job maccatalyst-arm64 Release AllSubsets_CoreCLR_Smoke, from PR #133915.

Environment / execution details

  • This leg cross-compiles for maccatalyst-arm64 from an x64 host (CLR_CROSS_COMPONENTS_BUILD=1, -hostarch x64 -hostos osx).
  • Crossgen2 runs self-contained, hosted by the bootstrap SDK 11.0.100-rc.1.26420.103 (downloaded from ci.dot.net) -- not a runtime built from the triggering PR. Only the cross-targeting JIT component (clrjit_unix_x64_arm64) used to emit the target arm64 code comes from the PR's own source tree.
  • The crash is inside crossgen2's own process (ILCompiler.ObjectWriter), hashing symbol names in a Dictionary<Utf8String,_> while emitting R2R objects -- not in JIT-generated target code.

Evidence this is likely a transient/environment issue rather than a regression

  • The same job succeeded on the immediately preceding CI run of the same PR (Build 1596791), whose source tree differed only by comment-only changes and one narrow JIT loop-cloning condition tweak unrelated to crossgen2's own hot paths.
  • main branch builds around the same time also pass this job.
  • AccessViolationException surfacing in generic dictionary/hash-code code is a classic signature of transient memory corruption (e.g., GC/JIT interaction, host environment issue) rather than a deterministic code defect.
  • No known-issue match was found in Build Analysis for this exact stack trace, and no matching issue was found searching dotnet/runtime.

Additional occurrences

Reporter has observed what may be the same failure recurring in other, unrelated PR builds -- please check Build Analysis / this stack trace against other builds and link them here if they match.

Ask

Please advise if this is a known flake, or if further investigation (e.g., crash dump analysis) is warranted. Filing so it can be tracked/matched against future occurrences.

Note

This issue was drafted with AI assistance (GitHub Copilot).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-ReadyToRununtriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions