Windbg - 模块未加载“在图像列表中找不到 dll”

发布于 2024-10-08 06:35:47 字数 3895 浏览 0 评论 0原文

我正在尝试使用 Windbg 在 VS2010 .net4 应用程序中为未处理的异常获取正确的调用堆栈。 主程序是一个控制台应用程序。该 dll 正确加载了它的符号。 在同一目录中,我有一个 dll+匹配的 pdb,但无法加载。

我在 Windows Server 2008 R2,64 位(未安装 VS)上运行该应用程序。但该应用程序是在 32 位上编译的。我正在使用 winX86 调试器来附加到该进程。

我已经从以下位置下载了支持 .net 4 的 sosex http://www.stevestechspot.com/(32 位版本) sos.dll(来自“C:\Program Files (x86)\Debugging Tools for Windows (x86)\clr10\sos.dll”)版本为 6.12.2.633。

发出以下命令:
sympath+“...exe和dll的文件夹”
.loadby sos clr
.load sosex.dll

运行 !mk 时,我得到以下信息:

Thread 0:
     ESP      EIP
00:U 0016ec6c 5f636578 0x5f636578
01:U 0016ec70 05f1380f SN!SN_MedistoreEngine::FetchNotes+0x13f [v:\mp\mp\src\sn\sn_medistoreengine.cpp @ 59]
02:M 0016edbc 07dd0db1 SN_Bridge.SNB_bridge.fetch_notes(IOD_Msg*, System.String, System.String, Boolean)(+0x4a IL)(+0x131 Native) [v:\mp\portal\commonutils\src\snb\snb_bridge.cpp, @ 142,0]
03:M 0016ef24 055bfde5 SN_Bridge.SNB_bridge.FetchNotesByStudyUId(System.String, System.String, System.Collections.Generic.List`1<SN_Bridge.SNB_StickyNote>)(+0x25 IL)(+0x55 Native) [v:\mp\portal\commonutils\src\snb\snb_bridge.cpp, @ 296,0]
04:M 0016efb0 055bfd22 
"xxx.Services.StickyNotes.dll" was not found in the image list.
Debugger will attempt to load "xxx.Services.StickyNotes.dll" at given base 00000000.

Please provide the full image name, including the extension (i.e. kernel32.dll)
for more reliable results.Base address and size overrides can be given as
.reload <image.ext>=<base>,<size>.
Unable to add module at 00000000

"xxx.ni.Services.StickyNotes.dll" was not found in the image list.
Debugger will attempt to load "xxx.ni.Services.StickyNotes.dll" at given base 00000000.

Please provide the full image name, including the extension (i.e. kernel32.dll)
for more reliable results.Base address and size overrides can be given as
.reload <image.ext>=<base>,<size>.
Unable to add module at 00000000
xxx.Services.StickyNotes.StickyNotesLogic.StickyNotesByStudyID(System.String, System.String, System.String)(+0x1d IL)(+0x52 Native)
05:M 0016efcc 055ba0ab SNConsole.Program.Main(System.String[])(+0x101 IL)(+0x24b Native) [D:\Documents and Settings\tamar\My Documents\Visual Studio 2010\Projects\SNConsole\Program.cs, @ 48,17]
06:U 0016f02c 72da21db clr+0x21db
07:U 0016f034 72dae021 clr!DllUnregisterServerInternal+0x8025
08:U 0016f090 72dbc58d clr!DllUnregisterServerInternal+0x16591

运行 !clrstack 时,我得到以下信息:

PDB symbol for clr.dll not loaded
OS Thread Id: 0x2984 (0)
Child SP IP       Call Site
0016edc8 5f636578 [InlinedCallFrame: 0016edc8] 
0016edc4 07dd0db1 SN_Bridge.SNB_bridge.fetch_notes(IOD_Msg*, System.String, System.String, Boolean) [v:\mp\portal\commonutils\src\snb\snb_bridge.cpp @ 142]
0016ef30 055bfde5 SN_Bridge.SNB_bridge.FetchNotesByStudyUId(System.String, System.String, System.Collections.Generic.List`1<SN_Bridge.SNB_StickyNote>) [v:\mp\portal\commonutils\src\snb\snb_bridge.cpp @ 296]
0016efb0 055bfd22 xxx.Services.StickyNotes.StickyNotesLogic.StickyNotesByStudyID(System.String, System.String, System.String)
0016efcc 055ba0ab SNConsole.Program.Main(System.String[]) [D:\Documents and Settings\tamar\My Documents\Visual Studio 2010\Projects\SNConsole\Program.cs @ 48]
0016f25c 72da21db [GCFrame: 0016f25c]

