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
11 changes: 8 additions & 3 deletions src/coreclr/debug/daccess/daccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7978,10 +7978,15 @@ void DacStackReferenceWalker::GCEnumCallback(LPVOID hCallback, OBJECTREF *pObjec
{
CORDB_ADDRESS fixed_obj = 0;
HRESULT hr = dsc->pWalker->mHeap.ListNearObjects((CORDB_ADDRESS)obj, NULL, &fixed_obj, NULL);

// Interior pointers need not lie on the manage heap at all. When this happens, ListNearObjects
// will return E_FAIL. In this case, we need to be sure to not include this stack slot in our
// enumeration because ICorDebug expects every location enumerated by this API to point to a
// valid object.
if (FAILED(hr))
return;

// If we failed...oh well, SOS won't mind. We'll just report the interior pointer as is.
if (SUCCEEDED(hr))
obj = TO_TADDR(fixed_obj);
obj = TO_TADDR(fixed_obj);
}

// Report the object and where it was found.
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/debug/daccess/dacdbiimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7781,8 +7781,9 @@ HRESULT DacStackReferenceWalker::Next(ULONG count, DacGcReference stackRefs[], U
stackRefs[i].i64ExtraData = 0;

const SOSStackRefData &sosStackRef = mList.Get(i);
if (sosStackRef.Flags & GC_CALL_INTERIOR)
if (sosStackRef.Flags & GC_CALL_INTERIOR || sosStackRef.Address == 0)
{
// Direct pointer case - interior pointer, Frame ref, or enregistered var.
stackRefs[i].pObject = CLRDATA_ADDRESS_TO_TADDR(sosStackRef.Object) | 1;
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/di/rsclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ HRESULT CordbClass::GetStaticFieldValue(mdFieldDef fieldDef,
IMetaDataImport * pImport = NULL;
EX_TRY
{
RSLockHolder lockHolder(GetProcess()->GetProcessLock());
pImport = GetModule()->GetMetaDataImporter(); // throws

// Validate the token.
Expand Down Expand Up @@ -1191,4 +1192,3 @@ HRESULT CordbClass::SearchFieldInfo(
// Well, the field doesn't even belong to this class...
ThrowHR(E_INVALIDARG);
}