an ASP.NET app (.NET Framework 4.7.2) I'm maintaining keeps crashing & stops frequently (viz. Rapid-Fail Protection kicking in after simultaneous errors), but I don't know why.
Windows Event Log shows some entries on each crash, basically about thread being aborted in w3wp.exe and kernel exception. No other details or stacktrace are available, probably it being an unmanaged exception.
So I took dumps of a few crashing w3wp processes at different times, and ran WinDbg over them.
!analyze -v
shows, mainly:
*** Unhandled exception: E0434352.CLR
CONTEXT: (.ecxr)
rax=000000434217f0d0 rbx=0000000000000001 rcx=000000434217f2d0
rdx=000001be91459200 rsi=000000434217f678 rdi=0000000000000005
rip=00007ffe487a4078 rsp=000000434217f500 rbp=000000434217fc00
r8=0000000000000000 r9=000000434217f2d0 r10=0000000000000000
r11=0000000000000000 r12=0000000000004000 r13=0000000000000000
r14=00000000e0434352 r15=0000000000000000
iopl=0 nv up ei pl nz na pe nc
cs=0033 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000200
KERNELBASE!RaiseException+0x68:
00007ffe`487a4078 488b8c24c0000000 mov rcx,qword ptr [rsp+0C0h] ss:00000043`4217f5c0=000058417d0651a6
Resetting default scope
FAULTING_IP:
KERNELBASE!RaiseException+68
00007ffe`487a4078 488b8c24c0000000 mov rcx,qword ptr [rsp+0C0h]
EXCEPTION_RECORD: (.exr -1)
ExceptionAddress: 00007ffe487a4078 (KERNELBASE!RaiseException+0x0000000000000068)
ExceptionCode: e0434352 (CLR exception)
ExceptionFlags: 00000001
NumberParameters: 5
Parameter[0]: ffffffff80131530
Parameter[1]: 0000000000000000
Parameter[2]: 0000000000000000
Parameter[3]: 0000000000000000
Parameter[4]: 00007ffe427f0000
EXCEPTION_CODE: (HRESULT) 0x80131530 (2148734256) - <Unable to get error code text>
PROBLEM_CLASSES:
ID: [0n254]
Type: [CLR_EXCEPTION]
Class: Primary
Scope: DEFAULT_BUCKET_ID (Failure Bucket ID prefix)
BUCKET_ID
Name: Add
Data: Omit
PID: [Unspecified]
TID: [0x1050]
Frame: [0] : KERNELBASE!RaiseException
ID: [0n252]
Type: [@ManagedObjectName]
Class: Addendum
Scope: DEFAULT_BUCKET_ID (Failure Bucket ID prefix)
BUCKET_ID
Name: Omit
Data: Add
String: [System.Threading.ThreadAbortException]
PID: [0x15b0]
TID: [Unspecified]
Frame: [0]
!CLRStack -a
shows:
OS Thread Id: 0x1050 (47)
Child SP IP Call Site
000000434217f738 00007ffe487a4078 [GCFrame: 000000434217f738]
000000434217f8f0 00007ffe487a4078 [GCFrame: 000000434217f8f0]
> !U /d 00007ffe487a4078
Unmanaged code
00007ffe`487a4078 488b8c24c0000000 mov rcx,qword ptr [rsp+0C0h]
00007ffe`487a4080 4833cc xor rcx,rsp
00007ffe`487a4083 e898560400 call KERNELBASE!_security_check_cookie (00007ffe`487e9720)
00007ffe`487a4088 4881c4d8000000 add rsp,0D8h
00007ffe`487a408f c3 ret
00007ffe`487a4090 8364243800 and dword ptr [rsp+38h],0
00007ffe`487a4095 ebd6 jmp KERNELBASE!RaiseException+0x5d (00007ffe`487a406d)
00007ffe`487a4097 cc int 3
00007ffe`487a4098 cc int 3
00007ffe`487a4099 cc int 3
!pe
just shows a ThreadAbortException
:
Exception object: 000001c000f7aba8
Exception type: System.Threading.ThreadAbortException
Message: Thread was being aborted.
InnerException: <none>
StackTrace (generated):
<none>
StackTraceString: <none>
HResult: 80131530
!threads
also shows a ThreadAbortException
(see #47):
ThreadCount: 98
UnstartedThread: 0
BackgroundThread: 50
PendingThread: 0
DeadThread: 48
Hosted Runtime: no
Lock
ID OSID ThreadOBJ State GC Mode GC Alloc Context Domain Count Apt Exception
:
000001C000F7ACD0:000001C000F7B3F0 000001be806342a0 0 MTA (Threadpool Worker) System.Threading.ThreadAbortException 000001c000f7aba8
:
!dumpstack
shows:
OS Thread Id: 0x1050 (47)
Current frame: KERNELBASE!RaiseException+0x68
Child-SP RetAddr Caller, Callee
000000434217f528 00007ffe487a4078 KERNELBASE!RaiseException+0x68, calling ntdll!RtlRaiseException
000000434217f5a0 00007ffe42845209 clr!GCPreempNoDtor::Enter+0x15, calling clr!GetThread
000000434217f5d0 00007ffe428451ea clr!RaiseTheExceptionInternalOnly+0x2aa, calling kernel32!RaiseExceptionStub
000000434217f6d0 00007ffe429bffbb clr!RaiseTheException+0xa4, calling clr!RaiseTheExceptionInternalOnly
000000434217f6f0 00007ffe427fa7a8 clr!Thread::ReturnToContext+0x1b0, calling clr!GCCoop::~GCCoop
000000434217f700 00007ffe429c0014 clr!RealCOMPlusThrow+0x69, calling clr!RaiseTheException
000000434217f770 00007ffe42c02e9e clr!Thread::RaiseCrossContextException+0x333, calling clr!RealCOMPlusThrow
000000434217f850 00007ffde37d0553 (MethodDesc 00007ffde36cc298 +0x13 System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr, IntPtr, IntPtr, Int32)), calling (MethodDesc 00007ffde36cc2a8 +0 System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr, IntPtr, IntPtr, Int32))
000000434217f880 00007ffe427fa33a clr!Thread::SafeSetLastThrownObject+0x5a, calling clr!CLRException::HandlerState::CleanupTry
000000434217f920 00007ffe427fa568 clr!Thread::EnterContextRestricted+0x197, calling clr!ClrFlsIncrementValue
000000434217f940 00007ffe42848a2a clr!UM2MThunk_Wrapper+0x60, calling clr!UM2MThunk_WrapperHelper
000000434217f950 00007ffe427f5c75 clr!REGUTIL::RegCacheValueNameSeenPerhaps+0x29, calling clr!HashiStringKnownLower80
000000434217f990 00007ffe42c00619 clr!Thread::DoADCallBack+0x1ad, calling clr!Thread::RaiseCrossContextException
000000434217f9b0 00007ffe427f67a7 clr!EEConfig::GetConfiguration_DontUse_+0x7f3, calling clr!HashString
000000434217fab0 00007ffe3ac694c2 iiscore!W3_CONTEXT::GetServerVarChanges+0xa2, calling iiscore!_security_check_cookie
000000434217fac0 00007ffe427f53a1 clr!Frame::Pop+0xe, calling clr!GetThread
000000434217fb50 00007ffe42848ad5 clr!UM2MDoADCallBack+0xb3, calling clr!Thread::DoADCallBack
000000434217fb80 00007ffe3aac1d38 webengine4!W3_MGD_HANDLER::UpdateUser+0x38
000000434217fbd0 00007ffe427f23fd clr!UMThunkStub+0x26d, calling clr!UM2MDoADCallBack
000000434217fc60 00007ffe3aac183f webengine4!W3_MGD_HANDLER::ProcessNotification+0x8e
000000434217fc90 00007ffe3aac1792 webengine4!ProcessNotificationCallback+0x42, calling webengine4!W3_MGD_HANDLER::ProcessNotification
000000434217fcc0 00007ffe427f975f clr!UnManagedPerAppDomainTPCount::DispatchWorkItem+0x1bc
000000434217fcf0 00007ffe427f82d7 clr!CLRSemaphore::Release+0x2f, calling kernel32!ReleaseSemaphore
000000434217fd60 00007ffe427f835c clr!ThreadpoolMgr::ExecuteWorkRequest+0x64
000000434217fd90 00007ffe427f8105 clr!ThreadpoolMgr::WorkerThreadStart+0xf5, calling clr!ThreadpoolMgr::ExecuteWorkRequest
000000434217fe30 00007ffe429aefef clr!Thread::intermediateThreadProc+0x86
000000434217fe70 00007ffe4a1684d4 kernel32!BaseThreadInitThunk+0x14, calling ntdll!LdrpDispatchUserCallTarget
000000434217fea0 00007ffe4b40e851 ntdll!RtlUserThreadStart+0x21, calling ntdll!LdrpDispatchUserCallTarget
How can I dig deeper to find the root cause of this ThreadAbortException
, and why it would crash w3wp?
Please suggest and guide. Thank you!
[Update] I found this on a Microsoft Support webpage from 2013:
Unhandled exceptions cause ASP.NET-based applications to quit unexpectedly in the .NET Framework: unhandled exceptions outside the context of a request, such as exceptions on a timer thread or in a callback function, cause the worker process to end.
Is this true for .NET Framework 4.7.2 as well, and could this be a reason for worker processes (w3wp) to crash?
User contributions licensed under CC BY-SA 3.0