Sos.dll和windbg获取引发的异常 [英] Sos.dll and windbg Get exceptions thrown

查看:54
本文介绍了Sos.dll和windbg获取引发的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用sos.dll和windbg来分析w3wp.exe转储.perfmon中显示了每秒出现大量的.Net CLR异常,我正在尝试对此进行调查.我尝试执行!dumpheap -stat -type异常.但这是否显示在我进行转储的实例上抛出的异常,还是显示所有已创建的异常对象实例?可以创建异常对象实例而不会引发该异常.

有没有办法只获取抛出的异常?

解决方案

您使用了错误的工具.安装Windows Performance Toolkit,它是Windows 10 SDK的一部分.

在此演示中,VS Addon Resharper导致了 JetBrains.Application.Progress.ProcessCancelledException .检查您在处理过程中看到的错误,并检查引发异常的堆栈.

I am using sos.dll and windbg to anayze a w3wp.exe dump. There is a high number of .Net CLR exceptions thrown per/sec shown in perfmon and i am trying to investigate this. I tried doing a !dumpheap -stat -type Exception. But does this show the exceptions that were thrown at the instance i took the dump or does this show all the exception object instances that were created? Exception object instances may be created without being thrown.

Is there a way to just get the exceptions that were thrown?

解决方案

You use the wrong tools. Install Windows Performance Toolkit which is part of the Windows 10 SDK. The 1607 SDK can be used for Win8/10 systems, the older 1511 SDK can be used for Windows 7/2008R2.

Now use the WPRP profile that I posted here to capture the activity of your application by opening a cmd.exe as admin

"C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\wpr.exe" -start C:\DotNetRuntime.wprp

After captured some activity of your tool, run this command to stop the capturing:

"C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\wpr.exe" -stop C:\Result.etl

Now make a double click on the Result.etl to open it in Windows Performance Analyzer and load debug symbols.

Now drag & drop the Generic Event graph to the analysis pane, order the colums for Provider, process, Taskname, Field 1, Time, Opcode Name and Stack. Now filter for the Microsoft-Windows-DotNETRuntime provider and expand your process name entry and next expand the entry for Taskname Exception:

Here in this demo, the VS Addon Resharper caused a JetBrains.Application.Progress.ProcessCancelledException . Check which excceptions you see for your process and check the stack where the exceptions are raised.

这篇关于Sos.dll和windbg获取引发的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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