Recently, I am regularly encountering errors of type
"An unhandled exception of type 'System.StackOverflowException' occurred in Unknown Module.".
This happens in a game (that I developed) with a quite large code base (C# / XNA). But typically the error occurs only after several minutes of gameplay (and not in every run).
The problem is that unfortunately, the Visual Studio debugger seems to not be able to further localize the problem and just lets me inspect the assembler code without reference to my source lines. How could one debug such an error? I guess tools like Valgrind are not available in C#. Is there maybe a better debugger that can show me where the problem is localized in the source code?
The call stack available when applying the steps in the suggested answer below. It is:
ntdll.dll!_NtWaitForSingleObject@12() + 0x15 bytes
ntdll.dll!_NtWaitForSingleObject@12() + 0x15 bytes
KernelBase.dll!_WaitForSingleObjectEx@12() + 0xcb bytes
kernel32.dll!_WaitForSingleObjectExImplementation@12() + 0x43 bytes
clr.dll!CLREvent::CreateManualEvent() - 0x15f3bb bytes
clr.dll!CLREvent::CreateManualEvent() - 0x15f37a bytes
clr.dll!CLREvent::WaitEx() + 0x47 bytes
clr.dll!CLREvent::Wait() + 0x19 bytes
clr.dll!Thread::WaitSuspendEventsHelper() + 0xa8 bytes
clr.dll!Thread::WaitSuspendEvents() + 0x17 bytes
clr.dll!Thread::RareEnablePreemptiveGC() + 0x181977 bytes
clr.dll!Thread::RareDisablePreemptiveGC() + 0x38e3 bytes
clr.dll!Debugger::SendException() + 0x12b bytes
clr.dll!Debugger::LastChanceManagedException() + 0x19f bytes
clr.dll!NotifyDebuggerLastChance() + 0x79 bytes
clr.dll!WatsonLastChance() + 0x166 bytes
clr.dll!EEPolicy::HandleFatalStackOverflow() + 0x189 bytes
clr.dll!EEPolicy::HandleStackOverflow() + 0xd8 bytes
clr.dll!_COMPlusFrameHandler() + 0xff302 bytes
ntdll.dll!ExecuteHandler2@20() + 0x26 bytes
ntdll.dll!ExecuteHandler@20() + 0x24 bytes
ntdll.dll!_RtlDispatchException@8() + 0xd3 bytes
ntdll.dll!_KiUserExceptionDispatcher@8() + 0xf bytes
clr.dll!SystemNative::ArrayCopy() + 0x19 bytes
mscorlib.ni.dll!6ed326a2()
Frames below may be incorrect and/or missing, no symbols loaded for mscorlib.ni.dll