You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cDAC: Loader_1.GetModuleHandles inverts the IncludeAvailableToProfilers check #135469
Loader_1.GetModuleHandles (src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Loader_1.cs, line 98) has:
if((assembly.NotifyFlags&ASSEMBLY_NOTIFYFLAGS_PROFILER_NOTIFIED)!=0&&!iterationFlags.HasFlag(AssemblyIterationFlags.IncludeAvailableToProfilers)){// The assembly has reached the state at which we would notify profilers,// and we're supposed to include such assemblies in the enumeration. So// don't reject it ...}
The native iterator it mirrors, AppDomain::AssemblyIterator::Next_Unlocked (src/coreclr/vm/appdomain.cpp, line 3807), tests the flag the other way round:
if (pAssembly->IsAvailableToProfilers() &&
(m_assemblyIterationFlags & kIncludeAvailableToProfilers))
So in the cDAC, a profiler-notified assembly skips the loaded/loading checks when the caller did not pass IncludeAvailableToProfilers, and is filtered normally when it did. No cDAC caller passes that flag today, so only the first half is reachable: for every current caller, notified assemblies bypass the IncludeLoaded/IncludeLoading filter. Whether that changes a result depends on whether a notified assembly can still be loading at that point. A future caller that passes IncludeAvailableToProfilers alone would get no notified assemblies.
The pseudocode in docs/design/datacontracts/Loader.md (around line 329) has the same inversion.
Found by reading the code, not from a failing test; main at 98a24e3.
Activity
dotnet-policy-service commentedon Oct 9, 2026
Tagging subscribers to this area: @agocke, @elinor-fung
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Oct 9, 2026
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.
cDAC: fix inverted IncludeAvailableToProfilers check in Loader_1.GetM…