Skip to content

Fix PEAssembly layout in native DAC builds - #135101

Merged
hoyosjs merged 1 commit into
dotnet:mainfrom
max-charlamb:max-charlamb/fix-peassembly-dac-layout
Oct 2, 2026
Merged

hoyosjs merged 1 commit into
dotnet:mainfrom
max-charlamb:max-charlamb/fix-peassembly-dac-layout

Conversation

@max-charlamb

Copy link
Copy Markdown
Member

Summary

Use PROFILING_SUPPORTED_DATA instead of PROFILING_SUPPORTED to guard the PEAssembly::m_pImporter and m_pEmitter instance fields.

#134875 made these fields conditional on PROFILING_SUPPORTED, which is not defined in native DAC builds. This shifted the DAC's view of subsequent fields, including m_pAssemblyBinder, and caused dumpalc to report Failed to get the AssemblyLoadContext.

PROFILING_SUPPORTED_DATA is defined for both the profiling-enabled runtime and its DAC, preserving their matching layouts without enabling profiler functionality in the DAC.

Validation

  • Windows x64 Release runtime/DAC build: .\build.cmd -subset clr.runtime -c Release succeeded with zero warnings or errors.
  • Captured a dump of a minimal managed object in the default ALC using the unfixed runtime. Native SOS dumpalc reproduced Failed to get the AssemblyLoadContext.
  • Replaced only mscordaccore.dll with the fixed DAC and analyzed the same dump with the same SOS. dumpalc returned Name: System.Runtime.Loader.DefaultAssemblyLoadContext.
  • The full SOS suite and other architectures were not run locally.

Resolves #135075

Note

This PR description and fix were prepared with GitHub Copilot.

Use PROFILING_SUPPORTED_DATA for profiler-related instance fields so native DAC and runtime builds retain the same PEAssembly layout.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 593f81fe-227d-480b-9da0-38ddeea24fd9
@max-charlamb

max-charlamb commented Oct 2, 2026 •

Copy link
Copy Markdown
Member Author

/azp run runtime-diagnostics

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@azure-pipelines

Copy link
Copy Markdown
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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.

@max-charlamb

Copy link
Copy Markdown
Member Author

/ba-g unblock CI

@max-charlamb
max-charlamb enabled auto-merge (squash) October 2, 2026 16:15
@max-charlamb
max-charlamb disabled auto-merge October 2, 2026 16:33
@max-charlamb

Copy link
Copy Markdown
Member Author

/ba-g unblocking CI

@max-charlamb
max-charlamb enabled auto-merge (squash) October 2, 2026 16:34
@max-charlamb
max-charlamb disabled auto-merge October 2, 2026 16:38
@hoyosjs
hoyosjs merged commit fcaee07 into dotnet:main Oct 2, 2026
111 of 113 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ci-scan] Test failure: SOS.Tests.ObjectGcHelperTests.DumpAlc_ResolvesDefaultLoadContext

3 participants