Skip to content

SOS dumpheap error doesn't distinguish missing memory from corrupt memory #5679

@noahfalk

Description

@noahfalk

A user might run the SOS command "!dumpheap -stat" and see an error message:

Object <exec cmd="!ListNearObj /d 0000017ad8c00028">0000017ad8c00028</exec> has an invalid method table

This error message occurs when SOS observes a zero valued MethodTable for an object, but it doesn't distinguish whether the memory failed to be read or the memory was successfully read and the MethodTable pointer was bad. It would be very useful to distinguish those because the steps to resolve each of those issues is completely different.

Internally it appears SOS does actually distinguish the two cases, but then it emits an identical error message for both so the user doesn't know which one occured.

if (FAILED(MOVE(temp, mAddress)))
sos::Throw<DataRead>("Object %s has an invalid method table.", DMLListNearObj(mAddress));
if (temp == (TADDR)0)
sos::Throw<HeapCorruption>("Object %s has an invalid method table.", DMLListNearObj(mAddress));

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions