提问人:Enescan BEKTAŞ 提问时间:6/1/2023 最后编辑:Enescan BEKTAŞ 更新时间:6/2/2023 访问量:100
bpmd WinDbg 断点出现访问冲突错误
!bpmd WinDbg Breakpoint Gives An Access violation Error
问:
我只想在一行中添加一个断点。我使用代码“!mbp Program.cs 5”获取该线程的答案。但在那之后,它会给出“无法加载共享 AppDomain 的 App Domain 数据。错误 = 0x80070057“错误。谁能教我做错了什么?
编辑1: sosex 与 .NET 7 不兼容,因此它给出了此错误。之后,我尝试了bpmd命令。我在 TestClass.Example() void 中添加了断点。断点可以工作,但在断点执行后,它会给出“访问冲突 - 代码 c0000005(第一次机会)”错误。我做错了什么?
编辑2: BPMD(SOS) 与 .NET7 不兼容。所以我降级到 .net 6 并且 bpmd 工作正常。但我一点都不明白。在 .net7 项目中,我可以将 bpmd 用于 System.String.Contains 方法,并且它可以正常工作。System.String.Contains 方法包含在 System.Private.CoreLib.dll 中。那么,当我的方法 (TestClass.Example()) 出现错误时,这是如何正常工作的呢?System.Private.CoreLib.dll 没有与 .net7 一起构建,还是有其他原因?
代码块。
namespace TestApp
{
class Program
{
private static void Main()
{
var testClass = new TestClass();
Console.ReadLine();
testClass.Example();
}
}
public class TestClass
{
public int X;
public void Example()
{
Console.WriteLine(X++);
}
}
}
WinDbg 输出。
************* Preparing the environment for Debugger Extensions Gallery repositories **************
ExtensionRepository : Implicit
UseExperimentalFeatureForNugetShare : false
AllowNugetExeUpdate : false
- Configuring repositories
----> Repository : LocalInstalled, Enabled: true
----> Repository : UserExtensions, Enabled: true
************* Waiting for Debugger Extensions Gallery to Initialize **************
.
----> Repository : UserExtensions, Enabled: true, Packages count: 0
----> Repository : LocalInstalled, Enabled: true, Packages count: 36
Microsoft (R) Windows Debugger Version 10.0.25324.1001 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.
CommandLine: C:\Users\Loord\RiderProjects\TestApp\TestApp\bin\Debug\net7.0\TestApp.exe
************* Path validation summary **************
Response Time (ms) Location
Deferred srv*
Symbol search path is: srv*
Executable search path is:
ModLoad: 00007ff7`07660000 00007ff7`0768b000 apphost.exe
ModLoad: 00007ffe`a8870000 00007ffe`a8a65000 ntdll.dll
ModLoad: 00007ffe`a84f0000 00007ffe`a85ad000 C:\Windows\System32\KERNEL32.DLL
ModLoad: 00007ffe`a6430000 00007ffe`a66f8000 C:\Windows\System32\KERNELBASE.dll
ModLoad: 00007ffe`a85b0000 00007ffe`a8750000 C:\Windows\System32\USER32.dll
ModLoad: 00007ffe`a6170000 00007ffe`a6192000 C:\Windows\System32\win32u.dll
ModLoad: 00007ffe`a8010000 00007ffe`a803a000 C:\Windows\System32\GDI32.dll
ModLoad: 00007ffe`a6060000 00007ffe`a616b000 C:\Windows\System32\gdi32full.dll
ModLoad: 00007ffe`a6700000 00007ffe`a679d000 C:\Windows\System32\msvcp_win.dll
ModLoad: 00007ffe`a6330000 00007ffe`a6430000 C:\Windows\System32\ucrtbase.dll
ModLoad: 00007ffe`a7090000 00007ffe`a77d2000 C:\Windows\System32\SHELL32.dll
ModLoad: 00007ffe`a7e80000 00007ffe`a7f2c000 C:\Windows\System32\ADVAPI32.dll
ModLoad: 00007ffe`a6a60000 00007ffe`a6afe000 C:\Windows\System32\msvcrt.dll
ModLoad: 00007ffe`a8450000 00007ffe`a84eb000 C:\Windows\System32\sechost.dll
ModLoad: 00007ffe`a8040000 00007ffe`a816b000 C:\Windows\System32\RPCRT4.dll
(22d8.1680): Break instruction exception - code 80000003 (first chance)
ntdll!LdrpDoDebuggerBreak+0x30:
00007ffe`a8940670 cc int 3
0:000> g
ModLoad: 00007ffe`a8750000 00007ffe`a8780000 C:\Windows\System32\IMM32.DLL
ModLoad: 00007ffe`7e310000 00007ffe`7e371000 C:\Program Files\dotnet\host\fxr\7.0.4\hostfxr.dll
ModLoad: 00007ffe`7fd70000 00007ffe`7fdd3000 C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.4\hostpolicy.dll
ModLoad: 00007ffe`1e440000 00007ffe`1e939000 C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.4\coreclr.dll
ModLoad: 00007ffe`a8170000 00007ffe`a829a000 C:\Windows\System32\ole32.dll
ModLoad: 00007ffe`a79a0000 00007ffe`a7cf5000 C:\Windows\System32\combase.dll
ModLoad: 00007ffe`a68d0000 00007ffe`a699d000 C:\Windows\System32\OLEAUT32.dll
ModLoad: 00007ffe`a6850000 00007ffe`a68d0000 C:\Windows\System32\bcryptPrimitives.dll
(22d8.1680): Unknown exception - code 04242420 (first chance)
ModLoad: 00007ffe`1d920000 00007ffe`1e43a000 C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.4\System.Private.CoreLib.dll
ModLoad: 00007ffe`1d7a0000 00007ffe`1d91b000 C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.4\clrjit.dll
ModLoad: 00007ffe`a3f10000 00007ffe`a3f22000 C:\Windows\SYSTEM32\kernel.appcore.dll
ModLoad: 00000000`00420000 00000000`00428000 C:\Users\Loord\RiderProjects\TestApp\TestApp\bin\Debug\net7.0\TestApp.dll
ModLoad: 00000000`02270000 00000000`0227e000 C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.4\System.Runtime.dll
ntdll!NtMapViewOfSection+0x14:
00007ffe`a890d224 c3 ret
0:000> g
ModLoad: 00007ffe`7fd00000 00007ffe`7fd2a000 C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.4\System.Console.dll
ModLoad: 00007ffe`9cf90000 00007ffe`9cfa3000 C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.4\System.Threading.dll
ModLoad: 00000000`02290000 00000000`02298000 C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.4\System.Text.Encoding.Extensions.dll
ModLoad: 00007ffe`7e300000 00007ffe`7e30d000 C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.4\System.Runtime.InteropServices.dll
ntdll!NtMapViewOfSection+0x14:
00007ffe`a890d224 c3 ret
0:000> g
(22d8.3484): Break instruction exception - code 80000003 (first chance)
ntdll!DbgBreakPoint:
00007ffe`a8910810 cc int 3
0:008> !name2ee *!TestClass.Example
Module: 00007ffdbe8e4000
Assembly: System.Private.CoreLib.dll
--------------------------------------
Module: 00007ffdbeb6cf48
Assembly: TestApp.dll
Token: 0000000006000005
MethodDesc: 00007ffdbeb99bb0
Name: TestApp.TestClass.Example()
Not JITTED yet. Use !bpmd -md 00007FFDBEB99BB0 to break on run.
--------------------------------------
Module: 00007ffdbeb6ea80
Assembly: System.Runtime.dll
--------------------------------------
Module: 00007ffdbeb99ce8
Assembly: System.Console.dll
--------------------------------------
Module: 00007ffdbeb9b150
Assembly: System.Threading.dll
--------------------------------------
Module: 00007ffdbebc2020
Assembly: System.Text.Encoding.Extensions.dll
--------------------------------------
Module: 00007ffdbebc4f88
Assembly: System.Runtime.InteropServices.dll
0:008> !bpmd -md 00007FFDBEB99BB0
MethodDesc = 00007FFDBEB99BB0
Adding pending breakpoints...
0:008> g
(22d8.1680): CLR notification exception - code e0444143 (first chance)
JITTED TestApp!TestApp.TestClass.Example()
Setting breakpoint: bp 00007FFDBEAA0B90 [TestApp.TestClass.Example()]
Breakpoint 0 hit
TestApp!TestApp.TestClass.Example:
00007ffd`beaa0b90 55 push rbp
0:000> g
(22d8.1680): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
00007ffd`beaa0990 0000 add byte ptr [rax],al ds:00007ffd`beaa0990=00
答: 暂无答案
评论
!bpmd
!name2ee
!u
bp