views:

228

answers:

2

I want to catch Memory Access Violation in SQL Server Compact Edition like this described at http://debuggingblog.com/wp/2009/02/18/memory-access-violation-in-sql-server-compact-editionce/ The suggested config is:

<ADPlus>
   <Settings>
     <RunMode>CRASH</RunMode>
     <Option>Quiet</Option>
     <ProcessName>MyApp.exe</ProcessName>
   </Settings>
   <Exceptions>
     <Option>NoDumpOnFirstChance</Option>
     <Config>
       <Code>clr;av</Code><!–to get the full dump on clr access violation–>
       <Actions1>FullDump</Actions1>
       <ReturnAction1>gn</ReturnAction1>
     </Config>
   </Exceptions>
</ADPlus>

I download latest Debugging Tools and observe what Microsoft rewrite adplus tool into managed code and change syntax of config File. I rewrite config file like this:

 <ADPlus  Version="2">
 <Settings>
  <RunMode>Crash</RunMode>
  <Option>Quiet</Option>
  <Option>NoDumpOnFirst</Option>
  <Sympath>c:\symbols\</Sympath>
  <OutputDir>c:\work\output\</OutputDir>
  <ProcessName>c:\work\app\output\MyApp.exe</ProcessName>
 </Settings> 

 <Exceptions><!--to get the full dump on clr access violation-->
  <Exception Code="clr;av">   
   <Actions1>FullDump</Actions1>
   <ReturnAction1>gn</ReturnAction1>
  </Exception>  
 </Exceptions>
</ADPlus>

And I get error "Couldn't find exception with code: clr;av". If I understand right It didn't load sos extension, but I can't find the right section and syntax that I should use to load it.

adplus_old.vbs - for some reasons didn't launch process on Windows 7. WinDBG 6.12.0002.633 X86 ADPlus Engine Version: 7.01.002 02/27/2009

Maybe someone has a working example of config of debugging .NET app with latest adplus.exe?

A: 

This should load SOS.dll for you (if you are using framework v1, the is <cmd>.load clr10\sos.dll</cmd>):

 <ADPlus  Version="2"> 
 <precommands>
    <cmd>.loadby sos mscorwks</cmd>
 </precommands>

 <Settings> 
  <RunMode>Crash</RunMode> 
  <Option>Quiet</Option> 
  <Option>NoDumpOnFirst</Option> 
  <Sympath>c:\symbols\</Sympath> 
  <OutputDir>c:\work\output\</OutputDir> 
  <ProcessName>c:\work\app\output\MyApp.exe</ProcessName> 
 </Settings>  

 <Exceptions><!--to get the full dump on clr access violation--> 
  <Exception Code="clr;av">    
   <Actions1>FullDump</Actions1> 
   <ReturnAction1>gn</ReturnAction1> 
  </Exception>   
 </Exceptions> 
</ADPlus> 
Paul Kearney - pk
I'm tried this variant.ADPlus v7.0 doesn't understand cmd tag." Errors reading configuration file: c:\work\adplus.cfg Invalid tag in the precommands section of a configuration string: cmd"But I found workaround. I use DebugDiag software which is doing the same job.
Stoune
A: 

According to this documentation for ADPlus: exception code should be hex value of error code. For instance, if you want to capture AV - you need 0xC0000005

Here is the link about capturing error dumps for CLR

Vadmyst
These links refered to old ADPlus.vbs, which is broken on Windows 7. ADPlus v7.0 change config syntax.I use DebugDiag as workaround.
Stoune