Skip to content

ICorDebugStackWalk.GetFrame fails in minidump without heap/binaries in .NET 10 preview 7+ #119921

@gregg-miskelly

Description

@gregg-miskelly

Description

There was a regression that I believe happened in .NET 10 preview 7, though I am seeing more tests fail with this problem in rc1, so I am not totally sure, which we have a number of tests that save minidumps without heap, and stack walk will fail with no frames.

The failure happens here:

mscordaccore.dll!DacError
mscordaccore.dll!DacInstantiateTypeByAddressHelper
[Inline Frame] mscordaccore.dll!NibbleReader::ReadNibble_NoThrow
mscordaccore.dll!NibbleReader::ReadEncodedU32_NoThrow
mscordaccore.dll!DoNativeVarInfo<TransferReader>
mscordaccore.dll!CompressDebugInfo::RestoreBoundariesAndVars
[Inline Frame] mscordaccore.dll!EECodeGenManager::GetBoundariesAndVarsWorker
mscordaccore.dll!EEJitManager::GetBoundariesAndVars
[Inline Frame] mscordaccore.dll!DebugInfoManager::GetBoundariesAndVars
mscordaccore.dll!DacDbiInterfaceImpl::GetNativeVarData
mscordaccore.dll!DacDbiInterfaceImpl::GetNativeCodeSequencePointsAndVarInfo
mscordbi.dll!CordbNativeCode::LoadNativeInfo
mscordbi.dll!CordbStackWalk::GetFrameWorker
mscordbi.dll!CordbStackWalk::GetFrame

GetFrame will wind up returning HRESULT_FROM_WIN32(ERROR_PARTIAL_COPY)

Reproduction Steps

  1. Create a new console app with the following code
  2. Build it and run it under a managed debugger
  3. This should stop on the Debugger.Break
  4. Save a minidump without heap. In Visual Studio, this can be done using Debug->Save Dump As, and changing the 'Save as type' to 'Minidump'
  5. Stop debugging
  6. Open the dump file and attempt to debug it
using System;
using System.Diagnostics;

static class Program
{
    static public void Main()
    {
        int intValue = 42;
        string stringValue = "Hello, World!";

        PrintValues(intValue, stringValue);
    }

    static void PrintValues(int intValue, string stringValue)
    {
        int length = stringValue.Length;
        Debugger.Break();
        Console.WriteLine($"intValue: {intValue}");
        Console.WriteLine($"stringValue: {stringValue} (length = {length})");
    }
}

Expected behavior

The stack walker should be able to successfully unwind the stack

Actual behavior

No frames are unwound

Regression?

Yes. I saw one failure like this in .NET 10 preview 7, and now several in rc1.

Known Workarounds

None, aside from using full memory dumps

Configuration

I am seeing this on Windows x86 and x64. I didn't try any other platforms.

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