From 160d58c4b2c42f08ce755712159bdaa40913c0ac Mon Sep 17 00:00:00 2001 From: QwQ <59914293+Qv2ray-dev@users.noreply.github.com> Date: Wed, 5 Aug 2020 14:54:14 +0800 Subject: [PATCH] fix: trigger crash on signal handler --- makespec/BUILDVERSION | 2 +- src/main.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/makespec/BUILDVERSION b/makespec/BUILDVERSION index 3fb524c7..b272195b 100644 --- a/makespec/BUILDVERSION +++ b/makespec/BUILDVERSION @@ -1 +1 @@ -5860 +5861 diff --git a/src/main.cpp b/src/main.cpp index 7f1581fc..c2a9388c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -113,7 +113,7 @@ void signalHandler(int signum) { std::cout << msg.toStdString() << std::endl; QDir().mkpath(QV2RAY_CONFIG_DIR + "bugreport/"); - StringToFile(msg, filePath); + StringToFile("Signal: " + QSTRN(signum) + NEWLINE + msg, filePath); std::cout << "Backtrace saved in: " + filePath.toStdString() << std::endl; } if (qvApp) @@ -124,7 +124,7 @@ void signalHandler(int signum) filePath; QvMessageBoxWarn(nullptr, "UNCAUGHT EXCEPTION", message); } - exit(-99); + kill(0, SIGTRAP); } QPair> RunQv2rayApplicationScoped(int argc, char *argv[])