aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/Debugging/Errors.cpp7
-rw-r--r--src/common/Debugging/Errors.h2
-rw-r--r--src/server/authserver/Main.cpp2
-rw-r--r--src/server/worldserver/Main.cpp2
4 files changed, 13 insertions, 0 deletions
diff --git a/src/common/Debugging/Errors.cpp b/src/common/Debugging/Errors.cpp
index 1ec66ff6d59..749cdec2742 100644
--- a/src/common/Debugging/Errors.cpp
+++ b/src/common/Debugging/Errors.cpp
@@ -96,4 +96,11 @@ void Abort(char const* file, int line, char const* function)
exit(1);
}
+void AbortHandler(int sigval)
+{
+ // nothing useful to log here, no way to pass args
+ *((volatile int*)NULL) = 0;
+ exit(1);
+}
+
} // namespace Trinity
diff --git a/src/common/Debugging/Errors.h b/src/common/Debugging/Errors.h
index 38e311a6b13..37d247ada82 100644
--- a/src/common/Debugging/Errors.h
+++ b/src/common/Debugging/Errors.h
@@ -34,6 +34,8 @@ namespace Trinity
void Warning(char const* file, int line, char const* function, char const* message);
+ DECLSPEC_NORETURN void AbortHandler(int sigval) ATTR_NORETURN;
+
} // namespace Trinity
#if COMPILER == COMPILER_MICROSOFT
diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp
index 1a6d9831b9a..a53187ad737 100644
--- a/src/server/authserver/Main.cpp
+++ b/src/server/authserver/Main.cpp
@@ -79,6 +79,8 @@ uint32 _banExpiryCheckInterval;
int main(int argc, char** argv)
{
+ signal(SIGABRT, &Trinity::AbortHandler);
+
std::string configFile = _TRINITY_REALM_CONFIG;
std::string configService;
auto vm = GetConsoleArguments(argc, argv, configFile, configService);
diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp
index 0b8f0a92fa0..6a968d4fde9 100644
--- a/src/server/worldserver/Main.cpp
+++ b/src/server/worldserver/Main.cpp
@@ -93,6 +93,8 @@ variables_map GetConsoleArguments(int argc, char** argv, std::string& cfg_file,
/// Launch the Trinity server
extern int main(int argc, char** argv)
{
+ std::signal(SIGABRT, &Trinity::AbortHandler);
+
std::string configFile = _TRINITY_CORE_CONFIG;
std::string configService;