诊断已翻译的UWP堆栈跟踪的步骤 [英] Steps to diagnose translated UWP stack trace

查看:74
本文介绍了诊断已翻译的UWP堆栈跟踪的步骤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我已经在发行模式下从UWP Windows应用程序收到了堆栈跟踪。
我现在已经使用windbg将所有地址转换为它们的方法名称。

So I have received a stack trace from my UWP windows application in release mode. I've now translated all the addresses to their method names using windbg.

我现在具有以下输出:

System.InvalidOperationException: InvalidOperation_EnumFailedVersion. For 

more information, visit http://go.microsoft.com/fwlink/?LinkId=623485
at MyApp!<BaseAddress>+0x7710b7 
    - MyApp!System::Func$4<System::__Canon,System::__Canon,System::__Canon,System::__Canon>.BeginInvoke+0x27   
    |  (00b710c0)   MyApp!System::Func$4<System::__Canon,System::__Canon,System::__Canon,System::__Canon>.Invoke
at MyApp!<BaseAddress>+0x771125 
    - MyApp!System::Func$3<System::__Canon,System::Int32,System::__Canon>.GetThunk+0x45   
        |  (00b71130)   MyApp!System::Func$3<System::__Canon,System::Int32,System::__Canon>.ReverseInvokeImpl
at MyApp!<BaseAddress>+0x7710d5 
    - MyApp!System::Func$4<System::__Canon,System::__Canon,System::__Canon,System::__Canon>.Invoke+0x15   
        |  (00b710e0)   MyApp!System::Func$3<System::__Canon,System::Int32,System::__Canon>.GetThunk
at MyApp!<BaseAddress>+0x85d8c9 
    - MyApp!$58_System::Net::Http::HttpContent::<>c__DisplayClass0.<ReadAsStringAsync>b__1$catch$0+0x16   
        |  (00c5d8f2)   MyApp!$58_System::Net::Http::HttpContent::<>c__DisplayClass0.<ReadAsStringAsync>b__1$catch$1
at MyApp.Collections.ViewModelCollection.<PrependListOfViewModelsAsync>b__24_1(ViewModels.ViewModel nt)
at MyApp!<BaseAddress>+0x784241
    - MyApp!$45_System::Collections::Generic::Dictionary$2<$76_Microsoft::CSharp::RuntimeBinder::Syntax::OperatorKind,System::__Canon>.Remove+0x81   
        |  (00b84310)   MyApp!$45_System::Collections::Generic::Dictionary$2<$76_Microsoft::CSharp::RuntimeBinder::Syntax::OperatorKind,System::__Canon>.Resize
at MyApp!<BaseAddress>+0x786623
    - MyApp!$45_System::Collections::Generic::Dictionary$2<$54_Newtonsoft::Json::Serialization::DefaultSerializationBinder::TypeNameKey,System::__Canon>.Remove+0x3   
        |  (00b86790)   MyApp!$45_System::Collections::Generic::Dictionary$2<$54_Newtonsoft::Json::Serialization::DefaultSerializationBinder::TypeNameKey,System::__Canon>.Resize
at MyApp!<BaseAddress>+0x7e41af
    - MyApp!$62_System::Linq::Expressions::ConditionalExpression.Make+0x3f   
        |  (00be4250)   MyApp!$47_Internal::Reflection::Execution::FoundationTypesImplementation.get_SystemObject
at System.Collections.Generic.List<System.Object>..ctor(Collections.Generic.IEnumerable<System.Object> collection)
at MyApp.Collections.ViewModelCollection.<>c__DisplayClass24_0.<PrependListOfViewModelsAsync>b__0()
at System.Action.Invoke()
at MyApp!<BaseAddress>+0xcbb04f
    - MyApp!$121_Type23.ReadArrayOfUrlEntityFromXml+0x1cf   
        |  (010bb1a0)   MyApp!$121_Type16.ReadArrayOfMediaFromXmlIsGetOnly
at MyApp!<BaseAddress>+0xdb9c41 --- End of stack trace from previous location where exception was thrown ---
    - MyApp!$70_System::Xml::XmlConvert.CreateException+0xe1   
        |  (011b9d60)   MyApp!$70_System::SR.get_Xml_InvalidSurrogateHighChar
at MyApp!<BaseAddress>+0x819f65
    - MyApp!$62_System::Linq::Expressions::Interpreter::LightCompiler.CompileNewExpression+0x55   
        |  (00c1a190)   MyApp!$62_System::Linq::Expressions::Interpreter::InstructionList.EmitNew
