0

I am seeking some advice on how to instrument for stack overflow and other critical errors in ASP.NET azure.

I recently introduced a "minor" defect with a function that looks like this:

public void foo()
{ 
    return foo();
}

What was surprising was there was no way to catch this error in the Azure environment. Its running as a "WebApp" (asp.net), and I have global error handlers, and the call was wrapped in an try/catch block. All logging turned on in Azure. Nothing in Azure web or app log stream - basically just getting a 503.

Note: this is NOT a duplicate of a seven year old question. This is specific to latest (4.6+) .NET Framework running in an azure environment.

kevinc
  • 605
  • 5
  • 14
  • 1
    Catching an SO is always a bit different than other errors and most possibly cannot be caught, check out http://stackoverflow.com/questions/1599219/c-sharp-catch-a-stack-overflow-exception – Ray May 13 '17 at 15:57
  • Is it causing a crash? It is possible that this code could be optimized to tail call recursion which would cause an infinite loop and not a stack overflow. – Mike May 13 '17 at 19:50
  • This is not a duplicate of a seven year old question.. frameworks have changed, hosting environment is totally different. – kevinc May 14 '17 at 16:41
  • @Mike I believe so, specifically getting a 503 and recycling. Stack overflow locally as well. Outside chance Azure is recycling because of infinite loop, but brings us back to original question - where's the logs? – kevinc May 30 '17 at 09:34

0 Answers0