破译.NET clr20r3异常参数P1..P10

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4052770/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 14:51:45  来源:igfitidea点击:

Deciphering the .NET clr20r3 exception parameters P1..P10

.netexceptionclr

提问by Ian Boyd

I'm trying to decipher the meaning on the P1...P10 parameters associated with a clr20r3that is written to the event log when my application experiences an exception.

clr20r3当我的应用程序遇到异常时,我试图破译与写入事件日志的a 相关联的 P1...P10 参数的含义。

The best I've been able to findis:

能找到的最好的是:

  • P1: the hosting process (e.g.w3wp.exe)
  • P2: the hosting process version (e.g.6.0.3790.1830)
  • P3: ??? (e.g.42435be1)
  • P4: the assembly from which the exception was raised (e.g.mrtables.webservice)
  • P5: the assembly version (e.g.2.1.2.0)
  • P6: ??? (e.g.4682617f)
  • P7: ??? (e.g.129)
  • P8: ??? (e.g.50)
  • P9: the exception type raised (e.g.system.argumentexception)
  • P10: ??? (e.g.NIL)
  • P1:托管进程(例如w3wp.exe
  • P2:托管进程版本(例如6.0.3790.1830
  • P3:???(例如42435be1
  • P4:引发异常的程序集(例如mrtables.webservice
  • P5:汇编版本(例如2.1.2.0
  • P6:???(例如4682617f
  • P7:???(例如129
  • P8:???(例如50
  • P9:引发的异常类型(例如system.argumentexception
  • P10:???(例如NIL

Googling for clr20r3provides thousands of sample parameter values, from which someone can try to derive a pattern.

谷歌搜索 clr20r3提供了数千个示例参数值,有人可以尝试从中推导出模式。

But I'm hoping for documentation on the parameter meanings, as opposed to educated guesses.

但我希望有关于参数含义的文档,而不是有根据的猜测。



Edit:While I can hope for canonical documentation, really I'd be happy to see the exception being thrown, at what line, complete with a stack trace.

编辑:虽然我希望有规范的文档,但我真的很高兴看到在哪一行抛出异常,并带有堆栈跟踪。

Bonus Reading

奖励阅读

采纳答案by Naveen

Here is the information on Watson Buckets

以下是有关 Watson Buckets 的信息

  1. Exe File Name
  2. Exe File assembly version number
  3. Exe File Stamp
  4. Exe file full assembly name
  5. Faulting assembly version
  6. Faulting assembly timestamp
  7. Faulting assembly method def
  8. Faulting method IL Offset within the faulting method
  9. Exception type
  1. exe文件名
  2. exe文件程序集版本号
  3. exe文件戳
  4. exe文件完整程序集名称
  5. 错误的程序集版本
  6. 错误的程序集时间戳
  7. 错误的组装方法def
  8. 故障方法 IL 故障方法内的偏移
  9. 异常类型

And also here is a MSDNarticle on the same.

这里还有一篇关于相同的MSDN文章。

Sample:

样本:

  Problem Signature 01: devenv.exe
  Problem Signature 02: 11.0.50727.1
  Problem Signature 03: 5011ecaa
  Problem Signature 04: Microsoft.VisualStudio.SharePoint.Project
  Problem Signature 05: 11.0.60226.0
  Problem Signature 06: 512c2dba
  Problem Signature 07: 18a8
  Problem Signature 08: 1d
  Problem Signature 09: System.NullReferenceException

回答by Hans Passant

P7 and P8 are the important ones to find out where the P9 exception was raised. Use P4 to know what assembly to look for. Run ildasm.exe and open that assembly. File + Dump, tick the "Token values" checkbox, OK and save the .il file somewhere.

P7 和 P8 是找出 P9 异常在哪里引发的重要部分。使用 P4 了解要查找的程序集。运行 ildasm.exe 并打开该程序集。文件 + 转储,勾选“令牌值”复选框,确定并将 .il 文件保存在某处。

Open the file in a text editor. P7 gives you the method token, it starts with 0x06, producing token value "06000129". Search for:

在文本编辑器中打开文件。P7 为您提供方法令牌,它以 0x06 开头,产生令牌值“06000129”。搜索:

.method /*06000129*/

Which gives you the method name, look up from there to find the .class, that gives you the class name.

它为您提供了方法名称,从那里查找以找到 .class,它为您提供了类名称。

P8 gives you the IL offset. From the found .method, look for IL_0050 for the instruction that raised the exception. Mapping it back to your source code is a bit tricky but you'll probably figure it out. Use Reflector if necessary.

P8 为您提供 IL 偏移量。从找到的 .method 中,查找引发异常的指令的 IL_0050。将它映射回您的源代码有点棘手,但您可能会弄清楚。必要时使用反射器。

In general, write an event handler for AppDomain.UnhandledExceptionto avoid the pain of reverse-engineering these Watson crash buckets. Log the value of e.ExceptionObject.ToString()to get both the exception message and a stack trace.

通常,编写一个事件处理程序,AppDomain.UnhandledException以避免对这些 Watson 崩溃桶进行逆向工程的痛苦。记录 的值e.ExceptionObject.ToString()以获取异常消息和堆栈跟踪。