Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 192754 - Last Review: May 29, 2006 - Revision: 4.0
How to debug InProc COM components inside IIS using WINDBG
This article was previously published under Q192754
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 that is 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.
Install WinDbg from the Microsoft Platform 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 folder as the .dll file, and when you use WinDbg make sure the source files for your component are available on the server.
To use WinDbg, follow these steps:
- Install 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 Web application is running in the same memory space as InetInfo, select Inetinfo.exe from the Process List.
MTX PID:
If the Web application 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 that is 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 folder for each isolated application is 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 then double-click Access Violation.
- Select Action = 'Enabled', and then click OK.
- Generate the Access Violation by connecting to the Web site.
- The dialog box will prompt you for the source code. Browse to the source code and then select either the .cls file or the .cpp file.
The WinDbg debugger should now open another window, showing the line on which the component access violated highlighted in yellow.
For more information on remote debugging with WindDbg, click the following article numbers to view the articles in the Microsoft Knowledge Base:
121543Â
(http://kbalertz.com/Feedback.aspx?kbNumber=121543/
)
Setting up for remote debugging
148954Â
(http://kbalertz.com/Feedback.aspx?kbNumber=148954/
)
How to set up a remote debug session using a modem
151981Â
(http://kbalertz.com/Feedback.aspx?kbNumber=151981/
)
How to set up a remote debug session using a null modem cable
148659Â
(http://kbalertz.com/Feedback.aspx?kbNumber=148659/
)
How to set up Windows NT Debug Symbols
For more information on debugging components, see the following Knowledge Base articles:
166275Â
(http://kbalertz.com/Feedback.aspx?kbNumber=166275/
)
How to debug a native code Visual Basic component in VC++
183480Â
(http://kbalertz.com/Feedback.aspx?kbNumber=183480/
)
How to debug ISAPI DLLs under IIS 4.0 and IIS 5.0
APPLIES TO
- Microsoft Internet Information Server 4.0
- Microsoft Internet Information Services 5.0
- Microsoft Active Server Pages 4.0
- Microsoft Visual Studio 6.0 Enterprise Edition
- Microsoft Visual Studio 97 Service Pack 3
| kbbug kbdebug kbhowto KB192754 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate