Reputation: 2656
Are there any possible scenarios where the Stack Trace can be completely empty? I was passed an Event Log text copied from machine Event Properties, which says the following:
Description: An unhandled exception occurred and the process was terminated.
Application ID: DefaultDomain
Process ID: 123
Exception: System.OutOfMemoryException
Message: 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 documentations - there is nothing about Stack Trace being empty. Only MSDN mentions "The StackTrace property may not report as many method calls as expected because of code transformations, such as inlining, that occur during optimization." but nothing about no method call reports at all.
I need to be sure before I contact back for confirmation, because this is a multilayer communication and is going to take time for the reponse..
Any corrections to my suspects that the Stack Trace cannot be empty?
Upvotes: 4
Views: 2764
Reputation: 106806
To create the message in the event log the string property Exception.StackTrace
has to be retrieved. Computing the value for this property involves creating a new StackTrace
object. If the application is out of memory this may not be possible because the allocation fails. This may explain why the stack trace is missing.
When an application runs out of memory even error handling like logging may fail as a result of lack of resources. In your case you at least know that it was an out of memory situation that triggered the failure.
Upvotes: 2
Reputation: 60493
Sometimes, the callstack itself might be the cause of the OOM (too much in the call stack).
So... you see the problem.
Or the heap might be exhausted, or... or, see @Oded comment !
Upvotes: 2