5

I've set up ADPlus / cdb as the default Just-In-Time debugger on my machine. When any process has an unhandled exception or crashes for any other reason, I want ADPlus to generate a crash dump for me. I'm using an ADPlus config file to set the output directory and run a precommand that is used to push the dmp file to the cloud.

To test to make sure that this works, I wrote a really simple program that throws an unhandled exception and crashes. ADPlus always attaches itself like it is supposed to, but it only successfully generates the dump that I want about 1 in 15 times. Without changing anything on my system, I run my crashing program back to back and get different results.

Most of the time, I get the following error from cdb:

0:000> g

       ^ No runnable debuggees error in 'g'

0:000>

*[EOF]*

When it works properly, the same place in the log looks like this:

0:004> g

FirstChance_epr_Process_Shut_Down

*[More stuff after here]*

Any idea why I would be getting this behavior? I can post my config file and full logs if that would be helpful. The only difference between the when-it-works logs and the when-it-doesn't-work logs is the lines all start with 0:004> when it works and with 0:000> when it doesn't.

Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
mrranstrom
  • 228
  • 2
  • 10
  • When ADPlus dumps the process...it supposedly does this asynchronously. However, crashing your process multiple times in quick succession...might be causing the problem?...try and track the time period between successful dumps...and see if there's a pattern, and check the timestamps of the .dmp files. – Colin Smith Aug 19 '12 at 02:04
  • Also as an alternative to using ADPlus...try DebugDiag to dump your process when a crash occurs...you might have a better result. http://www.microsoft.com/en-us/download/details.aspx?id=26798 ... http://blogs.msdn.com/b/tess/archive/2009/03/20/debugging-a-net-crash-with-rules-in-debug-diag.aspx .... or ProcDump ... http://technet.microsoft.com/en-US/sysinternals/dd996900.aspx – Colin Smith Aug 19 '12 at 02:11
  • http://windowsdebugging.wordpress.com/2012/03/14/procdumpisbecomingmyfavourite/ .... are you creating minidumps or full dumps? – Colin Smith Aug 19 '12 at 02:12
  • There doesn't seem to be a pattern for the timestamps - sometimes I can get dumps within a few seconds of each other and sometimes I can't get dumps for tens of seconds of running my crashing application over and over. What I like particularly about ADPlus are the pre- and post- commands that I can configure in an external configuration file. Does DebugDiag have something like this? I'm generating full dumps. – mrranstrom Aug 20 '12 at 23:15

2 Answers2

1

Comment couldn't hold all this...so putting here...

Yes with DebugDiag you can have a pre-attach VBS script, and you can define a Custom Action (i.e. run a VBS script) when an event occurs.

I think you need to wait till CDB has completed the dump and CDB/your process has exited before you attempt to launch your application again. (you can use tlist in your script to monitor processes...to wait till it disappears). ...otherwise ADPlus with the -PN option might be making CDB attempt to reattach to the already crashed process...which it can't because a debugger is already attached.

Put up TaskManager and see if you ever get multiple instances of your application showing up (if you do, then you might have to use the -p PID option instead to get adplus to monitor the right process...not ideal as you have to have started the process first in order to get its PID).

Also look into ProcDump which uses a technique called Reflected Processes...which allows a very quick way to copy the process space and let the dump be completed without holding up things...that might help if DebugDiag doesn't.

Look at this link...right at the bottom...it shows how to wait for CDB to finish doing the dump (however it's a Powershell script).

Colin Smith
  • 12,375
  • 4
  • 39
  • 47
  • Other things have taken priority over this issue for now, so I haven't had a a chance to implement your suggestions. I'll still go ahead and award you the bounty. Thanks for answering. – mrranstrom Aug 23 '12 at 18:25
0

The WinDbg command 'g' means [Continue]

Since you're opening a dump-file there is no way to 'continue', it only contains the process memory.

So the message " No runnable debuggees error in 'g' " is logical in your case since the process is not running.

Concerning loading the correct version of SOS use the following command depending on the .NET version.

.NET 4 and higher .loadby sos

.NET 3.5 and 2 .loadby sos mscorwks

.NET 1.0 and 1.1 .load clr10\sos

HerbalMart
  • 1,669
  • 3
  • 27
  • 50