Crash on snaphot: mscorwks.dll?

Memory profiling for .NET developers

Moderators: Luke Jefferson, StephenC, AndrewH, melvyn.harbour, james.billings, Laura Morley, dene.boulton

Crash on snaphot: mscorwks.dll?

Postby mrweaver » Mon Feb 21, 2011 10:39 pm

Hi. My .NET 3.5 app crashes when I attempt to take a memory snapshot. This apppears to be coming from mscorwks.dll

At the moment I have no idea how to diagnose the problem since the app works fine outside of the profiler, although we suspect a badly behaved destructor firing on GC when the snapshot is being harvested.

We have references to unmanaged code inside the app which might be an issue. The front end is WPF, but I believe one of my colleagues has seen this further down the stack so I do not think this is the issue.

So that you can help me provide you with pertinent information, here is the exact sequence:

Start profiling, app starts correctly. Click "take snapshot", the profiler UI changes to "taking snapshot" but then I get the standard "MyApp.exe has encountered a problem and needs to close" dialog.

If I click "what does this report contain" I get the following info:

AppName: MyApp.exe AppVer: AppStamp:4d62829e
ModName: mscorwks.dll ModVer: 2.0.50727.3603 ModStamp:4a7cd88e
fDebug: 0 Offset: 0000e2f0

If I click debug I get a second "MyApp.exe has encountered a problem and needs to close" dialog (wtf?) and clicking debug again and selecting "new instance of VS2010" I get a dialog with:

Unhandled exception at 0x79e7e2f0 in MyApp.exe: 0xC0000005: Access violation reading location 0x423bccbd.

Clicking "break" I appear to be in malloc.c with the following source (next instruction pointer at the last line):

80: void * __cdecl _malloc_base (size_t size)
81: {
78AB0233 mov edi,edi
78AB0235 push ebp
78AB0236 mov ebp,esp
78AB0238 push ebx
82: void *res = NULL;
84: // validate size
85: if (size <= _HEAP_MAXREQ) {
78AB0239 mov ebx,dword ptr [ebp+8]
78AB023C cmp ebx,0FFFFFFE0h
78AB023F ja malloc+7Dh (78ADF277h)
78AB0245 push esi
78AB0246 push edi
86: for (;;) {
88: // allocate memory block
89: res = _heap_alloc(size);
78AB0247 cmp dword ptr [__crtheap (78B538B0h)],0
78AB024E je malloc+19h (78ADF22Fh)
78AB0254 test ebx,ebx
78AB0256 je malloc+39h (78AB02BCh)
78AB0258 mov eax,ebx
78AB025A push eax
78AB025B push 0
78AB025D push dword ptr [__crtheap (78B538B0h)]
78AB0263 call dword ptr [__imp__HeapAlloc@12 (78AA11F8h)]
78AB0269 mov edi,eax

The call stack is as follows:

[Frames below may be incorrect and/or missing, no symbols loaded for mscorwks.dll]
>msvcr100.dll!malloc(unsigned int size=255) Line 89 + 0x3b bytes C

Note that attaching a debugger to the profiler-launched process (with all exceptions set to "thrown") doesn't help at all. Please let me know what else I can do to help get to the cause of this issue.

Many thanks

Posts: 1
Joined: Mon Feb 21, 2011 9:56 pm

Postby Brian Donahue » Wed Feb 23, 2011 6:26 pm


I have contacted you directly with instructions on sending us a memory dump so we can figure out how Memory Profiler made the application crash.
Brian Donahue
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Same problem encountered

Postby lidiya » Wed Mar 09, 2011 1:09 am

I have exactly the same problem. I'm running on Windows 7 and trying to profile an application with WPF and C# in the backend.
Posts: 1
Joined: Wed Mar 09, 2011 1:03 am

Return to ANTS Memory Profiler 7

Who is online

Users browsing this forum: No registered users and 0 guests