Steps to diagnose translated UWP stack trace

半世苍凉 提交于 2019-12-03 15:51:52

Here's an update in case anyone else runs into this issue.

Pdbs and Stacks in .NET Native

.NET Native PDBs are different than the PDBs you may expect. Make sure to save the correct ones! As part of compiling you application to native code, we need to generate a new PDB file that has all the proper mappings back to your source. If you don’t save the correct PDB you will have completely non-actionable stacks/dumps. There is no way to regenerate this file if you lose it.

For local dev builds or your build server it will live at paths like:

<projectRoot>\bin\<Architecture>\<Release|Debug>\ilc\YOURAPPLICATIONNAME.pdb

You’ll know it’s the right one because it’ll be gigantic (50+MB). After you upload to the Store you can get your cloud compiled pdb from the Dev center.

.NET Native stacks aren’t human readable

In an effort to be maximally lean, the .NET Native compilation process strips out metadata that would allow the runtime to generate human readable stacks. Today they look something like:

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at SharedLibrary!<BaseAddress>+0x35d1d7
   at SharedLibrary!<BaseAddress>+0x35d10d
   at SharedLibrary!<BaseAddress>+0x35d0dd
   at FieldMedic!<BaseAddress>+0x13dec5 [2147500037]

If you use HockeyApp for telemetry, they have added functionality to reconstruct stacks to be more useful. See our blog post.

However, it sounds like you’re not using HockeyApp for telemetry of this sort of thing. Presuming that’s the case, you’ll need to use StackParser. Clone that repo, build, and away you go.

Here’s the help to give you an idea of what you’ll be dealing with:

StackParser [/pdbs {pdbFiles}] [/modules {PE files}]
            [/keep] [/in inputFile] [/out outputfile] [/symsrv definition]

All arguments are optional, but at least one pdb file or one PE file need to be defined. 

    /pdb {pdbFiles}       A non empty list of pdb files to be used
    /modules {PE files}   A non empty list of loaded modules used.
                          Symbols are fetched from the symbol store.
    /keep                 Keep the pdb files.
                          (default: all downloaded symbol files are deleted).
    /in <file>            Input to operate on (default: stdin).
    /out <file>           Append output to file (default: stdout).
    /symsrv <definition> "Standard"definition for symbol server cache.
                          (Implies /keep).

    Examples:
StackParser /pdbs app.pdb SharedLibrary.pdb < log.txt
     Uses existing PDB files to convert log.txt and writes result to console.

StackParser /pdbs app.pdb /modules Lib.dll /in log.txt /out symlog.txt
     Uses existing PDB (app.pdb) and looks up pdb file for Lib.dll;
     reads input from log.txt and writes result to symlog.txt.

StackParser /modules foo.dll /in log.txt /symserver srv*c:\symbols*http://msdl.microsoft.com/download/symbols
     Converts log.txt by getting symbols from public symbol server
     (with local cache at c:\symbols).

I had multiple crashes in the Windows Dev Center with not helpful stack traces. With the tip of Matt Whilden I used StackParser. But it was a pain to symbolicate all the crashes manually. So I wrote an application that can symbolicate the downloaded .tsv stack traces from the Dev Center and it can also use the Windows Dev Center API to symbolicate crashes fully automatically.

Here is a link to the Github in case that someone is interested in this: https://github.com/hig-dev/WindowsDevCenterStacktraceSymbolicater

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!