我在 IIS 7 上的 ASP.NET MVC 3 应用程序有错误的行为。我们在代码中有堆栈溢出情况,它导致一般应用程序池崩溃而没有正确的 System.StackOveflowException throwing。因此,在开始执行有问题的函数w3wp.exe 后出现本机代码异常。
这是 HtmlHelper 扩展的代码(现已修复):
public static string Avatar( this UrlHelper helper, string fileName)
{
return helper.UserAvatar(fileName);
}
public static string UserAvatar( this UrlHelper helper, string fileName)
{
if (string.IsNullOrEmpty(fileName))
return EmptyPhotoImage(helper);
var photoPath = System.Web.Hosting.HostingEnvironment.MapPath(string.Format("~/Content/avatars/{0}", fileName));
if (!File.Exists(photoPath))
return EmptyPhotoImage(helper);
return Avatar(helper, fileName);
}
这是事件日志记录:
Faulting application name: w3wp.exe, version: 7.5.7601.17514, time stamp: 0x4ce7afa2
Faulting module name: ntdll.dll, version: 6.1.7601.17725, time stamp: 0x4ec4aa8e
Exception code: 0xc00000fd
Fault offset: 0x0000000000055d7f
Faulting process id: 0x1a6c
Faulting application start time: 0x01ce6c67c7179807
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
Report Id: 0dd50093-d85b-11e2-9ee7-50e549e13906
另一个:
Fault bucket , type 0
Event Name: APPCRASH
Response: Not available
Cab Id: 0
Problem signature:
P1: w3wp.exe
P2: 7.5.7601.17514
P3: 4ce7afa2
P4: ntdll.dll
P5: 6.1.7601.17725
P6: 4ec4aa8e
P7: c00000fd
P8: 0000000000055d7f
P9:
P10:
我的问题:为什么在没有 StackOverflowException 的情况下会导致池崩溃?