HOWTO: Debug InProc COM Components Inside IIS Using WINDBG
ID: Q192754
|
The information in this article applies to:
-
Microsoft Internet Information Server version 4.0
-
Active Server Pages
-
Microsoft Visual Studio versions 6.0, 97
-
Microsoft Win32 Software Development Kit (SDK)
SUMMARY
This article explains how to use WinDbg in case of an Active Server Pages
(ASP) 'ASP0115 Access Violation' error during the execution of a custom
component written in Visual C++++ or Visual Basic.
You can use WinDbg to further debug the component to find the actual line
of code that the component is failing on.
MORE INFORMATION
Install WinDbg from the Microsoft Platorm SDK.
Follow the instructions below for running it. Turn off Code optimization
in your compiler and compile the debug version with the .pdb files. The debug symbols (.pdb files) for your custom component should be placed in the same
directory as the .dll and when you use WinDbg make sure the source files for
your component are available on the server.
Here's how to use WinDbg:
- Install the WinDbg from the Microsoft Platform SDK.
- Start WinDbg. From the Debug menu, click Attach to A Process. Select the correct Process ID (PID) from the Process List:
InetInfo PID:
If the webapplication is running in the same memory space as InetInfo, you should
select Inetinfo.exe from the Process List.
MTX PID:
If the webapplication has been set up to run in a separate memory space, the process will be an instance of
Mtx.exe. There may be multiple instances of Mtx.exe in the Process List, so you can use one of
the two methods outlined below to identify the appropriate process to attach
to.
- If the Web site is being hosted on a computer running Windows NT 4 with
Service Pack 4, you can use the Script Debugger to obtain the processID of
the appropriate instance of Mtx.exe. To do this, open the Script
Debugger's Running Documents window. The root directory for each isolated
application will be listed along with the processID of the appropriate
instance of Mtx.exe.
- If the Web site is being hosted on a computer running Windows NT 4 with
Service Pack 3 or earlier, you will need to use a special utility to
determine the processID. The IIS Resource Kit for IIS version 4.0 includes
a utility called "GetPID" that you can use to identify the Process ID for
an isolated application.
- From the Debug menu, click Exceptions and select the following:
- Double-click Access Violation.
- Select Action = 'Enabled'.
- Click OK.
- Generate the Access Violation by connecting to the Web site.
- The dialog box will appear asking for the source code. Navigate to the
source code and select the .cls or .cpp file.
- The WinDbg debugger should now open another window showing the line the
component access violated on highlighted in yellow.
REFERENCES
Remote Debugging with WindDbg
Q177556 INFO: Articles on Remote Debugging with WinDBG
Q121543 Setting Up for Remote Debugging
Q170756 Available Switch Options for Windows NT Boot.ini File
Q148954 How to Set Up a Remote Debug Session Using a Modem
Q151981 How to Set Up a Remote Debug Session Using a Null Modem Cable
Q148659 How to Set Up Windows NT Debug Symbols
Q140718 PRB: Cannot Connect to WinDbgRm
Debugging Components
Q166275 HOWTO: Debug a Native Code Visual Basic Component in VC++
Q177182 Debugging a VB DLL under Active Server Pages
Q183480 Debug ISAPI and Filter DLL Under IIS 4.0
Additional query words:
kbDebug
Keywords : kbASP kbCOMt kbDebug kbGrpASP
Version : WINDOWS:6.0,97; winnt:4.0
Platform : WINDOWS winnt
Issue type : kbhowto
Last Reviewed: July 21, 1999