System.UnauthorizedAccessException在mscorwks.dll导致应用程序池崩溃 [英] System.UnauthorizedAccessException in mscorwks.dll causing app pool crashes
问题描述
入门点总是mscorwks!CreateApplicationContext + bbef和结果总是一个System.UnauthorizedAccessException。
堆栈跟踪:
函数Arg 1 Arg 2 Arg 3
/ pre>
kernel32!RaiseException + 3c e0434f4d 00000001 00000001
mscorwks!GetMetaDataInternalInterface + 84a9 18316b3c 00000000 00000000
mscorwks!GetAddrOfContractShutoffFlag + ac01 18316b3c 00000000 023cfbd8
mscorwks!GetAddrOfContractShutoffFlag + ac73 00000000 000e8c88 8038b2d0
mscorwks!GetAddrOfContractShutoffFlag + aca4 18316b3c 00000000 023cfbe4
mscorwks!GetAddrOfContractShutoffFlag + acb2 18316b3c acc05c33 7a399bf0
mscorwks!CoUninitializeCor + 67be 00000000 023c fc1c 023cfc8c
mscorwks!CoUninitializeCor + 87a1 001056e8 79fd87f6 023cfeb0
mscorwks!CorExitProcess + 4ad3 023cfeb0 023cfd20 79f40574
mscorwks!CorExitProcess + 4abf 001056e8 79f405a6 023cfd04
mscorwks!CorExitProcess + 4b3e 000e8c88 00000000 023cfda7
mscorwks!StrongNameErrorInfo + 1ddab 00000000 00000000 023cfeb0
mscorwks!StrongNameErrorInfo + 1e07c 023cfeb0 00000000 00000000
mscorwks!CoUninitializeEE + 4e0b 023cfeb0 023cfe5c 79f7762b
mscorwks!CoUninitializeEE + 4da7 023cfeb0 acc05973 00000000
mscorwks!CoUninitializeEE + 4ccd 023cfeb0 00000000 001056e8
mscorwks!GetPrivateContextsPerfCounters + f1cd 79fc24f9 00000008 023cff14
mscorwks!GetPrivateContextsPerfCounters + f1de 79fc24f9 acc 058c3 00000000
mscorwks!CorExeMain + 1374 00000000 00000003 00000002
mscorwks!CreateApplicationContext + bc35 000e9458 00000000 00000000
kernel32!GetModuleHandleA + df 79f9205f 000e9458 00000000
有人知道这是什么意思,如何解决?
编辑: / strong>上面的堆栈跟踪证明是一个症状,而不是原因。上述堆栈跟踪仅显示非托管堆栈,但问题发生在托管代码中。我使用下面我的答案中的步骤挖掘崩溃转储并提取托管异常。
解决方案对mscorwks的引用。 dll只是问题的症状。 mscorwks.dll是包含通用语言运行时的dll。
为了诊断问题的根本原因,我按照以下步骤进行:
- 使用 DebugDiag 在IIS回收应用程序池时捕获崩溃转储。
- 在 windbg 。
- 在windbg命令行输入.loadby sos mscorwks(无引号)以加载CLR调试工具
- 使用! PrintException命令打印出在崩溃转储中记录的最后一个异常。这很可能是引起IIS应用程序池循环的那个
- 使用!clrstack命令查看当前线程上抛出异常的堆栈。
- 可以找到更多的windbg命令参考 here 和 here 。最后,这个MSDN博客有关于使用windbg的很好的教程。
祝你好运,你的调试冒险!
My app pools keep randomly crashing in IIS 6.0 MS Debug Diag points to kernel32.dll every time.
The entry point is always mscorwks!CreateApplicationContext+bbef and the result is always a System.UnauthorizedAccessException.
Stack Trace:
Function Arg 1 Arg 2 Arg 3 kernel32!RaiseException+3c e0434f4d 00000001 00000001 mscorwks!GetMetaDataInternalInterface+84a9 18316b3c 00000000 00000000 mscorwks!GetAddrOfContractShutoffFlag+ac01 18316b3c 00000000 023cfbd8 mscorwks!GetAddrOfContractShutoffFlag+ac73 00000000 000e8c88 8038b2d0 mscorwks!GetAddrOfContractShutoffFlag+aca4 18316b3c 00000000 023cfbe4 mscorwks!GetAddrOfContractShutoffFlag+acb2 18316b3c acc05c33 7a399bf0 mscorwks!CoUninitializeCor+67be 00000000 023cfc1c 023cfc8c mscorwks!CoUninitializeCor+87a1 001056e8 79fd87f6 023cfeb0 mscorwks!CorExitProcess+4ad3 023cfeb0 023cfd20 79f40574 mscorwks!CorExitProcess+4abf 001056e8 79f405a6 023cfd04 mscorwks!CorExitProcess+4b3e 000e8c88 00000000 023cfda7 mscorwks!StrongNameErrorInfo+1ddab 00000000 00000000 023cfeb0 mscorwks!StrongNameErrorInfo+1e07c 023cfeb0 00000000 00000000 mscorwks!CoUninitializeEE+4e0b 023cfeb0 023cfe5c 79f7762b mscorwks!CoUninitializeEE+4da7 023cfeb0 acc05973 00000000 mscorwks!CoUninitializeEE+4ccd 023cfeb0 00000000 001056e8 mscorwks!GetPrivateContextsPerfCounters+f1cd 79fc24f9 00000008 023cff14 mscorwks!GetPrivateContextsPerfCounters+f1de 79fc24f9 acc058c3 00000000 mscorwks!CorExeMain+1374 00000000 00000003 00000002 mscorwks!CreateApplicationContext+bc35 000e9458 00000000 00000000 kernel32!GetModuleHandleA+df 79f9205f 000e9458 00000000
Does anybody know what this means and how to fix it?
Edit: The above stack trace turned out to be a symptom and not the cause. The above stack trace only shows the unmanaged stack but the problem happened in managed code. I used the steps in my answer below to dig into the crash dump and extract the managed exception.
解决方案The reference to mscorwks.dll was only a symptom of the problem. mscorwks.dll is the dll that contains the common language runtime.
To diagnose the root cause of the problem, I followed the following steps:
- Use DebugDiag to capture a crash dump when IIS recycled the app pool.
- Open the crash dump in windbg.
- Type ".loadby sos mscorwks" (no quotes) at the windbg command line to load the CLR debug tools
- Use the !PrintException command to print out the last exception recorded in the crash dump. This is most likely the one that caused the IIS app pool recycle
- Use the !clrstack command to view the stack on the current thread that threw the exception
- More command references for windbg can be found here and here. Lastly, this MSDN blog has great tutorials on using windbg.
Good luck on your debuging adventure!
这篇关于System.UnauthorizedAccessException在mscorwks.dll导致应用程序池崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!