Empty StackTrace. Possible?

Are there any possible scenarios where the stack trace may be completely empty? I was sent the text of the event log, copied from the machine event Event Properties, which states the following:

Description : An unhandled exception occurred and the process was aborted.

Application ID : DefaultDomain

Process ID : 123

Exception : System.OutOfMemoryException

Message : An exception of type 'System.OutOfMemoryException' was thrown.

Stacktrace :

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp .

The stack trace looks suspicious to me. I searched a lot on forums and in docs - there was nothing about Stack Trace being empty. Only MSDN mentions: "The StackTrace property may not report as many method calls as expected due to code transformations, such as inlining, that occur during optimization." but nothing about the lack of messages about a method call at all.

I need to be sure before I contact him for confirmation, because this is a multi-level communication and it will take time for an answer.

Any corrections to my suspects that the stack trace cannot be empty?

+4
source share
2 answers

Sometimes the call itself can be the cause of OOM (too many in the call stack).

So ... you see the problem.

Or a bunch can be exhausted or ... or, see @Oded comment!

+2
source

To create a message in the event log, you need to get the string property Exception.StackTrace . Computing the value for this property involves creating a new StackTrace object. If the application has lost memory, this may not be possible because allocation is not performed. This may explain why there is no stack trace.

When an application runs out of memory, even error handling, such as logging, may fail due to a lack of resources. In your case, you at least know that it was a memory issue that caused the crash.

+2
source

Source: https://habr.com/ru/post/1411721/


All Articles