From 12b71ca41d93a70c80c6b0975a44ae19df7468e1 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sat, 25 May 2024 20:44:58 +0800 Subject: [PATCH 1/4] Update zltoolkit --- 3rdpart/ZLToolKit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdpart/ZLToolKit b/3rdpart/ZLToolKit index 26d54bbc..1e1a9907 160000 --- a/3rdpart/ZLToolKit +++ b/3rdpart/ZLToolKit @@ -1 +1 @@ -Subproject commit 26d54bbc7b1860a450434dce49bbc8fcbcbae88b +Subproject commit 1e1a990783c6c09452419c0aaa6d72ce02d0202b From 942458480dcffa922b5cf872809f320ed7a6a5cb Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sat, 25 May 2024 21:16:57 +0800 Subject: [PATCH 2/4] Demangle backtrace function binary symbols when generated crash logs --- server/System.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/server/System.cpp b/server/System.cpp index 77578924..1e2c8f57 100644 --- a/server/System.cpp +++ b/server/System.cpp @@ -22,11 +22,12 @@ #include #include -#include "Common/JemallocUtil.h" -#include "Common/macros.h" #include "System.h" +#include "Util/util.h" #include "Util/logger.h" #include "Util/uv_errno.h" +#include "Common/macros.h" +#include "Common/JemallocUtil.h" using namespace std; using namespace toolkit; @@ -66,6 +67,16 @@ static void save_jemalloc_stats() { out.flush(); } +static std::string get_func_symbol(const std::string &symbol) { + size_t pos1 = symbol.find("("); + if (pos1 == string::npos) { + return ""; + } + size_t pos2 = symbol.find("+", pos1); + auto ret = symbol.substr(pos1 + 1, pos2 - pos1 - 1); + return ret; +} + static void sig_crash(int sig) { signal(sig, SIG_DFL); void *array[MAX_STACK_FRAMES]; @@ -78,6 +89,10 @@ static void sig_crash(int sig) { std::string symbol(strings[i]); ref.emplace_back(symbol); #if defined(__linux) || defined(__linux__) + auto func_symbol = get_func_symbol(symbol); + if (!func_symbol.empty()) { + ref.emplace_back(toolkit::demangle(func_symbol.data())); + } static auto addr2line = [](const string &address) { string cmd = StrPrinter << "addr2line -C -f -e " << exePath() << " " << address; return System::execute(cmd); From 3a50c6e06d3a042f88bb843ec4f40f159c52b1ad Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sat, 25 May 2024 21:50:25 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=87=8D=E6=96=B0=E6=95=B4=E7=90=86issue?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E8=A7=84=E8=8C=83=E8=A6=81=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug.md | 24 +++++++++---- .github/ISSUE_TEMPLATE/compile.md | 4 +-- .github/ISSUE_TEMPLATE/config.yml | 6 ++++ .github/ISSUE_TEMPLATE/feature.md | 6 ++-- .github/ISSUE_TEMPLATE/question.md | 19 ---------- .github/ISSUE_TEMPLATE/requirement.md | 8 ----- .github/workflows/issue_lint.yml | 51 +++++++++++++++++++++++++++ 7 files changed, 79 insertions(+), 39 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/ISSUE_TEMPLATE/question.md delete mode 100644 .github/ISSUE_TEMPLATE/requirement.md create mode 100644 .github/workflows/issue_lint.yml diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index c57d7a3e..62321514 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -20,14 +20,14 @@ assignees: '' * https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax --> -### 现象描述 +## 现象描述 -### 如何复现? +## 如何复现? -### 相关日志或截图 +## 相关日志或截图 -### 相关日志及环境信息 +## 相关日志及环境信息