如您所见,在这两种情况下,我都得到堆栈中的文件名 + 行号,除了xxx.Services.StickyNotes.dll 行。

我尝试过: .realod /f ""c:...\xxx.Services.StickyNotes.dll" - 相同的错误 和
ld "c:...\xxx.Services.StickyNotes.dll" 导致

没有匹配的模块 'c:...\Bin\xxx.Services.StickyNotes.dll'

使用 !sym 噪音没有帮助,我认为它甚至不会尝试加载 pdb,因为模块本身未加载。

我不明白为什么这个特定的 dll 无法加载。 SN_Console.exe 和 SNB_Bridge.dll 从同一目录加载没有问题。 (我不关心异常本身,我植入了创建的代码。问题是关于设置一个良好的调试环境)。

提前致谢, 添马舰

I am trying to get a proper callstack for an unhandled exception in my VS2010 .net4 application using windbg.
The main program is a console application. This dll loads with it's symbols properly.
In the same directory, I have a dll+matching pdb which won't load.

I am running the app on a windows server 2008 R2, 64 bit (no VS installed). But the app was compiled on 32bit. I am using the winX86 debugger to attach to the process.

I have downloaded sosex that supports .net 4 from
http://www.stevestechspot.com/ (the 32 bit version)
the sos.dll (from "C:\Program Files (x86)\Debugging Tools for Windows (x86)\clr10\sos.dll") version is 6.12.2.633.

Issued the following commands:
sympath+ "...folder of exe and dll"
.loadby sos clr
.load sosex.dll

When running !mk I get the following:

Thread 0:
     ESP      EIP
