title: Why WinDbg is unable to load symbols from Windows Server 2003 with Service Pack 2 x86 retail symbols download?
body: <p>I wrote a C++ project called 'Foo' using Microsoft Visual Studio 2005 Verison 8.0.50727.762 (SP.050727-7600) on Windows XP Professional Version 2002 Service Pack 3. I built the project into Foo.exe. Then, I copied the file Foo.exe to a Windows Server 2003 Enterprise Edition Service Pack 2. It runs fine.</p>
  
  <p>Now, I try to debug it using WinDbg:6.12.0002.663 X86 Version 5.2.</p>
  
  <p><strong>No symbol path, source path or image path is set</strong></p>
  
  <p>When I open <code>C:\foo\Foo.exe</code> from the 'File > Open Executable' menu, I see this error:</p>
  
  <pre><code>*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -
  </code></pre>
  
  <p>Foo.pdb is not present in the same folder where Foo.exe is present. Why do I not see an error for Foo.exe?</p>
  
  <p>On running the command <code>ld *</code> in WinDbg, I see these errors:</p>
  
  <pre><code>0:000&gt; ld *
  *** ERROR: Module load completed but symbols could not be loaded for Foo.exe
  Symbols loaded for Foo
  *** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\system32\msvcrt.dll - 
  Symbols loaded for msvcrt
  *** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\system32\kernel32.dll - 
  Symbols loaded for kernel32
  *** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262B86\MSVCR80.dll - 
  Symbols loaded for MSVCR80
  *** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262B86\MSVCP80.dll - 
  Symbols loaded for MSVCP80
  Symbols already loaded for ntdll
  </code></pre>
  
  <p>Now, let me show two attempts to fix it. One worked, the other didn't.</p>
  
  <p><strong>Downloading Windows Server 2003 with Service Pack 2 x86 retail symbols didn't work</strong></p>
  
  <p>I went to <a href="http://msdn.microsoft.com/en-us/windows/hardware/gg463028" rel="nofollow">http://msdn.microsoft.com/en-us/windows/hardware/gg463028</a> and downloaded:</p>
  
  <p><a href="http://msdl.microsoft.com/download/symbols/packages/windows2003/WindowsServer2003-KB933548-v1-x86-symbols-NRL-ENU.exe" rel="nofollow">Windows Server 2003 with Service Pack 2 x86 retail symbols, all languages</a> (File size: 154 MB - Most customers want this package.)</p>
  
  <p>I ran it and installed the symbols in <code>C:\Symbols</code>. In WinDbg, I set the symbol path as:</p>
  
  <pre><code>C:\Symbols;C:\MySymbols
  </code></pre>
  
  <p><code>C:\MySymbols</code> contained the symbol for Foo.exe which had a file-name: Foo.pdb.</p>
  
  <p>On opening <code>C:\foo\Foo.exe</code> from the 'File > Open Executable' menu, I got the same error mentioned in the previous section.</p>
  
  <p>However, the <code>ld *</code> command showed fewer errors this time.</p>
  
  <pre><code>0:000&gt; ld *
  Symbols loaded for Foo
  Symbols loaded for msvcrt
  *** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\system32\kernel32.dll - 
  Symbols loaded for kernel32
  *** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262B86\MSVCR80.dll - 
  Symbols loaded for MSVCR80
  *** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262B86\MSVCP80.dll - 
  Symbols loaded for MSVCP80
  Symbols already loaded for ntdll
  </code></pre>
  
  <p><strong>Using Microsoft Symbol Server fixed it</strong></p>
  
  <p>This time I set the symbol path as:</p>
  
  <pre><code>SRV*C:\MicrosoftSymbols*http://msdl.microsoft.com/download/symbols;C:\MySymbols
  </code></pre>
  
  <p>Now, on opening <code>C:\foo\Foo.exe</code> from the 'File > Open Executable' menu, I got no errors. I found that <code>C:\microsoftsymbols\ntdll.pdb\F7024C7F15FE4BEA992FF38BE58AC11C2\ntdll.pdb</code> was downloaded automatically.</p>
  
  <p>This time <code>ld *</code> command also ran fine without any errors.</p>
  
  <pre><code>0:000&gt; ld *
  Symbols loaded for Foo
  Symbols loaded for msvcrt
  Symbols loaded for kernel32
  Symbols loaded for MSVCR80
  Symbols loaded for MSVCP80
  Symbols already loaded for ntdll
  </code></pre>
  
  <p>The following additional symbols were downloaded automatically while the command was running.</p>
  
  <pre><code>C:\microsoftsymbols\kernel32.pdb\BE496DC9472F4438B080C70594D8F9CC2\kernel32.pdb
  C:\microsoftsymbols\msvcp80.i386.pdb\E8A9423E890A4ADDB38F8F756268437C1\msvcp80.i386.pdb
  C:\microsoftsymbols\msvcr80.i386.pdb\54C9E2F351544D1CB39517DC4B299EA81\msvcr80.i386.pdb
  C:\microsoftsymbols\msvcrt.pdb\A7F38CEE7E684B94B7AA9FFFCAB446851\msvcrt.pdb
  </code></pre>
  
  <p><strong>Questions</strong></p>
  
  <ol>
  <li>Why did I not see an error regarding symbol file for Foo.exe when no symbol path was specified?</li>
  <li>Why downloading Windows Server 2003 with Service Pack 2 x86 retail symbols and specifying the path to it as the symbol path didn't work?</li>
  </ol>
  
  <p><strong>More information</strong></p>
  
  <p>In case it helps you to answer my question, here is my system details as obtained from winmsd.exe > System Summary:</p>
  
  <pre><code>OS Name: Microsoft(R) Windows(R) Server 2003, Enterprise Edition
  Version: 5.2.3790 Service Pack 2 Build 3790
  Other OS Description : Not Available
  OS Manufacturer: Microsoft Corporation
  System Name: EULER
  System Manufacturer: VMware, Inc.
  System Model: VMware Virtual Platform
  System Type: X86-based PC
  Processor: x86 Family 16 Model 4 Stepping 2 AuthenticAMD ~2417 Mhz
  Processor: x86 Family 16 Model 4 Stepping 2 AuthenticAMD ~2416 Mhz
  BIOS Version/Date: Phoenix Technologies LTD 6.00, 7/22/2008
  SMBIOS Version: 2.4
  Windows Directory: C:\WINDOWS
  System Directory: C:\WINDOWS\system32
  Boot Device: \Device\HarddiskVolume1
  Locale: United States
  Hardware Abstraction Layer: Version = "5.2.3790.3959 (srv03_sp2_rtm.070216-1710)"
  User Name: Not Available
  Time Zone: India Standard Time
  Total Physical Memory: 3,839.45 MB
  Available Physical Memory: 1.56 GB
  Total Virtual Memory: 5.60 GB
  Available Virtual Memory: 3.33 GB
  Page File Space: 2.00 GB
  Page File: C:\pagefile.sys
  </code></pre>