How to generate a dump file when ASP.NET deadlocks in IIS 6.0 (828222)



The information in this article applies to:

  • Microsoft ASP.NET (included with the .NET Framework 1.1)
  • Microsoft Internet Information Services version 6.0

In this task

SUMMARY

When you experience a deadlock in Internet Information Services (IIS) 6.0, an error that is similar to the following will appear in the application event log:Event Type: Warning
Event Source: W3SVC-WP
Event Category: None
Event ID: 2262
Date: 7/29/2003
Time: 12:08:58 PM
User: N/A
Computer: ComputerName
Description: ISAPI 'C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll' reported itself as unhealthy for the following reason: 'Deadlock detected'.

An error message that is similar to the following will appear in the system event log:Event Type: Warning
Event Source: W3SVC
Event Category: None
Event ID: 1013
Date: 7/29/2003
Time: 12:09:34 PM
User: N/A
Computer: ComputerName
Description: A process serving application pool 'DefaultAppPool' exceeded time limits during shut down. The process id was '2756'.

For more information, see Help and Support Center at http://support.microsoft.com.

Generate dump files for diagnosis

IIS 6.0 has a new feature that is named Orphan Worker Process. This feature allows you to inspect a process that is scheduled to be recycled before the process is terminated. The Orphan Worker Process can be used to attach a debugger to the process and to generate a dump file for investigation.

Note This feature is not enabled when processes run in IIS 5.0 Compatibility mode.

Create a batch file to execute when a worker process is orphaned

  1. Start Notepad
  2. Paste the following code to Notepad:
    @if "%_echo%"=="" echo off
    setlocal
        set TIMESTAMP=%DATE:~-9%_%TIME%
    set TIMESTAMP=%TIMESTAMP:/=_%
    set TIMESTAMP=%TIMESTAMP::=_%
    set TIMESTAMP=%TIMESTAMP:.=_%
    set TIMESTAMP=%TIMESTAMP: =_%
    set FILENAME=c:\crash_%TIMESTAMP%.dmp
    set LOG=c:\log.txt
    set COMMAND=c:\debuggers\cdb.exe -c ".dump /o /mhf %FILENAME%;q" -p %1
    
    echo %COMMAND% > %LOG%
    %COMMAND%
    
    endlocal
  3. Save the file as FileName.cmd. For this example, we will name the file action.cmd. However, you may name the file as you want.
Note You may have to modify the location of the debuggers and the location that you want the resulting dump file to be generated.

Configure the orphan worker process settings

  1. At the command prompt, type the following command, and then press ENTER:

    cd \Inetpub\adminscripts

  2. To enable the Orphan Worker Process feature, type the following command at the command prompt:
    adsutil.vbs SET W3SVC/AppPools/DefaultAppPool/OrphanWorkerProcess TRUE
    
  3. At the command prompt, set the executable to run when a process is scheduled to be recycled. For example, in this case use the batch file that was created in the "Create a Batch File to Execute When a Worker Process Is Orphaned" section:
    adsutil.vbs SET W3SVC/AppPools/DefaultAppPool/OrphanActionExe "c:\action.cmd"
    adsutil.vbs SET W3SVC/AppPools/DefaultAppPool/OrphanActionParams "%1%" 
    
Note Make sure that the OrphanActionExe option points to the location of the batch file that was created in the "Create a Batch File to Execute When a Worker Process Is Orphaned" section. Also make sure that the identity of the W3wp.exe process has Read and Execute permissions to this file.

Modification Type:MajorLast Reviewed:8/21/2006
Keywords:kbDebug kbHOWTOmaster KB828222 kbAudDeveloper