00:U 0016ec6c 5f636578 0x5f636578
01:U 0016ec70 05f1380f SN!SN_MedistoreEngine::FetchNotes+0x13f [v:\mp\mp\src\sn\sn_medistoreengine.cpp @ 59]
02:M 0016edbc 07dd0db1 SN_Bridge.SNB_bridge.fetch_notes(IOD_Msg*, System.String, System.String, Boolean)(+0x4a IL)(+0x131 Native) [v:\mp\portal\commonutils\src\snb\snb_bridge.cpp, @ 142,0]
03:M 0016ef24 055bfde5 SN_Bridge.SNB_bridge.FetchNotesByStudyUId(System.String, System.String, System.Collections.Generic.List`1<SN_Bridge.SNB_StickyNote>)(+0x25 IL)(+0x55 Native) [v:\mp\portal\commonutils\src\snb\snb_bridge.cpp, @ 296,0]
04:M 0016efb0 055bfd22 
"xxx.Services.StickyNotes.dll" was not found in the image list.
Debugger will attempt to load "xxx.Services.StickyNotes.dll" at given base 00000000.

Please provide the full image name, including the extension (i.e. kernel32.dll)
for more reliable results.Base address and size overrides can be given as
.reload <image.ext>=<base>,<size>.
Unable to add module at 00000000

"xxx.ni.Services.StickyNotes.dll" was not found in the image list.
Debugger will attempt to load "xxx.ni.Services.StickyNotes.dll" at given base 00000000.

Please provide the full image name, including the extension (i.e. kernel32.dll)
for more reliable results.Base address and size overrides can be given as
.reload <image.ext>=<base>,<size>.
Unable to add module at 00000000
xxx.Services.StickyNotes.StickyNotesLogic.StickyNotesByStudyID(System.String, System.String, System.String)(+0x1d IL)(+0x52 Native)
05:M 0016efcc 055ba0ab SNConsole.Program.Main(System.String[])(+0x101 IL)(+0x24b Native) [D:\Documents and Settings\tamar\My Documents\Visual Studio 2010\Projects\SNConsole\Program.cs, @ 48,17]
06:U 0016f02c 72da21db clr+0x21db
07:U 0016f034 72dae021 clr!DllUnregisterServerInternal+0x8025
08:U 0016f090 72dbc58d clr!DllUnregisterServerInternal+0x16591

When running !clrstack I get the following:

PDB symbol for clr.dll not loaded
OS Thread Id: 0x2984 (0)
Child SP IP       Call Site
0016edc8 5f636578 [InlinedCallFrame: 0016edc8] 
0016edc4 07dd0db1 SN_Bridge.SNB_bridge.fetch_notes(IOD_Msg*, System.String, System.String, Boolean) [v:\mp\portal\commonutils\src\snb\snb_bridge.cpp @ 142]
0016ef30 055bfde5 SN_Bridge.SNB_bridge.FetchNotesByStudyUId(System.String, System.String, System.Collections.Generic.List`1<SN_Bridge.SNB_StickyNote>) [v:\mp\portal\commonutils\src\snb\snb_bridge.cpp @ 296]
0016efb0 055bfd22 xxx.Services.StickyNotes.StickyNotesLogic.StickyNotesByStudyID(System.String, System.String, System.String)
0016efcc 055ba0ab SNConsole.Program.Main(System.String[]) [D:\Documents and Settings\tamar\My Documents\Visual Studio 2010\Projects\SNConsole\Program.cs @ 48]
0016f25c 72da21db [GCFrame: 0016f25c]

As you can see, in both cases I get the file name + row number in the stack, except for the xxx.Services.StickyNotes.dll line.

I've tried:
.realod /f ""c:...\xxx.Services.StickyNotes.dll" - same errors
and
ld "c:...\xxx.Services.StickyNotes.dll" which resulted in

No modules matched
'c:...\Bin\xxx.Services.StickyNotes.dll'

using !sym noisy didn't help, I think it doesn't even try to load the pdb since the module itself isn't loaded.

I can't figure out why this specific dll won't load. SN_Console.exe and SNB_Bridge.dll load without a problem from the same directory.
(I am not concerned with the exception itself, I planted the code that creates is. The issue is about setting up a good debugging environment).

Thanks in advance,
Tamar

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

未央 2024-10-15 06:35:47

我碰巧亲自回答了这个问题,但这里有记录的故事,以防其他人偶然发现它:http://blogs.microsoft.co.il/blogs/sasha/archive/2011/01/16 /clr-4-does-not-use-loadlibrary-to-load-assemblies.aspx

总体情况是 CLR 4 不使用 LoadLibrary 加载程序集,因此调试器无法获取 DLL以及它的符号。

I happened to answer this question in person, but here's the documented story in case anyone else stumbles upon it: http://blogs.microsoft.co.il/blogs/sasha/archive/2011/01/16/clr-4-does-not-use-loadlibrary-to-load-assemblies.aspx

The big picture is that CLR 4 doesn't use LoadLibrary to load assemblies, so the debugger can't pick up the DLL and therefore its symbols.

空名 2024-10-15 06:35:47

您可以使用以下方式提示调试器 DLL 在其地址空间中的位置:

.reload /f "c:...\xxx.Services.StickyNotes.dll=image_base_address"

image_base_address 是该 DLL 在进程中映射的地址范围的开头。您可以在 Process Explorer 的 DLL 窗格中找到该值。

我在这里写了更多细节< /a>.

You can hint the debugger the location of the DLL in its address space using:

.reload /f "c:...\xxx.Services.StickyNotes.dll=image_base_address"

image_base_address is the start of the address range which this DLL is mapped in the process. You can find this value in the DLL Pane of Process Explorer.

I wrote about it with a little more detail here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文