Skip to content

[DAC][ReJIT] ReJitManager::IsReJITEnabled checked DOTNET_ProfAPI_RejitOnAttach in the wrong environment #106148

@lambdageek

Description

@lambdageek

When running in the DAC, ReJitManager::IsReJITEnabled checks the configuration environment variable in the environment of the debugger process, not in the target process:

inline BOOL ReJitManager::IsReJITEnabled()
{
LIMITED_METHOD_CONTRACT;
static bool profilerStartupRejit = CORProfilerEnableRejit() != FALSE;
static ConfigDWORD rejitOnAttachEnabled;
return profilerStartupRejit || (rejitOnAttachEnabled.val(CLRConfig::EXTERNAL_ProfAPI_RejitOnAttach) != 0);
}

The CLRConfig::GetConfigString (called by ConfigDWORD::val) checks the environment of the current process (the one in which the DAC is loaded), not the target runtime.
Whenever this is fixed please remember to fix the cDAC implementation as well as the DAC.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions