Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to I resolve GetFrameContext failed in Windbg

I'm debugging a .NET 4.0 web application using a full crash dump and Windbg. I seem able to get all the versions of everything to match up however when I try to get the managed stack trace of all the thread I get

OS Thread Id: 0x7cd4 (13) Child SP IP Call Site GetFrameContext failed: 1

For all of my managed threads. Any ideas what I'm doing wrong and how I can fix it?

like image 597
Mark Avatar asked Oct 24 '11 15:10

Mark


2 Answers

I was also getting this error, but I noticed that running !DumpStack does give me a trace when !ClrStack does not.

According to this link it could just be a thread that has been scheduled but is not running. In other words not necessarily a problem. I'm not sure why the clrstack command doesn't work though, possibly an sos bug?

0:037> !clrstack
OS Thread Id: 0x57cc (37)
Child SP         IP               Call Site
GetFrameContext failed: 1
0:037> !dumpstack
OS Thread Id: 0x57cc (37)
Child-SP         RetAddr          Call Site
000000000772f688 000007fefdb210dc ntdll!NtWaitForSingleObject+0xa
000000000772f690 000007fef5ca36ca KERNELBASE!WaitForSingleObjectEx+0x79
000000000772f730 000007fef5ca3a97 clr!CLRSemaphore::Wait+0xaa
000000000772f7f0 000007fef5ca3c20 clr!ThreadpoolMgr::UnfairSemaphore::Wait+0x140
000000000772f830 000007fef5cb21ff clr!ThreadpoolMgr::NewWorkerThreadStart+0x2a7
000000000772f8d0 000007fef5cb0582 clr!ThreadpoolMgr::WorkerThreadStart+0x3b
000000000772f970 00000000778d652d clr!Thread::intermediateThreadProc+0x7d
000000000772fb30 0000000077b0c521 kernel32!BaseThreadInitThunk+0xd
000000000772fb60 0000000000000000 ntdll!RtlUserThreadStart+0x1d
like image 187
Avner Avatar answered Oct 11 '22 03:10

Avner


How are you trying to display the managed stack? You should be using sos or sosex (preferably sosex). Does !sosex.mk work for you?

Download sosex from here.

If you are using windbg to debug .net, you want sosex to do it.

like image 34
JasonE Avatar answered Oct 11 '22 01:10

JasonE