2

After our app pool recycles our WCF services throw FileLoadException on access. Recycling of app pool helps. Sometimes the error goes away without recycling. I asked the question I asked first question about it here: FileLoadException when accessing WCF service

As we have no other ideas how to analyze this problem we would like to get memory dump with that Exception in it.

But I don't know how to configure adplus or debugdiag to attach automatically to that new process (after recycling) and generate crash dump on specific exception. Is that even possible?

Community
  • 1
  • 1
Piotr Perak
  • 10,718
  • 9
  • 49
  • 86
  • Independent on how the dump is created, don't forget to copy all SOS.dll and mscordacwks.dll from the system in order to be able to analyze the dump. – Thomas Weller Feb 07 '14 at 13:14

2 Answers2

3

You can use Procdump to make the full memory dump on the first chance exception:

procdump -ma -e 1 -f FileLoadException w3wp.exe

But unfortunately you will probably have to attach it manually as I do not know any out-of-the-box solution. We are sometimes using PowerShell scripts for such tasks.

Konrad Kokosa
  • 16,563
  • 2
  • 36
  • 58
2

Use WinDbg, attach it and add an event filter via the menu 'Debug>Event Filters...' Click 'Add..' and the error code should be 0x80131621 according to the MSDN page but it could be different which could be a problem and then enter gc. Otherwise I expect WinDbg to break when the exception occurs and you can then do a dump:

.dump /ma c:\dumps\mycrash.dmp

You may have looked at the following pages regarding how to debug this issue: http://blogs.msdn.com/b/suzcook/archive/2003/05/29/57120.aspx and http://bradwilson.typepad.com/blog/2007/12/we-were-crashin.html, related SO post

Community
  • 1
  • 1
EdChum
  • 376,765
  • 198
  • 813
  • 562
  • but attach to what? I need to get dump of new process that is created after app pool recycle. – Piotr Perak Feb 07 '14 at 11:40
  • Attach to the host service and you need to enable debugging of child processes using `.childdbg 1` there is a related [SO post](http://stackoverflow.com/questions/5340336/windbg-automatically-continue-when-child-process-created-and-childdbg-1-enabl) – EdChum Feb 07 '14 at 11:42
  • @Peri I haven't tried with .net though so not sure if this will 100% work a [2005 post](http://blogs.msdn.com/b/jmstall/archive/2005/08/16/debug-child-process.aspx) said this was not possible but it may be different in 2014 – EdChum Feb 07 '14 at 11:45