Skip to content

Conversation

davidwrighton
Copy link
Member

@davidwrighton davidwrighton commented Jul 1, 2025

Reverts #117037 This breaks debugging basics.

Notably, enumerating the list of assemblies results in an infinite loop as it builds more and more CorDbAssembly objects.

Copy link
Contributor

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

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Reverts previous PR (#117037) that replaced thread-specific domain lookup with a single-domain model, restoring per-thread GetCurrentAppDomain behavior and introducing a shared default AppDomain fallback.

  • Updated IDacDbiInterface and its implementation to take a vmThread parameter for GetCurrentAppDomain.
  • Modified all callers in CordbThread, CordbProcess, and related classes to pass their thread token.
  • Added GetSharedAppDomain, m_sharedAppDomain fallback, and UpdateThreadsForAdUnload to manage default domain unloading and thread cleanup.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/coreclr/debug/inc/dacdbiinterface.h Changed GetCurrentAppDomain to accept a vmThread argument.
src/coreclr/debug/di/rsthread.cpp Updated calls to GetCurrentAppDomain with vmThread.
src/coreclr/debug/di/rspriv.h Adjusted CacheAssembly overload signatures; renamed GetAppDomain.
src/coreclr/debug/di/rsappdomain.cpp Refactored assembly caching/removal to use VMPTR_DomainAssembly.
src/coreclr/debug/di/process.cpp Added m_sharedAppDomain, GetSharedAppDomain, and thread cleanup.
src/coreclr/debug/di/module.cpp Fallback to GetSharedAppDomain when no DomainAssembly is available.
src/coreclr/debug/daccess/dacdbiimpl.h/.cpp Added thread-parameter overload for GetCurrentAppDomain.

Copy link
Member

@elinor-fung elinor-fung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I only tried VS and SOS unit tests as basic testing, which apparently don't go down the broken path. Clearly needed windbg too.

@elinor-fung
Copy link
Member

elinor-fung commented Jul 2, 2025

#117221 is the fix for assemblies not being found in the cache. Assuming this goes in first, I'll update that to be the revert of the revert.

@davidwrighton davidwrighton merged commit a3929e2 into main Jul 2, 2025
104 of 113 checks passed
elinor-fung added a commit to elinor-fung/runtime that referenced this pull request Jul 2, 2025
@hoyosjs hoyosjs deleted the revert-117037-noSharedDomain-cordb branch July 2, 2025 00:22
@github-actions github-actions bot locked and limited conversation to collaborators Aug 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants