Skip to content

ICorDebugGCReferenceEnum.Next fails to return stack references in .NET 8 preview 4 #87239

@gregg-miskelly

Description

@gregg-miskelly

Description

.NET 8 preview 4 seems to have a regression that ICorDebugGCReferenceEnum.Next is no longer returning stack references

Reproduction Steps

  1. Create the following program
  2. Using Visual Studio, set a breakpoint where indicated
  3. When the breakpoint is hit, take a heap snapshot from the Diagnostics tools window
  4. View the snapshot
class MyStringHolder
{
    public readonly string Value;

    public MyStringHolder(string value)
    {
        Value = value;
    }
}

class Program
{
    public static void Main()
    {
        var bigString = new MyStringHolder(new string('*', 1000000));

        Console.WriteLine(bigString.Value.Length); // breakpoint here
    }
}

Expected behavior

'MyStringHolder' should be shown as having the largest inclusive size

Actual behavior

ICorDebugGCReferenceEnum.Next is not returning values for all of the stack variables (references with type CorReferenceStack). I see some from the hot reload thread, but none from the 'Main' function.

Regression?

This worked correctly in .NET 8 preview 3

Known Workarounds

No response

Configuration

I am testing with .NET 8 preview 4 on Windows. Both x86 and x64. I didn't test any other architecture or OS.

Other information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions