Skip to content

Why can't I use WinDbg to debug a dotnet project which relies on Windows SDK? #6129

@catmanjan

Description

@catmanjan

Describe the bug

I am trying to investigate a heap corruption issue in a project but windbg kept stopping early due to CLR exceptions

To rule out my own code, I created a blank new project and I still get the issue

Steps to reproduce the bug

  1. I will attach the sample project below
  2. Here is the output from windbg:
windbg -o WinUiBlankApp.exe


************* Preparing the environment for Debugger Extensions Gallery repositories **************
   ExtensionRepository : Implicit
   UseExperimentalFeatureForNugetShare : true
   AllowNugetExeUpdate : true
   NonInteractiveNuget : true
   AllowNugetMSCredentialProviderInstall : true
   AllowParallelInitializationOfLocalRepositories : true

   EnableRedirectToV8JsProvider : false

   -- Configuring repositories
      ----> Repository : LocalInstalled, Enabled: true
      ----> Repository : UserExtensions, Enabled: true

>>>>>>>>>>>>> Preparing the environment for Debugger Extensions Gallery repositories completed, duration 0.032 seconds

************* Waiting for Debugger Extensions Gallery to Initialize **************

>>>>>>>>>>>>> Waiting for Debugger Extensions Gallery to Initialize completed, duration 0.031 seconds
   ----> Repository : UserExtensions, Enabled: true, Packages count: 0
   ----> Repository : LocalInstalled, Enabled: true, Packages count: 29

Microsoft (R) Windows Debugger Version 10.0.26100.7175 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.

CommandLine: WinUiBlankApp.exe

************* Path validation summary **************
Response                         Time (ms)     Location
Deferred                                       srv*
Symbol search path is: srv*
Executable search path is: 

+------------------------------------------------------------------------+
| This target supports Hardware-enforced Stack Protection. A HW based    |
| "Shadow Stack" may be available to assist in debugging and analysis.   |
| See aka.ms/userhsp for more info.                                      |
|                                                                        |
| dps @ssp                                                               |
|                                                                        |
+------------------------------------------------------------------------+

ModLoad: 00007ff6`0e160000 00007ff6`0e18a000   apphost.exe
ModLoad: 00007ffb`1d380000 00007ffb`1d5e7000   ntdll.dll
ModLoad: 00007ffb`1c420000 00007ffb`1c4e9000   C:\WINDOWS\System32\KERNEL32.DLL
ModLoad: 00007ffb`1a590000 00007ffb`1a97f000   C:\WINDOWS\System32\KERNELBASE.dll
ModLoad: 00007ffb`1cac0000 00007ffb`1cc85000   C:\WINDOWS\System32\USER32.dll
ModLoad: 00007ffb`1aa40000 00007ffb`1aa67000   C:\WINDOWS\System32\win32u.dll
ModLoad: 00007ffb`1c8a0000 00007ffb`1c8cb000   C:\WINDOWS\System32\GDI32.dll
ModLoad: 00007ffb`1ac70000 00007ffb`1ad9c000   C:\WINDOWS\System32\gdi32full.dll
ModLoad: 00007ffb`1a990000 00007ffb`1aa33000   C:\WINDOWS\System32\msvcp_win.dll
ModLoad: 00007ffb`1ada0000 00007ffb`1aeeb000   C:\WINDOWS\System32\ucrtbase.dll
ModLoad: 00007ffb`1b3d0000 00007ffb`1bb23000   C:\WINDOWS\System32\SHELL32.dll
ModLoad: 00007ffb`1ab00000 00007ffb`1ac6a000   C:\WINDOWS\System32\wintypes.dll
ModLoad: 00007ffb`1c4f0000 00007ffb`1c875000   C:\WINDOWS\System32\combase.dll
ModLoad: 00007ffb`1c080000 00007ffb`1c198000   C:\WINDOWS\System32\RPCRT4.dll
ModLoad: 00007ffb`1c2f0000 00007ffb`1c3a4000   C:\WINDOWS\System32\ADVAPI32.dll
ModLoad: 00007ffb`1c8d0000 00007ffb`1c979000   C:\WINDOWS\System32\msvcrt.dll
ModLoad: 00007ffb`1bd10000 00007ffb`1bdb6000   C:\WINDOWS\System32\sechost.dll
(4894.5110): Break instruction exception - code 80000003 (first chance)
ntdll!LdrpDoDebuggerBreak+0x35:
00007ffb`1d49f4ed cc              int     3
0:000> g
ModLoad: 00007ffb`1bef0000 00007ffb`1bf21000   C:\WINDOWS\System32\IMM32.DLL
ModLoad: 00007ffa`2d7f0000 00007ffa`2d84c000   C:\Users\sysadmin\source\repos\WinUiBlankApp\bin\x64\Debug\net8.0-windows10.0.19041.0\win-x64\hostfxr.dll
ModLoad: 00007ff9`f4650000 00007ff9`f46b6000   C:\Users\sysadmin\source\repos\WinUiBlankApp\bin\x64\Debug\net8.0-windows10.0.19041.0\win-x64\hostpolicy.dll
ModLoad: 00007ff9`efba0000 00007ff9`f007c000   C:\Users\sysadmin\source\repos\WinUiBlankApp\bin\x64\Debug\net8.0-windows10.0.19041.0\win-x64\coreclr.dll
ModLoad: 00007ffb`1cc90000 00007ffb`1ce27000   C:\WINDOWS\System32\ole32.dll
ModLoad: 00007ffb`1bfa0000 00007ffb`1c076000   C:\WINDOWS\System32\OLEAUT32.dll
ModLoad: 00007ffb`1b070000 00007ffb`1b115000   C:\WINDOWS\System32\bcryptPrimitives.dll
(4894.5110): Unknown exception - code 04242420 (first chance)
ModLoad: 00007ff9`eece0000 00007ff9`ef96e000   C:\Users\sysadmin\source\repos\WinUiBlankApp\bin\x64\Debug\net8.0-windows10.0.19041.0\win-x64\System.Private.CoreLib.dll
ModLoad: 00007ff9`eeb20000 00007ff9`eecd6000   C:\Users\sysadmin\source\repos\WinUiBlankApp\bin\x64\Debug\net8.0-windows10.0.19041.0\win-x64\clrjit.dll
ModLoad: 00007ffb`19240000 00007ffb`1925b000   C:\WINDOWS\SYSTEM32\kernel.appcore.dll
ModLoad: 000001fa`00600000 000001fa`0060c000   C:\Users\sysadmin\source\repos\WinUiBlankApp\bin\x64\Debug\net8.0-windows10.0.19041.0\win-x64\WinUiBlankApp.dll
ModLoad: 000001fa`00600000 000001fa`0060c000   C:\Users\sysadmin\source\repos\WinUiBlankApp\bin\x64\Debug\net8.0-windows10.0.19041.0\win-x64\WinUiBlankApp.dll
ModLoad: 000001fa`76c30000 000001fa`76c3e000   C:\Users\sysadmin\source\repos\WinUiBlankApp\bin\x64\Debug\net8.0-windows10.0.19041.0\win-x64\System.Runtime.dll
ModLoad: 00007ffb`176f0000 00007ffb`1779b000   C:\WINDOWS\system32\uxtheme.dll
ModLoad: 000001fa`76c40000 000001fa`76c50000   C:\Users\sysadmin\source\repos\WinUiBlankApp\bin\x64\Debug\net8.0-windows10.0.19041.0\win-x64\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection.dll
ModLoad: 00007ffa`94af0000 00007ffa`94b05000   C:\Users\sysadmin\source\repos\WinUiBlankApp\bin\x64\Debug\net8.0-windows10.0.19041.0\win-x64\System.Runtime.InteropServices.dll
ModLoad: 000001fa`78390000 000001fa`78414000   C:\Users\sysadmin\source\repos\WinUiBlankApp\bin\x64\Debug\net8.0-windows10.0.19041.0\win-x64\WinRT.Runtime.dll
ModLoad: 00007ffa`2ad00000 00007ffa`2ad41000   C:\Users\sysadmin\source\repos\WinUiBlankApp\bin\x64\Debug\net8.0-windows10.0.19041.0\win-x64\System.Collections.Concurrent.dll
ModLoad: 00007ff9`f4940000 00007ff9`f497d000   C:\Users\sysadmin\source\repos\WinUiBlankApp\bin\x64\Debug\net8.0-windows10.0.19041.0\win-x64\System.Collections.dll
ModLoad: 00007ffa`66d60000 00007ffa`66d84000   C:\Users\sysadmin\source\repos\WinUiBlankApp\bin\x64\Debug\net8.0-windows10.0.19041.0\win-x64\System.Memory.dll
ModLoad: 00007ffa`66de0000 00007ffa`66df2000   C:\Users\sysadmin\source\repos\WinUiBlankApp\bin\x64\Debug\net8.0-windows10.0.19041.0\win-x64\System.Threading.dll
ModLoad: 00007ffb`1b310000 00007ffb`1b3c0000   C:\WINDOWS\System32\clbcatq.dll
ModLoad: 00007ffa`fe3b0000 00007ffa`fe64e000   C:\WINDOWS\SYSTEM32\icu.dll
(4894.5110): CLR exception - code e0434352 (first chance)
ModLoad: 00007ffb`11c60000 00007ffb`11c6b000   C:\WINDOWS\SYSTEM32\VERSION.dll
(4894.5110): CLR exception - code e0434352 (first chance)
(4894.5110): C++ EH exception - code e06d7363 (first chance)
(4894.5110): CLR exception - code e0434352 (first chance)
(4894.5110): CLR exception - code e0434352 (!!! second chance !!!)
KERNELBASE!RaiseException+0x8a:
00007ffb`1a65782a 0f1f440000      nop     dword ptr [rax+rax]

sample.zip

Expected behavior

No response

Screenshots

No response

NuGet package version

None

Packaging type

No response

Windows version

No response

IDE

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions