1

尽管使用了 try/catch,但我遇到了无法解释的 C# 托管代码崩溃。真的很感激有人可以帮助解释发生了什么!

崩溃异常代码为:FAIL_FAST_SET_CONTEXT_DENIED_c0000409,子代码为0x30 FAST_FAIL_SET_CONTEXT_DENIED。

(memory.hdmp 中 0x00007FF8BFA45886 (ntdll.dll) 处的未处理异常:未知 __fastfail() 状态代码:0x0000000000000030。)

堆栈中顶部调用的反汇编似乎表明从 ntdll!RcContinueExit 抛出“INT 29h”,因为 ntdll!NtContinue 返回错误代码 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 

这是崩溃的托管线程的调用堆栈

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() 

这是崩溃线程所做的简化代码:

   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;
        }
    }
4

0 回答 0