Dina
Dina

Reputation: 1406

Unrelated symbols appear in private symbol server while debugging

We have a private symbol server (just a folder in a shared network drive). A while ago I noticed it contains symbols for many DLLs which aren't ours (System.Xml, clr, kernel32, etc.). The _NT_SYMBOL_PATH environment variable is set to SRV*c:\symbols*G:\Foundations\Symbols*http://msdl.microsoft.com/download/symbols where c:\symbols is my local cache and G is mapped network drive. This is according to the instructions here: https://msdn.microsoft.com/en-us/library/windows/desktop/ee416588(v=vs.85).aspx#symbol_servers.

Today I finally figured out how all the non-private symbols got there. I deleted the clr.pdb folder from the private symbol server and started debugging a dump using ClrMD. Instead of only saving the clr symbols in my local cache they also reappeared in the private symbol server.

How do I prevent this from happenning? I don't want our private symbol server to contain unrelated garbage which just takes up space and clutters the folder. [We already have about 2600 folders there, probably 90% are not ours. I can't imagine how to clean this up...]

UPDATE 1:

So it turns out that this is in fact the expected behavior, as documented by a different MSDN page: https://msdn.microsoft.com/en-us/library/windows/desktop/ms681416(v=vs.85).aspx.

According to yet another documentation page (https://msdn.microsoft.com/en-us/library/windows/desktop/ms680689(v=vs.85).aspx) using a cache element marks a certain folder as cache. However setting _NT_SYMBOL_PATH=CACHE*c:\symbols;SRV*G:\Foundations\Symbols*http://msdl.microsoft.com/download/symbols didn't prevent addition of symbols to the private symbol server and setting _NT_SYMBOL_PATH=CACHE*c:\symbols;SRV*G:\Foundations\Symbols;SRV*http://msdl.microsoft.com/download/symbols caused a weird behavior: VisualStudio was able to download symbols and they didn't end up in my private symbol server, however, ClrMD was unable to download symbols for the dump I was analyzing... When I opened the same dump in VS it worked fine. So I guess ClrMD somehow does something different with the symbol path...

Upvotes: 0

Views: 180

Answers (1)

Thomas Weller
Thomas Weller

Reputation: 59523

Your first attempt

First, you mention the symbol path

SRV*c:\symbols*G:\Foundations\Symbols*http://msdl.microsoft.com/download/symbols

According the documentation you linked

As symbols are retrieved, files and folders appear in the \mainserver\symbols shared directory, as well as in individual caches, in the c:\symbols directory.

So that's the intended behavior.

Your second attempt

The second symbol path you used was

CACHE*c:\symbols;SRV*G:\Foundations\Symbols*http://msdl.microsoft.com/download/symbols

which consists of two parts:

cache*c:\symbols

(which is fine) and

SRV*G:\Foundations\Symbols*http://msdl.microsoft.com

which is (from syntax point of view) identical to

srv*c:\symbols*http://msdl.microsoft.com/download/symbols

and described like this on the linked MSDN documentation:

To use only the Microsoft symbol server together with a local cache of symbols, to speed up access over the Internet, use the following setting for _NT_SYMBOL_PATH: srv*c:\symbols*http://msdl.microsoft.com/download/symbols

So yes, it will download Microsoft files to G:.

Your third approach

Your last try was

CACHE*c:\symbols;SRV*G:\Foundations\Symbols;SRV*http://msdl.microsoft.com/download/symbols

The srv*http... syntax (without a defining a local folder) is not described on any of the linked documentation, So I'm not sure what behavior that would cause.

My proposal

SRV*c:\symbols*G:\Foundations\Symbols

should download private symbols from G: to C:. And

SRV*c:\symbols*http://msdl.microsoft.com/download/symbols

should download symbols from Microsoft to C:. So combine them to

SRV*c:\symbols*G:\Foundations\Symbols;SRV*c:\symbols*http://msdl.microsoft.com/download/symbols

Upvotes: 0

Related Questions