How to use ADPlus to troubleshoot "hangs" and "crashes"
This article was previously published under Q286350 On This PageSUMMARY
ADPlus is a tool from Microsoft Product Support Services (PSS) that can troubleshoot any process or application that stops responding (hangs) or fails (crashes). Frequently, you can use ADPlus (ADPlus.vbs) as a replacement tool for the Microsoft Internet Information Server (IIS) Exception Monitor (6.1/7.1) and User Mode Process Dump. These are two separate tools that PSS frequently uses to isolate what causes a process to stop responding (hang) or quit unexpectedly (crash) in a Microsoft Windows DNA environment. MORE INFORMATIONSystem requirementsADPlus has the following minimum requirements:
New features for ADPlus Version 6.0ADPlus V6.0 has been completely rewritten. The tool has new switches and new capabilities. You can now configure the tool through an external configuration file. You can view updated information about the new features and switches in the debugger help file (Debugger.chm) that is included in the Microsoft Windows Debuggers package. To obtain the package, visit the following Microsoft Web site:http://www.microsoft.com/whdc/devtools/debugging/default.mspx (http://www.microsoft.com/whdc/devtools/debugging/default.mspx) Debugger.chm is located in the same folder as ADPlus.vbs. To locate the documentation for ADPlus, click the Contents tab, and then click through the following items:
What does ADPlus do?ADPlus is console-based Microsoft Visual Basic script. It automates the Microsoft CDB debugger to produce memory dumps and log files that contain debug output from one or more processes. Each time that you run ADPlus, debugging information (memory dumps and text files that contain debug information) is put in a new, uniquely named folder (such as C:\Temp\Crash_Mode__Date_01-22-2001__Time_09-41-08AM) on the local file system or on a remote network share. Additionally, each file that ADPlus creates has a unique name (such as PID-1708__Inetinfo.exe__Date_01-22-2001__Time_09-41-08AM.log) to avoid overwriting older files with newer ones.ADPlus works with any user mode process or service such as Internet Information Services (IIS), Microsoft Transaction Server (MTS), or Microsoft COM+ applications. The following are some of the features of ADPlus:
When should you use ADPlus?ADPlus is intended to provide Microsoft PSS support professionals with debugging information that they must have to isolate the cause of problems that occur in complex environments.Use ADPlus to capture debugging information if you are experiencing the following problems:
When should you not use ADPlus?Do not use ADPlus in the following situations:
Where do you obtain ADPlus?ADPlus is included with the latest Microsoft Debugging Tools for Windows. To obtain the latest Microsoft Debugging Tools for Windows, visit the following Microsoft Web site:http://www.microsoft.com/whdc/devtools/debugging/default.mspx (http://www.microsoft.com/whdc/devtools/debugging/default.mspx) How does ADPlus work?ADPlus has two modes of operation:
Hang modeIn this mode, ADPlus immediately produces full memory dumps for all the processes that are specified on the command line after the script has completed. Each .dmp file that is created is put in a folder that contains the date/time stamp when ADPlus was run. Each file name contains the process name, the process ID, and the date/time stamp when ADPlus was run. While the process memory is being dumped to a file, the process is frozen. After the memory dump file has been created, the process is resumed by using a noninvasive attach/detach with the CDB debugger.Usage Tip You can use ADPlus in hang mode instead of Userdump.exe to dump the memory for one or more processes. Additionally, hang mode works inside a Terminal Server session. Crash modeIn this mode, ADPlus attaches the CDB debugger to all processes that are specified on the command line. ADPlus automatically configures the debugger to monitor for the following types of exceptions:
Note Crash mode is supported in a Terminal Server session on Windows XP and Microsoft Windows Server 2003 operating systems. When ADPlus is running in crash mode, a debugger remains attached to each process that is specified on the command line for the lifetime of that process until a fatal exception is trapped and the process quits unexpectedly, or until a user presses the CTRL+C key combination to detach the debugger from that process. To manually detach the debugger from the process, you must maximize the debugger window, and then press CTRL+C to break into the debugger. When you press CTRL+C, ADPlus traps this command, starts to list the stacks for all threads to a log file, and then produces a mini memory dump record of the process before it detaches from the debugger. Because crash mode performs an invasive attach, the process is stopped when the debugger is detached. You must restart the process. If it is an MTS or COM+ process, the process is restarted automatically the next time that a call is made to a component in that package. First chance exceptionsEach type of exception (such as an access violation or a stack overflow) can be raised to a debugger as either a first chance exception or a second chance exception. By definition, a first chance exception is non-fatal unless it is not handled correctly by using an error handler. If this problem occurs, the exception is raised again as a second chance exception (only a debugger can handle these). If no debugger handles a second chance exception, the application quits.For more information about first and second chance exceptions and the Windows NT SEH (structured exception handling), click the following article number to view the article in the Microsoft Knowledge Base: 105675 (http://support.microsoft.com/kb/105675/)
First and second chance exception handling
By default, when ADPlus detects a first chance (non-fatal) exception for all types of exceptions except unknown and EH exceptions, it takes the following actions:
However, you can configure ADPlus to produce unique mini memory dumps for first chance EH and unknown exceptions. To do this, you must use a configuration file to customize ADPlus. Second chance exceptionsWhen ADPlus detects a second chance (fatal) exception for all types of exceptions (including EH and unknown exceptions), it takes the following actions:
121366 (http://support.microsoft.com/kb/121366/)
PDB and DBG files - what they are and how they work
291585 (http://support.microsoft.com/kb/291585/) How to create debug symbols for a Visual C++ application
For more information about how to obtain symbols for Microsoft products
(necessary for analyzing memory dumps with the debuggers), visit the following Microsoft Web site:http://www.microsoft.com/whdc/DevTools/Debugging/symbolpkg.mspx (http://www.microsoft.com/whdc/DevTools/Debugging/symbolpkg.mspx) ADPlus command line switchesTo use ADPlus, you must specify a series of command line switches or arguments to the script. At a minimum, ADPlus requires two switches: one that specifies the mode of operation, and one that specifies a target process to operate against.The following are the most frequently used switches. You can also view the complete list of switches by running ADPlus –help, or by viewing the debuggers help file (Debugger.chm).
Run ADPlus for the first timeBy default, debuggers install to the C:\Program Files\Debugging Tools for Windows folder. To change the installation folder, do a custom install when you install the debuggers, and specify a different folder. Alternatively, if a typical installation was performed, copy the contents of the Program Files\Debugging Tools for Windows folder to a different folder.To run ADPlus, open a command shell, switch to the folder where the debuggers were installed or copied, and then type ADPlus.vbs. You may be prompted to change your default script interpreter from Wscript.exe to Cscript.exe. Microsoft strongly recommends that you allow ADPlus to configure CSCript as the default script interpreter. SyntaxADPlus uses the following syntax: ADPlus.vbs mode of operation processes to monitor optional switches where mode of operation is -hang, or -crashwhere processes to monitor is -iis, -pn process.exe, or -p PID where optional switches is -notify, -o, or -quiet. Prepare the server for crash mode debuggingBefore you run ADPlus in crash mode, you must prepare the server to obtain the most information from the ADPlus crash mode debugging sessions.Steps to prepare a Windows 2000-based server for debugging in crash mode
Steps to prepare a Windows NT 4.0-based server for debugging in crash mode
For more information about how to obtain Microsoft Debug Symbols, click the following article number to view the article in the Microsoft Knowledge Base: 268343 (http://support.microsoft.com/kb/268343/)
Umdhtools.exe: How to use Umdh.exe to find memory leaks
After you configure your servers, you can run ADPlus in crash mode. This mode is described in the "Typical ADPlus Usage Scenarios" section.
This section describes some of the typical scenarios where you may have to run ADPlus.
|
| • | Memory |
| • | Process |
| • | Processor |
| • | System |
| • | Thread |
Process quits unexpectedly
In this scenario, a process may randomly quit (or crash) unexpectedly. Run ADPlus in crash mode to obtain a memory dump file of the process or processes that quit before the problem occurs. For example, use one of the following command syntaxes:ADPlus -crash -iis
This command runs ADPlus in crash mode and causes it to attach the CDB debugger to Inetinfo.exe and to all Mtx.exe or Dllhost.exe processes that are running on the computer. ADPlus then waits for any first chance and second chance exceptions to occur. By default, ADPlus puts all files in a subfolder of the installation folder because the -o switch is omitted.
ADPlus -quiet -crash -iis -notify remote computer -o c:\temp
This command runs ADPlus quietly (no dialog boxes, log all output to the event log) in crash mode and causes it to attach the CDB debugger to Inetinfo.exe and to all Mtx.exe or Dllhost.exe processes that are running on the computer. Because the -notify switch is used, the debuggers notify all users who are logged on to the computer named remote computer whenever a crash is detected or when the process that is being monitored quits. Because the -o switch is used, ADPlus puts all output in the C:\Temp folder. If the folder does not exist, ADPlus creates it.
ADPlus -crash -iis -o \\server\share
This command is the same as the previous command except that it logs all output to a network server. ADPlus creates a new subfolder in \\server\share and names the subfolder for the local computer. Therefore, if you are running ADPlus in a Web farm, each server in the farm that has ADPlus running logs its own unique folder under \\server\share. (You do not have to create unique folders for each server. ADPlus does this automatically.)
Note If you are running ADPlus in crash mode from the local console (instead of from a remote command shell as described in the next section), you must remain logged on to the console for the duration of the debug session.
This command runs ADPlus in crash mode and causes it to attach the CDB debugger to Inetinfo.exe and to all Mtx.exe or Dllhost.exe processes that are running on the computer. ADPlus then waits for any first chance and second chance exceptions to occur. By default, ADPlus puts all files in a subfolder of the installation folder because the -o switch is omitted.
ADPlus -quiet -crash -iis -notify remote computer -o c:\temp
This command runs ADPlus quietly (no dialog boxes, log all output to the event log) in crash mode and causes it to attach the CDB debugger to Inetinfo.exe and to all Mtx.exe or Dllhost.exe processes that are running on the computer. Because the -notify switch is used, the debuggers notify all users who are logged on to the computer named remote computer whenever a crash is detected or when the process that is being monitored quits. Because the -o switch is used, ADPlus puts all output in the C:\Temp folder. If the folder does not exist, ADPlus creates it.
ADPlus -crash -iis -o \\server\share
This command is the same as the previous command except that it logs all output to a network server. ADPlus creates a new subfolder in \\server\share and names the subfolder for the local computer. Therefore, if you are running ADPlus in a Web farm, each server in the farm that has ADPlus running logs its own unique folder under \\server\share. (You do not have to create unique folders for each server. ADPlus does this automatically.)
For example, assume that you start ADPlus in crash mode and you use the -iis switch to monitor IIS. When you log out of the console, the copies of Cdb.exe that are running on the console (and all other running applications) quit . As a result, debugging stops, and the process that is being monitored is ended.
To avoid this issue, you can lock the console session (press the CTRL+ALT+DEL key combination, and then click Lock Computer) or run ADPlus from a remote command shell that you have scheduled to run non-interactively (that is, it does not require an interactive logon).
For more information about how to schedule a remote command shell to run non-interactively, see the "Typical ADPlus Usage Scenarios: Run in Crash Mode Remotely" section.
MTS or COM+ server application quits unexpectedly
Custom Component Object Model (COM) components that run in an MTS or COM+ server application actually run in a surrogate process (Mtx.exe or Dllhost.exe). These surrogate processes have properties and settings that you can configure through the MTS Explorer (for Windows NT 4.0) or through the Component Services Microsoft Management Console (MMC) snap-in (for Windows 2000, Windows XP, and Windows Server 2003).By default, MTS or COM+ server applications are configured to quit after three minutes of idle time. To make sure that these processes remain running while the debugger is attached and monitoring for exceptions, you must configure them to Leave running when idle.
Additionally, MTS and COM+ implement a failfast. A failfast is a safeguard that is designed to fail (or quit) MTS/COM+ processes that generate unhandled access violations.
By default, the failfast is enabled in MTS or COM+ applications that raise unhandled access violation exceptions. As a result, a failing MTS/COM+ server application cannot raise a second chance access violation exception (that is, it quits after the first chance acess violation). By default, ADPlus is configured to produce only a mini memory dump record when first chance exceptions occur.
To successfully debug MTS/COM+ server applications, followthese steps:
| 1. | Configure the MTS/COM+ server application to Leave running when idle. |
| 2. | Use the FullOnFirst switch to create full dump files on first chance exceptions. |
| 3. | Run ADPlus in crash mode, and then wait for the application to fail. |
Run in crash mode remotely
There are many occasions when you must initiate ADPlus in crash mode from a local client computer to monitor a process that quits unexpectedly on one or more remote servers in a server farm. Typically, on Windows 2000, you do this through Windows Terminal Services. However, you cannot debug applications that are running in different window stations on Windows NT 4.0 and Windows 2000. Therefore, ADPlus disables crash mode functionality when it detects that it is running in a Terminal Services session. To resolve this issue, share the remote server by using the Remote.exe utility, create a batch file that starts a command shell on the remote server, and then schedule this batch file to run on the target server by using the AT command. (The AT command causes the command shell to run non-interactively, similiar to a service.) The remote command shell is then connected to a local workstation or client computer that uses the same Remote.exe utility that you used to start the command shell.To start a remote command shell on a server by using the AT command, follow these steps:
| • | On the remote server Assume that the debuggers are installed to C:\Debuggers. Follow these steps:
| ||||||||||
| • | On the local client:
Install the debuggers on the local client computer or (at a minimum) copy the Remote.exe utility locally. (By default, the utility is installed with the debuggers in the root installation folder.) Assume that the debuggers and the Remote.exe utility are installed to C:\Debuggers. Follow these steps:
|
Additional information and known issues
| • | How can you determine if ADPlus has captured information about a crash or if a process that is being monitored in crash mode has quit?
There are several ways to determine this:
| ||||||||||||||||||
| • | You must install Windows Scripting Host components on the system for ADPlus to run. To download the Windows Scripting Host, visit the following Microsoft Web site:
http://msdn2.microsoft.com/en-us/library/ms950396.aspx (http://msdn2.microsoft.com/en-us/library/ms950396.aspx) Note Windows Scripting Host components may already be installed if you have any of the following Microsoft products installed:
| ||||||||||||||||||
| • | The -iis switch works only if Internet Information Server (IIS) 4.0 or Internet Information Services (IIS) 5.0.x is installed. | ||||||||||||||||||
| • | When you run ADPlus in quiet mode, the tool logs information to the event log. | ||||||||||||||||||
| • | If you use the -o switch, the specified path must not contain more than one nonexistent folder. For example:
| ||||||||||||||||||
| • | In COM+, you can configure a server package to start in the debugger on the Advanced tab in the Properties dialog box of the package. If you enable the Launch in Debugger option, ADPlus cannot attach the CDB debugger to a process. By default, only one debugger can be attached to a process at a time. | ||||||||||||||||||
| • | When a remote procedure call (RPC) is made from a process that ADPlus is analyzing in crash mode to another process that has quit (intentionally or unexpectedly), the log file that ADPlus creates for the process that it is analyzing may contain one or more of the following exceptions:
Unknown exception - code 80010105 (first chance)
These exceptions are typical. RPC raises these exceptions when a call is made from a process that is being monitored to a nonexistent or failed process.Unknown exception - code 800706be (first chance) Unknown exception - code 800706ba (first chance) Additionally, if ADPlus is monitoring Inetinfo.exe in the ADPlus debug log for that process, the following exception may appear in the log:
Unknown exception - code 800706bf (first chance)
This exception typically appears after IIS makes a call to an out-of-process (high-isolation) Web site that has failed. It may be followed by two instances of the following exception:
Unknown exception - code 800706ba (first chance)
|
REFERENCES
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
323478 (http://support.microsoft.com/kb/323478/)
You cannot debug through a Terminal Server session
APPLIES TO
| • | Microsoft Internet Information Services 6.0 |
| • | Microsoft Internet Information Services 5.1 |
| • | Microsoft Internet Information Services 5.0 |
| • | Microsoft Internet Information Server 4.0 |
| • | Microsoft Internet Information Server 3.0 |
| • | Microsoft Windows NT 4.0 |
| • | Microsoft Windows 2000 Standard Edition |
| • | Microsoft Windows XP Service Pack 2 |
| • | Microsoft Windows Server 2003, Enterprise Edition (32-bit x86) |
| • | Windows Vista Enterprise |
| • | Windows Server 2008 Datacenter |
| • | Windows Server 2008 Enterprise |
| • | Windows Server 2008 Standard |
Keywords: | kbbug kbdebug kbhowto KB286350 |
Article Translations
Related Support Centers |
Other Support Options
|
Page Tools |

Back to the top