at MyApp!<BaseAddress>+0x81a319
    - MyApp!$62_System::Linq::Expressions::Interpreter::LightCompiler.CompileMemberInit+0xb9   
        |  (00c1a618)   MyApp!$62_System::Linq::Expressions::Interpreter::LightCompiler.CompileMemberInit$fin$0
at MyApp!<BaseAddress>+0x9e9843 --- End of stack trace from previous location where exception was thrown ---
    - MyApp!_$ILCT$::$ILT$ReflectionDynamicInvoke$.InvokeRetVI<$61_Windows.Foundation.Rect>+0x63   
        |  (00de9850)   MyApp!$122_Microsoft::Graphics::Canvas::Effects::AtlasEffect.put_SourceRectangle
at MyApp!<BaseAddress>+0x819f65
        - MyApp!$62_System::Linq::Expressions::Interpreter::LightCompiler.CompileNewExpression+0x55   
            |  (00c1a190)   MyApp!$62_System::Linq::Expressions::Interpreter::InstructionList.EmitNew
at MyApp!<BaseAddress>+0x81a319
    - MyApp!$62_System::Linq::Expressions::Interpreter::LightCompiler.CompileMemberInit+0xb9   
        |  (00c1a618)   MyApp!$62_System::Linq::Expressions::Interpreter::LightCompiler.CompileMemberInit$fin$0
at MyApp!<BaseAddress>+0x9f0481 --- End of stack trace from previous location where exception was thrown ---
    - MyApp!$122_McgInterop::ForwardComSharedStubs.Func_Microsoft_Graphics_Canvas_CanvasDrawingSession__Numerics_Vector2__float__rg_Microsoft_Graphics_Canvas_Text_CanvasGlyph__bool__uint___Rect__+0x1b1   
        |  (00df04f1)   MyApp!$122_McgInterop::ForwardComSharedStubs.Func_Microsoft_Graphics_Canvas_CanvasDrawingSession__Numerics_Vector2__float__rg_Microsoft_Graphics_Canvas_Text_CanvasGlyph__bool__uint___Rect__$fin$0
at MyApp!<BaseAddress>+0x819f65
    - MyApp!$62_System::Linq::Expressions::Interpreter::LightCompiler.CompileNewExpression+0x55   
    |  (00c1a190)   MyApp!$62_System::Linq::Expressions::Interpreter::InstructionList.EmitNew
at MyApp!<BaseAddress>+0x81a17f
    - MyApp!$62_System::Linq::Expressions::Interpreter::LightCompiler.CompileNewExpression+0x26f   
        |  (00c1a190)   MyApp!$62_System::Linq::Expressions::Interpreter::InstructionList.EmitNew
at MyApp!<BaseAddress>+0x8dc247 Stack: InvalidOperation_EnumFailedVersion. For more information, visit http://go.microsoft.com/fwlink/?LinkId=623485
    - MyApp!$78_System::Runtime::Serialization::CollectionDataContract.IsCollectionOrTryCreate+0x2f7   
        |  (00cdc720)   MyApp!$78_System::Runtime::Serialization::CollectionDataContract..ctor

是什么建议的方法来处理此转换后的堆栈跟踪以识别有问题的方法名称或至少缩小范围?

What is the recommended way to approach this translated stack trace to identify the offending method name or at least narrow it down?

推荐答案

这是一个更新

.NET Native中的Pdb和堆栈

.NET本机PDB与您可能期望的PDB不同。确保保存正确的!在将应用程序编译为本地代码的过程中,我们需要生成一个新的PDB文件,该文件具有所有正确的映射回您的源。如果您没有保存正确的PDB,则将有完全不可操作的堆栈/转储。如果丢失了文件,将无法重新生成该文件。

.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

您会知道它是正确的,因为它将是巨大的(50 + MB)。上传到应用商店后,您可以从开发中心获取云编译的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本机堆栈不是人类可读的

为最大程度地精简,.NET Native编译过程会删除允许运行时生成人类可读堆栈的元数据。今天,它们看起来像:

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]

如果您使用HockeyApp进行遥测,则它们会添加一些功能来重构堆栈,以使其更加有用。请参阅我们的博客文章

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

但是,听起来您没有使用HockeyApp进行遥测那类的东西。假设是这种情况,则需要使用 StackParser 。克隆该存储库,构建它,然后离开。

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).

这篇关于诊断已翻译的UWP堆栈跟踪的步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