【问题标题】:Application crashing due to stackoverflow由于 stackoverflow 导致应用程序崩溃
【发布时间】:2012-01-19 22:49:02
【问题描述】:

这个错误让我很伤心。我无法在 Application_OnError 捕获此错误。我能得到的唯一消息是事件查看器日志。

Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to stack overflow.



Faulting application w3wp.exe, version 7.0.6001.18000, time stamp 0x47919413, faulting module nlssorting.dll, version 4.0.30319.235, time stamp 0x4da3fc88, exception code 0xc00000fd, fault offset 0x000020d4, process id 0x%9, application start time 0x%10.

我有一个非常大的应用程序,并且由于上述错误,我无法判断 stackoverflow 的确切原因在哪里。你能帮我解决这个问题吗?

【问题讨论】:

  • 应用程序的哪个位置出现此错误?
  • 为什么你说你不能在 Application_OnError 捕获这个错误?
  • 我在 Application_OnError 中记录错误,但 HttpContext.Current.Server.GetLastError() 中没有任何内容
  • StackOverflowExceptions 被 CLR 特殊处理,所以如果它没有被 Application_OnError 捕获,我不会感到惊讶。如果不了解有关您的应用程序的更多信息,则无法帮助您确定原因。也许是递归方法?
  • @BizApps 那是我无法追踪的。我刚刚在事件查看器中记录了消息(我在问题中写了)。

标签: c# asp.net debugging iis iis-7


【解决方案1】:

您可能会在 Application_End 中获得更多帮助。从这里,您可以使用类似这样的方法来捕获关闭堆栈...

HttpRuntime runtime = (HttpRuntime)typeof(System.Web.HttpRuntime).InvokeMember("_theRuntime", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.GetField, null, null, null);

(string)runtime.GetType().InvokeMember("_shutDownStack", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetField, null, runtime, null);

(string)runtime.GetType().InvokeMember("_shutDownMessage", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetField, null, runtime, null);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-17
    • 2016-08-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多