I have an unexplained C# managed code crash, despite using try/catch. Really Appreciate if someone could help explain what happened!
The crash exception code is: FAIL_FAST_SET_CONTEXT_DENIED_c0000409, the subcode is 0x30 FAST_FAIL_SET_CONTEXT_DENIED.
(Unhandled exception at 0x00007FF8BFA45886 (ntdll.dll) in memory.hdmp: Unknown __fastfail() status code: 0x0000000000000030.)
The disassembly of top call in stack seems suggests "INT 29h" was thrown from ntdll!RcContinueExit because ntdll!NtContinue returns error code 0xC000060A:
00007FF8BFA45871 je RcContinueExit+20h (07FF8BFA45893h)
00007FF8BFA45873 xor edx,edx
00007FF8BFA45875 call NtContinue (07FF8BFA41A40h)
00007FF8BFA4587A cmp eax,0C000060Ah
00007FF8BFA4587F jne RcContinueExit+15h (07FF8BFA45888h)
00007FF8BFA45881 mov ecx,30h <-- subcode 0x30
00007FF8BFA45886 int 29h <--- INT 29h
Here is the call stack of the crashing managed thread
ntdll.dll!RcContinueExit()
clr.dll!ProcessCLRException()
ntdll.dll!RtlpExecuteHandlerForUnwind()
ntdll.dll!RtlUnwindEx()
clr.dll!ClrUnwindEx(struct _EXCEPTION_RECORD *,unsigned __int64,unsigned __int64,unsigned __int64)
clr.dll!ProcessCLRException()
ntdll.dll!RtlpExecuteHandlerForException()
ntdll.dll!RtlDispatchException()
ntdll.dll!RtlRaiseException()
KERNELBASE.dll!RaiseException()
clr.dll!RaiseTheExceptionInternalOnly()
clr.dll!IL_Throw()
System.ni.dll!00007ff85cfae2fe()
clr.dll!ExceptionTracker::CallHandler()
clr.dll!ExceptionTracker::CallCatchHandler()
clr.dll!ProcessCLRException()
ntdll.dll!RtlpExecuteHandlerForUnwind()
ntdll.dll!RtlUnwindEx()
clr.dll!ClrUnwindEx(struct _EXCEPTION_RECORD *,unsigned __int64,unsigned __int64,unsigned __int64)
clr.dll!ProcessCLRException()
ntdll.dll!RtlpExecuteHandlerForException()
ntdll.dll!RtlDispatchException()
ntdll.dll!RtlRaiseException()
KERNELBASE.dll!RaiseException()
clr.dll!RaiseTheExceptionInternalOnly()
clr.dll!IL_Throw()
System.ni.dll!00007ff85d1dd6c2()
System.ni.dll!00007ff85ca42f61()
System.ni.dll!00007ff85cf0aabb()
System.ni.dll!00007ff85cfae225()
System.ni.dll!00007ff85cfae102()
00007ff8481ef49a()
00007ff8481eebba()
00007ff8481cbc9b()
00007ff8481caf8a()
mscorlib.ni.dll!00007ff86072df12()
mscorlib.ni.dll!00007ff86072dd95()
mscorlib.ni.dll!00007ff86079d00f()
mscorlib.ni.dll!00007ff8607a2523()
mscorlib.ni.dll!00007ff860706f40()
mscorlib.ni.dll!00007ff8607a1505()
mscorlib.ni.dll!00007ff86079bb14()
mscorlib.ni.dll!00007ff86079bb54()
00007ff8481ed669()
mscorlib.ni.dll!00007ff86072df12()
mscorlib.ni.dll!00007ff86072dd95()
mscorlib.ni.dll!00007ff86079d00f()
mscorlib.ni.dll!00007ff8607a2523()
mscorlib.ni.dll!00007ff860706f40()
mscorlib.ni.dll!00007ff8607a1505()
mscorlib.ni.dll!00007ff8607a1483()
mscorlib.ni.dll!00007ff8607a128f()
mscorlib.ni.dll!00007ff8607a1221()
mscorlib.ni.dll!00007ff8607a10dc()
mscorlib.ni.dll!00007ff860706f87()
mscorlib.ni.dll!00007ff86079a414()
mscorlib.ni.dll!00007ff86079b207()
mscorlib.ni.dll!00007ff86079a8c1()
mscorlib.ni.dll!00007ff8606f8e46()
clr.dll!CallDescrWorkerInternal()
clr.dll!CallDescrWorkerWithHandler()
clr.dll!MethodDescCallSite::CallTargetWorker()
clr.dll!QueueUserWorkItemManagedCallback(void *)
clr.dll!ManagedThreadBase_DispatchInner()
clr.dll!ManagedThreadBase_DispatchMiddle()
clr.dll!ManagedThreadBase_DispatchOuter()
clr.dll!ManagedThreadBase_FullTransitionWithAD()
clr.dll!ManagedPerAppDomainTPCount::DispatchWorkItem()
clr.dll!ThreadpoolMgr::ExecuteWorkRequest()
clr.dll!ThreadpoolMgr::WorkerThreadStart()
clr.dll!Thread::intermediateThreadProc(void *)
kernel32.dll!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()
Here is the simplified code of what the crash thread does:
class Program
{
static void Main(string[] args)
{
var retry = 0;
while(retry < 3)
{
var ret = CheckInternet();
}
}
static public bool CheckInternet()
{
Ping p = new Ping();
try
{
PingReply reply = p.Send("a well known host", 3000);
if (reply.Status == IPStatus.Success)
{
return true;
}
else
{
return false;
}
}
catch (Exception)
{
}
finally
{
}
return false;
}
}