aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/main.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-03-18 19:48:01 +0100
committerGitHub Enterprise <[email protected]>2026-03-18 19:48:01 +0100
commite854a69b99a08dd2f9ad1c236059c13c34cc44f5 (patch)
treec6805a8530acc0f4d36dd68ae502a6d7eb6c0cc2 /src/zenserver/main.cpp
parentPre-initialization of default logger (#859) (diff)
downloadzen-e854a69b99a08dd2f9ad1c236059c13c34cc44f5.tar.xz
zen-e854a69b99a08dd2f9ad1c236059c13c34cc44f5.zip
Add lightweight crash handler for pre-Sentry startup backtraces (#853)
- Install a crash handler at the very top of main() in both zenserver and zen - On Windows, uses SetUnhandledExceptionFilter with StackWalk64 for accurate crash-site backtraces with DbgHelp symbol resolution - On Linux/Mac, uses sigaction with async-signal-safe backtrace output - Automatically superseded when Sentry/crashpad installs its own handlers - Stays active for the full process lifetime if Sentry is disabled or absent - Include .sym debug symbol files in Linux release bundle
Diffstat (limited to 'src/zenserver/main.cpp')
-rw-r--r--src/zenserver/main.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/zenserver/main.cpp b/src/zenserver/main.cpp
index 9d786c209..bf328c499 100644
--- a/src/zenserver/main.cpp
+++ b/src/zenserver/main.cpp
@@ -3,6 +3,7 @@
#include <zencore/compactbinarybuilder.h>
#include <zencore/compactbinaryvalidation.h>
#include <zencore/config.h>
+#include <zencore/crashhandler.h>
#include <zencore/except.h>
#include <zencore/filesystem.h>
#include <zencore/fmtutils.h>
@@ -259,6 +260,8 @@ test_main(int argc, char** argv)
int
main(int argc, char* argv[])
{
+ zen::InstallCrashHandler();
+
#if ZEN_PLATFORM_WINDOWS
setlocale(LC_ALL, "en_us.UTF8");
#endif // ZEN_PLATFORM_WINDOWS