DebugDiag

DebugDiag seems to be replacement for LeakDiag and can be downloaded from Microsoft: http://www.microsoft.com/downloads/details.aspx?familyid=28BD5941-C458-46F1-B24D-F60151D875A3&displaylang=en

Somebody found problem of running it to detect memory leak, following were copied from http://www.pretentiousname.com/debugdiag_fix/index.html:

DebugDiag fix for Overflow at Line 2397

DebugDiag is a free debugging tool which you can get from Microsoft. It’s for debugging crashes, hangs and memory leaks.

If you’ve tried to use DebugDiag 1.1 (latest as of March 2009) to debug a memory leak then you may have run into this error:

Script Name
Status
Error Code
Error Source
Error Description
Source Line

MemoryAnalysis.asp
Failed
0x800a0006
Microsoft VBScript runtime error
Overflow
Line 2397, Column 0

A fix for that error is available below.

Installing the fix
  1. Download DebugDiag_1_1_fix.zip (PGP sig) and extract it to a temp folder.

  2. Go to C:\Program Files\DebugDiag\Scripts\Inc (that’ll be Program Files (x86) on 64-bit Windows) and verify that your current HeapFunctions.asp is the same as HeapFunctions_orig.asp from the zip.

  3. If the old files are not the same then don’t continue. You could be using a newer version of DebugDiag which includes a similar fix and copying my file over yours could break something!

  4. Assuming the old files are the same, copy the new HeapFunctions.asp from the zip over the one in Program Files and you’re done.

Your existing DebugDiag dump files should be fine. You just need to select them and re-generate the analysis of them.

Details of the fix

For each memory heap in the target process DebugDiag reports two percentages: Committed / Reserved and Uncommitted / Reserved. If the Reserved value is zero — presumably due to a heap which was created but never used — then those calculations trigger a divide-by-zero error which VBScript reports as an overflow.

This was easy to fix because the calculations are done in some VBScript within one of the .ASP text files that are part of DebugDiag. While the error message says the problem is in on line 2397 of MemoryAnalysis.asp it’s actually on line 187 of HeapFunctions.asp, which MemoryAnalysis.asp includes. (Neither file even has a line 2397; they’re both much shorter. The parser appears to treat included files as if they were literally part of the top-level file, reporting all errors as coming from the top-level file and accumulating line numbers as each file is included.)

Here’s a screenshot showing my changes and the source of the divide-by-zero errors:

Advertisements

Posted on September 10, 2009, in Uncategorized. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: