20 #pragma clang diagnostic push
21 #pragma clang diagnostic ignored "-Wunknown-warning-option"
22 #pragma clang diagnostic ignored "-Wunknown-pragmas"
23 #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
28 LOGD(
"Terminate event raised from std::signal");
37 "Failure report: \n\n"
38 " :( | Cuberite has encountered an error and needs to close\n"
39 " | SIGSEGV: Segmentation fault\n"
42 " | Cuberite " BUILD_SERIES_NAME
" (id: " BUILD_ID
")\n"
43 " | from commit " BUILD_COMMIT_ID
"\n"
47 std::signal(SIGSEGV, SIG_DFL);
58 "Failure report: \n\n"
59 " :( | Cuberite has encountered an error and needs to close\n"
60 " | SIGABRT: Server self-terminated due to an internal fault\n"
63 " | Cuberite " BUILD_SERIES_NAME
" (id: " BUILD_ID
")\n"
64 " | from commit " BUILD_COMMIT_ID
"\n"
68 std::signal(SIGSEGV, SIG_DFL);
82 #pragma clang diagnostic pop
92 static BOOL CtrlHandler(DWORD fdwCtrlType)
95 LOGD(
"Terminate event raised from the Windows CtrlHandler");
98 std::this_thread::sleep_for(std::chrono::seconds(10));
119 #ifdef SIGABRT_COMPAT
123 std::signal(SIGPIPE, SIG_IGN);
127 SetConsoleCtrlHandler(
reinterpret_cast<PHANDLER_ROUTINE
>(CtrlHandler), TRUE);
void LOGERROR(std::string_view a_Format, const Args &... args)
static void NonCtrlHandler(int a_Signal)
void PrintStackTrace(void)
Prints the stacktrace for the current thread.
static void Stop()
Interrupts the server and stops it, as if "/stop" typed in the console.