Skip to content
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

[cdac] Always re-read global pointers in GetUsefulGlobals #110633

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/native/managed/cdacreader/src/Legacy/SOSDacImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ internal sealed unsafe partial class SOSDacImpl
private readonly Target _target;

// When this class is created, the runtime may not have loaded the string and object method tables and set the global pointers.
// They should be set when actually requested via a DAC API, so we lazily read the global pointers.
// This is also the case for the GetUsefulGlobals API, which can be called as part of load notifications before runtime start.
// They should be set when actually requested via other DAC APIs, so we lazily read the global pointers.
private readonly Lazy<TargetPointer> _stringMethodTable;
private readonly Lazy<TargetPointer> _objectMethodTable;

Expand Down Expand Up @@ -1241,8 +1242,10 @@ int ISOSDacInterface.GetUsefulGlobals(DacpUsefulGlobalsData* data)
{
data->ArrayMethodTable = _target.ReadPointer(
_target.ReadGlobalPointer(Constants.Globals.ObjectArrayMethodTable));
data->StringMethodTable = _stringMethodTable.Value;
data->ObjectMethodTable = _objectMethodTable.Value;
data->StringMethodTable = _target.ReadPointer(
_target.ReadGlobalPointer(Constants.Globals.StringMethodTable));
data->ObjectMethodTable = _target.ReadPointer(
_target.ReadGlobalPointer(Constants.Globals.ObjectMethodTable));
data->ExceptionMethodTable = _target.ReadPointer(
_target.ReadGlobalPointer(Constants.Globals.ExceptionMethodTable));
data->FreeMethodTable = _target.ReadPointer(
Expand Down
Loading