ADPlus from the Debugging Tools can be used to get Crash Dumps and Hang Dumps which would contain the most-needed information for debugging. It used to be a vbscript file which was used to attach the cdb debugger (cdb is a command line debugger). Now ADPLus is a managed code application. Because of this, the command line flags used with ADPlus are different than what they were prior. You can still use the older VBScript file , however its best to use the newer application as it contain bug fixes and capabilities beyond the older script.
Highlights of the newer ADPlus:
To use ADPlus, you must install the Debugging Tools for Windows. ADPlus needs to be run from a command prompt running under and local administrator account with elevated privileges. If you fail to do this, the dump file may not be created.
Install the Debugging Tools for Windows to get ADPlus:
1. Download the debugging tools to match the version of Windows of the machine where the program is running and the processor type (32bit or 64bit) of the application for which the dump is going to be taken.
Debugging Tools and Symbols: Getting Started
2. Install the tools on the machine where you are running the application that is crashing.
How to take a crash dump with ADPlus:
Crash dumps are taken by connecting to a running application using a debugger and having the debugger creates a dump file - ADPlus automates this operation.
1. After the install, in the directory where you installed the tools, there should be a program named "adplus.exe". Open a command prompt with and administrator account (or have the prompt "Run as administrator") and navigate to the directory where this file is installed.
2. Start the application you are trying to debug.
3. Run the script with the following syntax:
a) By process name.
adplus -crash -pn <process name> -o c:\mydumpfolder
Note: So for instance if you had notepad.exe running and you wanted to dump it, the syntax would be:
adplus -crash -pn notepad.exe
b) By Process ID:
adplus -crash -p <process id> -o c:\mydumpfolder
Note: You can get the process ID from Windows Task Manager or tlist (in the debuggers directory).
c) By launching the application:
adplus -hang -o c:\mydumpfolder -sc <executable file>
Note: <executable file> is the file path and name of the executable.
d) For COM+ service:
To attach to a running COM+ application, you can use the Process ID (PID) of the running instance of DLLHOST (it’s used to run COM+ applications). According to MS documentation, to successfully debug MTS/COM+ server applications, follow these steps:
a. Configure the MTS/COM+ server application to Leave running when idle.
b. Use the FullOnFirst switch to create full dump files on first chance exceptions.
c. Run ADPlus in crash mode, and then wait for the application to fail.
Attach to the process running the application pool running the application.
4. Wait for the crash to occur.
5. A directory will be created in the same directory as the script file. You'll know it when you see it. It will be a very long folder name. Zip this folder up naming the zip file as your case number which is in the subject of this email.
Note: Once the crash occurs, you must restart the process. COM+ and MTS apps will automatically restart when their component is called.
How to take a hang dump with ADPlus:
1) In the directory where you installed the debugging tools, there should be a script name "adplus.vbs". Open a command prompt and navigate to the directory where this file is installed.
2) Run the script using one of the fHow to take a hang dump with ADPlus:ollowing methods:
adplus -hang -pn <process name> -o c:\mydumpfolder
Note: So for instance if you had notepad.exe running and you wanted to dump it, the syntax would be: adplus-hang -pn notepad.exe –quiet
adplus-hang -p <process id> -o c:\mydumpfolder
Note: You can get the process ID from Windows Task Manager or tList (in the debuggers directory).
adplus -hang -sc <executable file> -o c:\mydumpfolder
3) A directory will be created in the same directory as the script file. You'll know it when you see it. It will be a very long folder name.
4) Wait about 2-5 minutes and generate another dump of the same process.
After everything is completed you should have 2 different dumps. The dump files, even zipped, will most likely still be too big to send via email. It’s best to setup an FTP or upload site in order to provide such dumps to another person.
You can alternatively use - -r parameter to have a series of hang dumps taken at an interval.
Adplus –Hang –r <number of dumps> <interval sec>–p 6888 –o c:\test
As an example, you could have a hang dump taken three times, every 10 seconds using the following:
Adplus –Hang –r 3 10 -p 6888 –o c:\test
Note: You may need to restart the process if it is hung, however it normally will continue running after the debugger used by ADPlus detaches.
About the dump file created:
The dump file will be created in a sub-folder under where ADPlus is being run. The name of this folder will contain the type of dump taken (Crash or Hang) and the date the dump was taken. This folder will contain several files. When you look at the dump file, you will see it has a very long name and ends with ".dmp".
The name of the crash dump file should be checked to be sure it looks correct:
Application name This is the name of the application for which the dump was taken.Partial Error message:
"1st_chance" This means the dump was taken during a caught exception (ie first chance).
"2nd_chance" This shows that the dump was taken 2nd chance exception - which is what we want to see for a crash dump.
Note: There are countless variations, the main thing is that the error message you see should tie back to what you would be expecting. The main thing is that you see 2nd_chance" noted in the filename for a crash dump.
Type of error The filename should contain a partial error description, so you know which exception the 2nd chance exception was thrown for.
-n Is used to send a notification (pop-up dialog to the console of a remote machine) when a dump is taken.
How to use ADPlus to troubleshoot "hangs" and "crashes"
If your looking at instructions for taking dumps with the older adplus script, here are some links:
Howto: Generating a Crash Dump with adplusttp://blogs.msdn.com/b/webdav_101/archive/2008/09/04/howto-generating-a-crash-dump-with-adplus.aspx
Howto: Generating a Hang Dump with adplushttp://blogs.msdn.com/b/webdav_101/archive/2008/09/04/howto-generating-a-hang-dump-with-adplus.aspx
Here is more information on taking dumps:
Howto: Getting Process IDshttp://blogs.msdn.com/b/webdav_101/archive/2008/09/04/howto-getting-process-ids.aspx
Howto: Determine which Process Is It Running Under (Exchange and Outlook Development/Admin related)http://blogs.msdn.com/b/webdav_101/archive/2011/01/04/howto-determine-which-process-is-it-running-under-exchange-and-outlook-development-admin-related.aspx
Howto: Generate a Mini-Dump with Task Manager in Vistahttp://blogs.msdn.com/b/webdav_101/archive/2008/09/04/howto-generate-a-mini-dump-with-task-manager-in-vista.aspx
Howto: Take a hang dump in Visual Studiohttp://blogs.msdn.com/b/webdav_101/archive/2008/09/04/howto-take-a-dump-in-visual-studio.aspx