首页
社区
课程
招聘
[转帖]Creating a Public Symbol Server, Easily
发表于: 2020-3-16 09:11 3384

[转帖]Creating a Public Symbol Server, Easily

2020-3-16 09:11
3384

Original link: https://randomascii.wordpress.com/2020/03/14/creating-a-public-symbol-server-easily/

 

I’ve been a big fan of symbol servers for years. They are a part of the Microsoft/Windows ecosystem that is far better than anything I have seen for other operating systems. With Microsoft’s and Chrome’s symbol servers configured I can download a user’s Chrome crash and start analyzing it immediately – with code bytes and symbols – without knowing or caring what OS or Chrome version that user was running. Since Chrome’s symbols are source-indexed I will even get source-code popping up automatically, and all of this is available to anyone who is interested – no special Google privileges required.

 

So, symbol servers are magical and wonderful. And yet, I’ve never set up a publicly visible one. I’ve landed some fixes to the symbol servers at my last two jobs, but I’ve never created one from scratch to make symbols to my own tools and samples available.

 

Since I’m quarantined (to varying degrees) at home in Kirkland I’m spending this sunny Saturday setting up a symbol server and documenting the process. It was really easy.

 

A symbol server is basically just a file or HTTPS server with the contents arranged in a specific way. There are lots of ways to set up such a server but I decided to use the one that I am most familiar with, the one used by Chrome’s symbol server, which is Google storage. I work at Google, so the obvious bias is obvious, make of that what you will.

Seven simple steps

The first step was to create a Google Cloud account. There’s a free trial that gives you $300 of credit in your first year, so publishing my symbols to the world shouldn’t cost me anything for a while. I plugged a few numbers into the cost estimator (it shows up when you go to create a bucket) and it’s hard to see how it could end up costing me as much as a few cups of coffee a year (class B operations are downloads, 640K should be enough for anyone):

 

image

 

The next step was to create a storage bucket. The only challenging part was choosing a name. Bucket names are globally unique – grab your favorites now. I chose randomascii-symbols. I’m glad that I still like my blog name.

 

I changed access control to uniform, but this probably wasn’t necessary. Otherwise I took all of the default settings.

 

image

 

Powered by wordads.co

 

​ Seen ad many times Not relevant Offensive Covers content Broken

 

<iframe src="https://c0.pubmine.com/sf/0.0.3/html/safeframe.html" id="safeframe-sf-inline-ad-0" scrolling="no" allowtranparency="true" hidefocus="true" tabindex="-1" marginwidth="0" marginheight="0" style="border: medium none; display: block; height: 250px; left: 0px; margin: 0px; position: absolute; top: 0px; visibility: inherit; width: 300px; z-index: 0;" frameborder="no"></iframe>

 

Report this ad

 

It wasn’t entirely obvious how to make the symbols world-readable but a bit of searching found the answer. In the bucket you go to Permissions, click Add members, then set the New members field to allUsers, and the Role to Storage Object Viewer.

 

image

 

I then needed to get gsutil.py set up so that I could command-line upload files. I already had gsutil installed as part of Chromium’s depot_tools so I just had to run gsutil.py config to set up my credentials.

 

The next step was to get my symbols (PDB files and PE files, actually) into symbol server format. The simplest way to do that is to create an empty directory and then use symstore.exe to add the files to it, as shown here.

 

I already had UIforETW’s symbols in this format so all I had to do was run this command, from my local symbol server directory:

python c:\src\depot_tools\gsutil.py cp -Z -R . gs://randomascii-symbols

 

The -R says to copy recursively. The -Z says to upload the files with gzip compression. You can also use the /compress option to symstore but we got burned by that when chrome.dll.pdb broke through 2 GiB so I prefer to let gsutil do the compression now. Either way works.

 

That’s it.

Coda

I updated my UIforETW packaging script to do this for all future releases and published the UIforETW symbols for the last three releases to my symbol server.

 

My new symbol server path, usable for debugging and profiling UIforETW, and for future blog posts, is this:

https://randomascii-symbols.commondatastorage.googleapis.com

 

Caveat: only use symbol servers that you trust. These are the ones that I trust:

 

image

 

In short, the steps were:

  1. Sign up for Google Storage
  2. Create a storage bucket – maybe make access control uniform?
  3. Make the symbols world-readable
  4. Install gsutil (I had it already)
  5. Run gsutil config to get command-line access to your project
  6. Use symstore.exe to create a local symbol server directory structure
  7. Use gsutil.py -Z -R to upload your local symbol server

That’s all folks.


[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回
//