From b2c8e811e5d3cdbabedd970a8ff1c4269d71d524 Mon Sep 17 00:00:00 2001 From: Xinyi Zou Date: Sun, 8 Oct 2023 09:34:14 +0800 Subject: [PATCH] 3 --- be/src/common/status.h | 2 +- be/src/util/stack_util.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/be/src/common/status.h b/be/src/common/status.h index 5c8a56c65fdb4d3..f61ed84192b5c7d 100644 --- a/be/src/common/status.h +++ b/be/src/common/status.h @@ -396,7 +396,7 @@ class [[nodiscard]] Status { } #ifdef ENABLE_STACKTRACE if (stacktrace && capture_stacktrace(code)) { - status._err_msg->_stack = get_stack_trace(4); + status._err_msg->_stack = get_stack_trace(1); LOG(WARNING) << "meet error status: " << status; // may print too many stacks. } #endif diff --git a/be/src/util/stack_util.h b/be/src/util/stack_util.h index d32f97a0abae001..65b2d8bad2f5a92 100644 --- a/be/src/util/stack_util.h +++ b/be/src/util/stack_util.h @@ -29,8 +29,7 @@ namespace doris { // boost: 1000 times cost 1min, has line numbers, but has memory leak. // glibc: 1000 times cost 1min, no line numbers, unresolved backtrace symbol. // libunwind: cost is negligible, has line numbers. -// Delete the first three frame pointers, which are inside the StackTrace. -std::string get_stack_trace(int start_pointers_index = 3); +std::string get_stack_trace(int start_pointers_index = 0); // Note: there is a libc bug that causes this not to work on 64 bit machines // for recursive calls.