Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/SOS/Strike/strike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ DECLARE_API(DumpMT)

table.WriteRow("Entry", "MethodDesc", "JIT", "Slot", "Name");

ISOSMethodEnum *pMethodEnumerator;
ToRelease<ISOSMethodEnum> pMethodEnumerator;
Copy link
Member

Choose a reason for hiding this comment

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

What's going to happen when latest SOS with this change runs against older DAC? Is it going to just leak (that's ok) or crash (that's bad)?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is unrelated to the changes in dotnet/runtime#125231 . This was a standard leak where the COM interface was never freed. It should not cause a problem with either DAC version

if (SUCCEEDED(g_sos15->GetMethodTableSlotEnumerator(dwStartAddr, &pMethodEnumerator)))
{
SOSMethodData entry;
Expand Down
12 changes: 7 additions & 5 deletions src/SOS/Strike/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3644,7 +3644,7 @@ class SOSDacInterface15Simulator : public ISOSDacInterface15
unsigned int slotCount;
ULONG refCount;
public:
SOSMethodEnum(CLRDATA_ADDRESS mt) : pMT(mt), refCount(1)
SOSMethodEnum(CLRDATA_ADDRESS mt) : pMT(mt), refCount(0)
{
}

Expand Down Expand Up @@ -3769,16 +3769,18 @@ class SOSDacInterface15Simulator : public ISOSDacInterface15
ISOSMethodEnum **enumerator)
{
SOSMethodEnum *simulator = new(std::nothrow) SOSMethodEnum(mt);
*enumerator = simulator;
if (simulator == NULL)
{
return E_OUTOFMEMORY;
}
HRESULT hr = simulator->Reset();

if (SUCCEEDED(hr))
hr = simulator->QueryInterface(__uuidof(ISOSMethodEnum), (void**)enumerator);

if (FAILED(hr))
{
simulator->Release();
}
delete simulator;

return hr;
}
} SOSDacInterface15Simulator_Instance;
Expand Down
Loading