windbg target executable cannot find DLLs RRS feed

  • Question

  • I have been a programmer for 25 years, and this is my first time asking a question on a public forum.  I hope this is the right place for windbg issues.  I just started a new job working with Visual Studio 2010, programming in VB.net, so although I've been around, this environment is new to me.  I have been trying to track down a crafty memory resource issue, possibly a leak, or memory overwrite.  I have been trying to decide which tools to use.  After reading on a bunch of forums, it sounds like Visual Studio 2010 is not the best for tracking down these type of issues, and that windbg will probably be required to dig deeper into memory issues.  Other recommendations are welcome.

    I downloaded the windbg SDK.  I'm on a Windows 7 machine, which is 64-bit, but my executable is a 32-bit executable (x86).  I am using WinDbg:6.2.9200.16384 X86.  My executable has dependencies on some home grown DLLs.  These DLLs are all copied to the same directory that my executable is in.  

    When I start WinDbg, I set the symbol file, source file, and image file paths, and select "Open Executable" from the file menu, and load my executable.  Here is what I get back:

    Microsoft (R) Windows Debugger Version 6.2.9200.20512 X86
    Copyright (c) Microsoft Corporation. All rights reserved.

    CommandLine: P:\PHL_ATE\views\ATE_Code-Generic-3.42\ate\vb\ModTNT\bin\Debug\ModTNT.exe
    Symbol search path is: SRV*c:\symbols*http://msdl.microsoft.com/download/symbols;P:\PHL_ATE\views\ATE_Code-Generic-3.42\ate\vb\ModTNT\bin\Debug
    Executable search path is: p:\phl_ate\views\ate_code-generic-3.42\ate\vb\modtnt\bin\debug
    ModLoad: 01160000 01422000   ModTNT.exe
    ModLoad: 77d30000 77eb0000   ntdll.dll
    ModLoad: 729c0000 72a0a000   C:\Windows\SysWOW64\MSCOREE.DLL
    ModLoad: 75f40000 76050000   C:\Windows\syswow64\KERNEL32.dll
    ModLoad: 759f0000 75a37000   C:\Windows\syswow64\KERNELBASE.dll
    (1dc0.11b8): Break instruction exception - code 80000003 (first chance)
    eax=00000000 ebx=00000000 ecx=02040000 edx=0023df78 esi=fffffffe edi=00000000
    eip=77dd0fab esp=0044f700 ebp=0044f72c iopl=0         nv up ei pl zr na pe nc
    cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
    77dd0fab cc              int     3

    Then I select "Go", under the Debug drop down menu.  Here is what I see:

    ModLoad: 76050000 760f0000   C:\Windows\syswow64\ADVAPI32.dll
    ModLoad: 76c10000 76cbc000   C:\Windows\syswow64\msvcrt.dll
    ModLoad: 77910000 77929000   C:\Windows\SysWOW64\sechost.dll
    ModLoad: 75d80000 75e70000   C:\Windows\syswow64\RPCRT4.dll
    ModLoad: 75890000 758f0000   C:\Windows\syswow64\SspiCli.dll
    ModLoad: 75880000 7588c000   C:\Windows\syswow64\CRYPTBASE.dll
    ModLoad: 72950000 729b7000   C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscoreei.dll
    ModLoad: 76430000 76487000   C:\Windows\syswow64\SHLWAPI.dll
    ModLoad: 75ae0000 75b70000   C:\Windows\syswow64\GDI32.dll
    ModLoad: 76ac0000 76bc0000   C:\Windows\syswow64\USER32.dll
    ModLoad: 75d70000 75d7a000   C:\Windows\syswow64\LPK.dll
    ModLoad: 75e70000 75f0d000   C:\Windows\syswow64\USP10.dll
    ModLoad: 762b0000 76310000   C:\Windows\SysWOW64\IMM32.DLL
    ModLoad: 758f0000 759bc000   C:\Windows\syswow64\MSCTF.dll
    ModLoad: 59260000 5937a000   c:\progra~2\browse~1\sprote~1.dll
    ModLoad: 693a0000 69a0f000   C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
    ModLoad: 6c580000 6c63e000   C:\Windows\SysWOW64\MSVCR100_CLR0400.dll
    (1dc0.11b8): Unknown exception - code 04242420 (first chance)
    ModLoad: 67330000 680f2000   C:\Windows\assembly\NativeImages_v4.0.30319_32\mscorlib\3f95a6d480ed1ebe45cf27b770ba94ed\mscorlib.ni.dll
    ModLoad: 75c10000 75d6c000   C:\Windows\syswow64\ole32.dll
    ModLoad: 73a90000 73b10000   C:\Windows\SysWOW64\uxtheme.dll
    ModLoad: 73940000 73950000   C:\Windows\Microsoft.NET\Framework\v4.0.30319\nlssorting.dll
    ModLoad: 61a30000 622df000   C:\Windows\assembly\NativeImages_v4.0.30319_32\System\15872842e3e63ddf0f720f406706198e\System.ni.dll
    ModLoad: 61370000 61a30000   C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Core\27dcf04ed7a3506045597c02a5a1fc31\System.Core.ni.dll
    ModLoad: 68c90000 68e53000   C:\Windows\assembly\NativeImages_v4.0.30319_32\Microsoft.VisualBas#\b9fe069cd0848273acf2ef4468bc1838\Microsoft.VisualBasic.ni.dll
    ModLoad: 6c520000 6c580000   C:\Windows\Microsoft.NET\Framework\v4.0.30319\clrjit.dll
    ModLoad: 68af0000 68c89000   C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Drawing\b573c6a62bb88df0ee2af59b6a8ca910\System.Drawing.ni.dll
    ModLoad: 5e180000 5ee19000   C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Windows.Forms\39f4c7717661667c68f9af8c4f6402b9\System.Windows.Forms.ni.dll
    ModLoad: 6a0e0000 6a164000   C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll
    ModLoad: 6b220000 6b313000   C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Configuration\5de5d8c1c02e33789e3cf7e3f54c0ec9\System.Configuration.ni.dll
    ModLoad: 5fd50000 602ae000   C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Xml\43cd41484df96d15df949eb17dd88152\System.Xml.ni.dll
    ModLoad: 739e0000 739f3000   C:\Windows\SysWOW64\dwmapi.dll
    ModLoad: 6b670000 6b730000   C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Runtime.Remo#\5ea93652e4752c75bc6fbb195b4eb864\System.Runtime.Remoting.ni.dll
    ModLoad: 76530000 76565000   C:\Windows\syswow64\ws2_32.dll
    ModLoad: 76490000 76496000   C:\Windows\syswow64\NSI.dll
    ModLoad: 76170000 762a7000   C:\Windows\syswow64\urlmon.dll
    ModLoad: 76310000 76405000   C:\Windows\syswow64\WININET.dll
    ModLoad: 76570000 7676f000   C:\Windows\syswow64\iertutil.dll
    ModLoad: 75b70000 75bff000   C:\Windows\syswow64\OLEAUT32.dll
    ModLoad: 76770000 7688e000   C:\Windows\syswow64\CRYPT32.dll
    ModLoad: 75a40000 75a4c000   C:\Windows\syswow64\MSASN1.dll
    ModLoad: 739c0000 739d2000   C:\Windows\SysWOW64\MPR.dll
    ModLoad: 60f80000 60f86000   C:\Windows\SysWOW64\SnacNp.dll
    ModLoad: 75c00000 75c05000   C:\Windows\syswow64\PSAPI.DLL
    ModLoad: 6ab50000 6ab58000   C:\Windows\SysWOW64\drprov.dll
    ModLoad: 72f50000 72f79000   C:\Windows\SysWOW64\WINSTA.dll
    ModLoad: 6a9c0000 6a9d4000   C:\Windows\SysWOW64\ntlanman.dll
    ModLoad: 6a840000 6a857000   C:\Windows\SysWOW64\davclnt.dll
    ModLoad: 6b320000 6b328000   C:\Windows\SysWOW64\DAVHLPR.dll
    ModLoad: 73f90000 73f9f000   C:\Windows\SysWOW64\wkscli.dll
    ModLoad: 72b30000 72b3b000   C:\Windows\SysWOW64\cscapi.dll
    ModLoad: 74030000 74039000   C:\Windows\SysWOW64\netutils.dll
    ModLoad: 60fb0000 61361000   C:\Windows\assembly\NativeImages_v4.0.30319_32\WindowsBase\7a9ff5ce3a909d075179a2ac70d8f388\WindowsBase.ni.dll
    ModLoad: 74ce0000 74cf6000   C:\Windows\SysWOW64\CRYPTSP.dll
    ModLoad: 74ca0000 74cdb000   C:\Windows\SysWOW64\rsaenh.dll
    ModLoad: 74c60000 74c9c000   C:\Windows\SysWOW64\mswsock.dll
    ModLoad: 74c50000 74c55000   C:\Windows\SysWOW64\wshtcpip.dll
    ModLoad: 74850000 74856000   C:\Windows\SysWOW64\wship6.dll
    ModLoad: 5f5f0000 5fac0000   System.Windows.Forms.dll
    ModLoad: 6fd50000 6fdac000   atedb.dll
    ModLoad: 00850000 008ac000   atedb.dll
    ModLoad: 74600000 7460e000   C:\Windows\SysWOW64\RpcRtRemote.dll
    ModLoad: 73920000 73936000   gTrackBar.dll
    ModLoad: 00450000 00466000   gTrackBar.dll
    ModLoad: 69f10000 6a0a0000   C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.17825_none_72d273598668a06b\gdiplus.dll
    ModLoad: 69e50000 69ec6000   C:\Windows\SysWOW64\RichEd20.DLL
    ModLoad: 747e0000 747e9000   C:\Windows\SysWOW64\version.dll
    ModLoad: 6a890000 6a9c0000   C:\Windows\SysWOW64\WindowsCodecs.dll
    ModLoad: 74910000 74aae000   C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\comctl32.dll
    ModLoad: 76cc0000 7790a000   C:\Windows\syswow64\shell32.dll
    ModLoad: 73910000 7391c000   OciSql.dll
    ModLoad: 00700000 0070c000   OciSql.dll
    ModLoad: 07290000 073ec000   C:\Windows\SysWOW64\ole32.dll
    ModLoad: 74040000 7409f000   C:\Windows\SysWOW64\SXS.DLL
    ModLoad: 74560000 745ac000   C:\Windows\SysWOW64\apphelp.dll
    (1dc0.11b8): CLR exception - code e0434352 (first chance)
    (1dc0.11b8): CLR exception - code e0434352 (first chance)

    I see my executable begin to execute, but it fails because it can't find one of my DLLs.  The DLL I am interested in is atedb.dll.  I see this DLL get "ModLoad"ed above, but it doesn't seem to be in a path that is recognized by my executable when I run it under windbg.  If I run the executable outside of windbg this library is found, without any problems.  Here is the error I see in my executable:

    Config file Error: vbc: Command line(0,0): error BC2017:

    Could not find library 'atedb.dll'

    vbc: Fatal (0,0): error BC2000: compiler initialization failed unexpectedly:

    The system cannot find the file specified.

    Is there some other setting that I need to provide in the windbg environment in order to find my DLL?  I have tried using .exepath to set the path to point to the directory containing the DLL.  I have tried using gacutil to cache the DLL.  I have tried copying the DLL to the SysWOW64 directory.  None of these seemed to help.  Since I am new to windbg, I'm willing to admit a cockpit error.  Does the image path get used by my executable to search for required DLLs, or si there some other method to specify a path to required DLLs?  If the image path does get used, did I set the image path correctly?

    I am hoping once I get this executable to run, that I will find some pointers to the underlying memory, or resource issue that started this search in the first place.  

    Friday, May 17, 2013 2:30 PM

All replies

  • Had a lot of lookers, but no takers.  No problem.

    I found a work around for this.  I attach to a thread that is already running, and it finds all of the DLLs.  I still don't understand why I couldn't see the DLLs in the first place, but this got me far enough to chase down my underlying issue.  

    Visual Studio 2010 VB.net does automatic garbage collection, and returns unused memory to the heap.  I had overwritten the end of an array, and the garbage collector did it's job, but in the process removed memory I was still pointing to.  windbg clued me in that the garbage collector was the thread I was crashing on.

    Thursday, May 23, 2013 7:59 PM