Skip to content

Disable, by default, CLRConfig settings on DAC builds. #114234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

AaronRobinsonMSFT
Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT commented Apr 3, 2025

The majority of the CLRConfig settings should have no impact on the code in the DAC. During investigation 4 where found but only 2 were still used. This PR removes the 2 unused and creates a new flag that that indicates the setting is valid for the DAC. All others fallback to their default value.

Addresses future issues like #106148.

I would have preferred to assert this state, but there felt like too many places where the querying of a CLRConfig setting is performed. I found three on a simple test case and after considering scenarios like mixed mode, EnC scenarios, et al, I decided to simply log it.

The majority of the CLRConfig settings should have no impact
on the code in the DAC. During investigation 4 where found
but only 2 were still used. This PR removes the 2 unused and
creates a new flag that that indicates the setting is valid for
the DAC. All others fallback to their default value.
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 10.0.0 milestone Apr 3, 2025
@Copilot Copilot AI review requested due to automatic review settings April 3, 2025 18:36
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

This PR disables most CLRConfig settings for DAC builds by removing unused settings and adding a new flag to indicate DAC validity. Key changes include updating configuration initialization to use boolean flags, adding conditional DAC checks in CLRConfig routines, and removing obsolete method sets.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/coreclr/utilcode/util_nodependencies.cpp Updates ConfigDWORD/ConfigString initialization using booleans and removes outdated assertions.
src/coreclr/utilcode/util.cpp Removes unused ConfigMethodSet functions.
src/coreclr/utilcode/clrconfig.cpp Adds DAC-specific checks for config settings via conditional compilation.
src/coreclr/inc/utilcode.h Updates classes to use final keyword and bool for initialization state.
src/coreclr/inc/clrconfigvalues.h Reworks config macros to conditionally include DAC-specific settings.
src/coreclr/inc/clrconfig.h Introduces a new flag for DAC build validity.

Copy link
Contributor

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

@AaronRobinsonMSFT
Copy link
Member Author

/cc @dotnet/dotnet-diag

@AaronRobinsonMSFT
Copy link
Member Author

AaronRobinsonMSFT commented Apr 4, 2025

@dotnet/dotnet-diag I'd like to get confirmation on the following sets of CLRConfig settings you'd like to see in the DAC.

Keep
INTERNAL_LogEnable
INTERNAL_LogFacility
EXTERNAL_LogLevel
INTERNAL_LogFileAppend
INTERNAL_LogFlushFile
INTERNAL_LogToDebugger
INTERNAL_LogToFile
INTERNAL_LogToConsole
INTERNAL_LogFacility2
INTERNAL_LogFile
INTERNAL_LogWithPid

Remove
EXTERNAL_DisableConfigCache
INTERNAL_AssertOnBadImageFormat
INTERNAL_LoaderHeapCallTracing
EXTERNAL_ProfAPI_RejitOnAttach
INTERNAL_ForceRelocs
EXTERNAL_ProcessorCount
EXTERNAL_Thread_UseAllCpuGroups
EXTERNAL_Thread_AssignCpuGroups
EXTERNAL_GCCpuGroup
INTERNAL_GetAssemblyIfLoadedIgnoreRidMap
EXTERNAL_JitName
EXTERNAL_InterpreterName
UNSUPPORTED_legacyCorruptedStateExceptionsPolicy
INTERNAL_MD_RegMetaDump
INTERNAL_MD_RegMetaBreak
INTERNAL_MD_KeepKnownCA
INTERNAL_MD_EncDelta
INTERNAL_MD_MiniMDBreak
INTERNAL_MD_PreSaveBreak
INTERNAL_MD_ApplyDeltaBreak
INTERNAL_MD_DeltaCheck
INTERNAL_ContinueOnAssert
INTERNAL_BreakOnHR
INTERNAL_AssertStacktrace
UNSUPPORTED_DbgSkipStackCheck
INTERNAL_InjectFault

@AaronRobinsonMSFT
Copy link
Member Author

Making these fail at compile time is not useful nor going to result in something simple. I'm closing this PR.

@AaronRobinsonMSFT AaronRobinsonMSFT deleted the runtime_106148 branch April 4, 2025 20:46
@github-actions github-actions bot locked and limited conversation to collaborators May 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Diagnostics-coreclr NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants