3

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;
        }
    }
ymike
  • 31
  • 1
  • 1
    Obviously this shouldn't be happening, the code is fine, i would consider repairing your operating system. checking your virus checker. Removing any filter drivers etc, like port monitors fiddler etc etc etc, trying it in safe mode with network – TheGeneral Oct 31 '21 at 23:12
  • I may be missing something, however it appears to me you have an endless loop calling `CheckInternet()` in the … `while(retry < 3)` … loop ... `retry` is never incremented and therefore will always be 0. – JohnG Oct 31 '21 at 23:15
  • You are right that above code is endless loop, because I removed "++" was trying to use endless loop to reproduce the issue in house. The crash dump was collected from customer machine, we are not able to reproduce the issue in house. It is not related the crash and will not cause crash anyways. – ymike Oct 31 '21 at 23:26
  • OS repair is my thought as well. Try `dism /cleanup-image /restorehealth`, remove any apps with weird drivers such as Wireshark and Npcap. Update all device drivers. A memory diagnostic check and `chkdsk /f` wouldn't go amiss either – Charlieface Nov 01 '21 at 00:11
  • Being a `Component` the `Ping` class is `IDisposable`. Have you tried `using` it so that it cleans up after itself? – AlwaysLearning Nov 01 '21 at 00:36
  • Did you managed to find any solution to this? I experienced same issue. – iz25 Jul 13 '22 at 14:26

0 Answers0