Skip to content

Commit 82d1e68

Browse files
Copilotnoahfalk
andauthored
Distinguish memory read failures from corrupt method tables in SOS error messages (#5680)
SOS commands like `!dumpheap -stat` throw identical error messages for two distinct failure modes: memory read failures vs. successfully reading a zero/invalid MethodTable. These require different diagnostic approaches. NOTE: LLDB reports missing memory as if it were zeroed memory so SOS is still going to claim corrupt method tables in place of missing memory there. Co-authored-by: noahfalk <[email protected]>
1 parent 4d81a12 commit 82d1e68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SOS/Strike/sos.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ namespace sos
103103
{
104104
TADDR temp;
105105
if (FAILED(MOVE(temp, mAddress)))
106-
sos::Throw<DataRead>("Object %s has an invalid method table.", DMLListNearObj(mAddress));
106+
sos::Throw<DataRead>("Failed to read memory at Object %s.", DMLListNearObj(mAddress));
107107

108108
if (temp == (TADDR)0)
109-
sos::Throw<HeapCorruption>("Object %s has an invalid method table.", DMLListNearObj(mAddress));
109+
sos::Throw<HeapCorruption>("Object %s has a corrupt method table.", DMLListNearObj(mAddress));
110110

111111
mMT = temp & ~METHODTABLE_PTR_LOW_BITMASK;
112112
}

0 commit comments

Comments
 (0)