C# 获取 IIS 工作进程崩溃转储

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/53435/
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-08-03 10:06:50  来源:igfitidea点击:

Getting IIS Worker Process Crash dumps

提问by CVertex

I'm doing something bad in my ASP.NET app. It could be the any number of CTP libraries I'm using or I'm just not disposing something properly. But when I redeploy my ASP.NET to my Vista IIS7 install or my server's IIS6 install I crash an IIS worker process.

我在我的 ASP.NET 应用程序中做了一些不好的事情。它可能是我正在使用的任意数量的 CTP 库,或者我只是没有正确处理某些东西。但是,当我将 ASP.NET 重新部署到 Vista IIS7 安装或服务器的 IIS6 安装时,我使 IIS 工作进程崩溃。

I've narrowed the problem down to my HTTP crawler, which is a multithreaded beast that crawls sites for useful information when asked to. After I start a crawler and redeploy the app over the top, rather than gracefully unloading the appDomain and reloading, an IIS worker process will crash (popping up a crash message) and continue reloading the app domain.

我已经将问题缩小到我的 HTTP 爬虫,这是一个多线程的野兽,当被要求时,它会爬取站点以获取有用的信息。在我启动爬虫并在顶部重新部署应用程序后,而不是正常卸载 appDomain 并重新加载,IIS 工作进程将崩溃(弹出崩溃消息)并继续重新加载应用程序域。

When this crash happens, where can I find the crash dump for analysis?

发生此崩溃时,在哪里可以找到崩溃转储以进行分析?

采纳答案by sachaa

Download Debugging tools for Windows: http://www.microsoft.com/whdc/DevTools/Debugging/default.mspx

下载 Windows 调试工具:http: //www.microsoft.com/whdc/DevTools/Debugging/default.mspx

Debugging Tools for Windows has has a script (ADPLUS) that allows you to create dumps when a process CRASHES: http://support.microsoft.com/kb/286350

Windows 调试工具有一个脚本 (ADPLUS),允许您在进程崩溃时创建转储:http: //support.microsoft.com/kb/286350

The command should be something like (if you are using IIS6):

该命令应该类似于(如果您使用的是 IIS6):

cscript adplus.vbs -crash -pn w3wp.exe

This command will attach the debugger to the worker process. When the crash occurs it will generate a dump (a *.DMP file).

此命令将调试器附加到工作进程。当崩溃发生时,它会生成一个转储(*.DMP 文件)。

You can open it in WinDBG (also included in the Debugging Tools for Windows). File > Open Crash dump...

您可以在 WinDBG 中打开它(也包含在 Windows 调试工具中)。文件 > 打开崩溃转储...

By default, WinDBG will show you (next to the command line) the thread were the process crashed.

默认情况下,WinDBG 将向您显示(在命令行旁边)进程崩溃的线程。

The first thing you need to do in WinDBG is to load the .NET Framework extensions:

在 WinDBG 中您需要做的第一件事是加载 .NET Framework 扩展:

.loadby sos mscorwks

then, you will display the managed callstack:

然后,您将显示托管调用堆栈:

!clrstack

if the thread was not running managed code, then you'll need to check the native stack:

如果线程没有运行托管代码,那么您需要检查本机堆栈:

kpn 200

This should give you some ideas. To continue troubleshooting I recommend you read the following article:

这应该会给你一些想法。要继续进行故障排除,我建议您阅读以下文章:

http://msdn.microsoft.com/en-us/library/ee817663.aspx

http://msdn.microsoft.com/en-us/library/ee817663.aspx

回答by Gareth Jenkins

A quick search found IISState- it relies on the Windows debugging toolsand needs to be running when a crash occurs, but given the circumstances you've described, this shouldn't be a problem,

快速搜索发现IISState- 它依赖于Windows 调试工具,并且需要在发生崩溃时运行,但鉴于您所描述的情况,这应该不是问题,