summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-11-29 23:06:10 +0100
committerMattes D <github@xoft.cz>2014-11-29 23:06:10 +0100
commit201313a9f84192ad7f2fcd7e4ab2cc793a85b96f (patch)
treedacc0cc4d1d81cda9c4c9c8bf8fc1fff0dff2f13 /src/main.cpp
parentMerge pull request #1619 from mc-server/WarningFixes (diff)
downloadcuberite-201313a9f84192ad7f2fcd7e4ab2cc793a85b96f.tar
cuberite-201313a9f84192ad7f2fcd7e4ab2cc793a85b96f.tar.gz
cuberite-201313a9f84192ad7f2fcd7e4ab2cc793a85b96f.tar.bz2
cuberite-201313a9f84192ad7f2fcd7e4ab2cc793a85b96f.tar.lz
cuberite-201313a9f84192ad7f2fcd7e4ab2cc793a85b96f.tar.xz
cuberite-201313a9f84192ad7f2fcd7e4ab2cc793a85b96f.tar.zst
cuberite-201313a9f84192ad7f2fcd7e4ab2cc793a85b96f.zip
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index c60e13a8c..0a8521fbc 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -10,6 +10,7 @@
#ifdef _MSC_VER
#include <dbghelp.h>
#endif // _MSC_VER
+#include "OSSupport/StackTrace.h"
bool cRoot::m_TerminateEventRaised = false; // If something has told the server to stop; checked periodically in cRoot
@@ -61,6 +62,7 @@ void NonCtrlHandler(int a_Signal)
std::signal(SIGSEGV, SIG_DFL);
LOGERROR(" D: | MCServer has encountered an error and needs to close");
LOGERROR("Details | SIGSEGV: Segmentation fault");
+ PrintStackTrace();
abort();
}
case SIGABRT:
@@ -71,6 +73,7 @@ void NonCtrlHandler(int a_Signal)
std::signal(a_Signal, SIG_DFL);
LOGERROR(" D: | MCServer has encountered an error and needs to close");
LOGERROR("Details | SIGABRT: Server self-terminated due to an internal fault");
+ PrintStackTrace();
abort();
}
case SIGINT:
@@ -137,6 +140,9 @@ LONG WINAPI LastChanceExceptionFilter(__in struct _EXCEPTION_POINTERS * a_Except
g_WriteMiniDump(GetCurrentProcess(), GetCurrentProcessId(), dumpFile, g_DumpFlags, (a_ExceptionInfo) ? &ExcInformation : nullptr, nullptr, nullptr);
CloseHandle(dumpFile);
+ // Print the stack trace for the basic debugging:
+ PrintStackTrace();
+
// Revert to old stack:
_asm
{