Skip to content

nefarius/WinDbgSymbolsCachingProxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WinDbgSymbolsCachingProxy

.NET Docker Image CI Nuget Nuget

Microsoft debugging symbols caching proxy using FastEndpoints and MongoDB.

About

When working frequently with WinDbg to analyze kernel memory dumps, symbol (down)loading is a widespread occurrence. What's also quite common is the abysmal performance of the official Microsoft Symbol Servers, taking easily between two to three seconds for every request! Being fed up with wasting precious lifetime I made this little caching proxy you can put in between your WinDbg instances and use it in conjunction with an offline caching directory. The proxy server will store a copy of the requested symbol in a MongoDB database, including information if the symbol even exists upstream. This information gets cached for a week, so you won't waste any more time twiddling thumbs while the Microsoft servers take their sweet time to return a 404.

Real-world example

Let's see if my efforts paid off, shall we! I've opened a kernel memory dump which requested 1090 files at a total size of 186 Megabytes with three different strategies outlined below. Let's go!

No proxy, no local cache

12 minutes, 17 seconds. Abysmal and shameful! πŸ˜’

With proxy, no local cache

1 minute, 20 seconds. Whoa, we're getting somewhere! πŸ˜ƒ

With proxy and local cache

48 seconds. Heck yeah! πŸ₯³

Public instance

Cached Symbols Count Cached Symbols 404 Cached Symbols Found

I'm hosting an instance of this project at https://symbols.nefarius.at/ which you can consume and help grow by adjusting your symbol source settings like so:

.sympath cache*D:\symbols;srv*https://symbols.nefarius.at/download/symbols

This means my local symbol cache resides at D:\symbols, adjust to your own preferences.

Like any other of my public web services, it only logs an absolute minimal amount required for debugging purposes, and I'll never sell your data out to the big bois πŸ˜‰

If you like this idea and want to keep my public instance happy, up and running consider making a donation πŸ’Έ

Features

  • Caching! Pretty much the main purpose 😁
    • /download/symbols/{Symbol}/{SignaturePlusAge}/{File}
      • Serves the typical download request which the debugger issues.
  • Badges! Embed server statistics anywhere via generated SVGs πŸ–ΌοΈ
    • /api/badges/cachedSymbolsTotal
      • Returns the total number of cached records.
    • /api/badges/cachedSymbolsFound
      • Returns the number of records found upstream (these actually contain the data).
    • /api/badges/cachedSymbolsNotFound
      • Returns the number of records flagged as "not found" upstream.
  • Add your own symbols!
    • /api/uploads/symbol
      • POST one or more supported symbol (currently .exe, .dll, .sys and .pdb) files using your own REST client or the provided harvesting agent.

Projects

  • WinDbgSymbolsCachingProxy
    The symbols caching/hosting server backend that provides the REST API to the database.
  • HarvestingAgent
    A worker service that watches over filesystem directories for new symbols and uploads them to your servers.
  • Nefarius.Utilities.ExceptionEnricher
    A class library that makes use of the symbol server infrastructure to on-demand download debug symbols whenever an exception happens.

Limitations

  • Regarding non-native PDBs like those produced by .NET applications, currently only full (a.k.a. Windows-native) debug symbols are supported, since the portable can not be parsed server-side.

How to publish

dotnet publish -p:PublishProfile=Properties\PublishProfiles\release-win-x64.pubxml -c:Release .\WinDbgSymbolsCachingProxy.sln
Docker build

Use your own registry, of course πŸ˜‰

docker build -t nefarius.azurecr.io/wdscp:latest . ; docker push nefarius.azurecr.io/wdscp:latest

Sources & 3rd party credits

This application benefits from these awesome projects ❀ (appearance in no special order):

Web, Database

PE, PDB, etc. parsing

Badge generation

Misc.

About

WinDbg Symbols Caching Proxy.

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages