A pitfall of WinDBG's symbol loader

If there was an incomplete (especially zero length) symbol file (.pdb) in the downstream store of the symbol server, WinDBG will work abnormally.
Though the symbol path is like this:
0: kd> .symfix d:\symbols
DBGHELP: Symbol Search Path: SRV*d:\symbols*http://msdl.microsoft.com/download/symbols
It always search symbol at C:\windbg\sym:
0: kd> .reload nt
DBGHELP: C:\windbg\sym\ntkrnlmp.pdb\D11928D0A382448AA96E545C81E4DD172\ntkrnlmp.pdb - file not found
DBGHELP: ntkrnlmp.pdb - file not found
*** ERROR: Symbol file could not be found. Defaulted to export symbols for ntkrnlmp.exe -
DBGHELP: nt - export symbols
With a check, it’s because there was a zero length file at the path. After renamed it, WinDBG will search symbols as normal. But it met another incomplete file:
0: kd> .reload nt
SYMSRV: d:\symbols\ntkrnlmp.pdb\D11928D0A382448AA96E545C81E4DD172\ntkrnlmp.pd_
The file or directory is corrupted and unreadable.
DBGHELP: ntkrnlmp.pdb - file not found
*** ERROR: Symbol file could not be found. Defaulted to export symbols for ntkrnlmp.exe -
DBGHELP: nt - export symbols
After rename the incomplete file, it’s fully recovered.
0: kd> .reload nt
SYMSRV: ntkrnlmp.pdb from http://msdl.microsoft.com/download/symbols: 1406859 bytes - copied
DBGHELP: nt - public symbols
d:\symbols\ntkrnlmp.pdb\D11928D0A382448AA96E545C81E4DD172\ntkrnlmp.pdb

I ever met the issue couple months ago. Today it happened again and share to all. Hope it’s helpful.

Best Regards,
Raymond Zhang