This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new babd0430c7 [fix](stacktrace) Fix StackTraceCache initialized before
ExecEnv (#23828)
babd0430c7 is described below
commit babd0430c74760326f6e2f3d0860313e6d7764ec
Author: Xinyi Zou <[email protected]>
AuthorDate: Tue Sep 5 09:06:16 2023 +0800
[fix](stacktrace) Fix StackTraceCache initialized before ExecEnv (#23828)
---
be/src/common/stack_trace.cpp | 5 +++++
be/src/common/stack_trace.h | 1 +
be/src/service/doris_main.cpp | 3 +++
3 files changed, 9 insertions(+)
diff --git a/be/src/common/stack_trace.cpp b/be/src/common/stack_trace.cpp
index 703dfe49b6..bc50b6524d 100644
--- a/be/src/common/stack_trace.cpp
+++ b/be/src/common/stack_trace.cpp
@@ -474,6 +474,11 @@ std::string StackTrace::toString(void**
frame_pointers_raw, size_t offset, size_
return toStringCached(frame_pointers, offset, size);
}
+void StackTrace::createCache() {
+ std::lock_guard lock {stacktrace_cache_mutex};
+ cacheInstance();
+}
+
void StackTrace::dropCache() {
std::lock_guard lock {stacktrace_cache_mutex};
cacheInstance().clear();
diff --git a/be/src/common/stack_trace.h b/be/src/common/stack_trace.h
index 7e6ae14a4c..302e9c8380 100644
--- a/be/src/common/stack_trace.h
+++ b/be/src/common/stack_trace.h
@@ -76,6 +76,7 @@ public:
[[nodiscard]] std::string toString() const;
static std::string toString(void** frame_pointers, size_t offset, size_t
size);
+ static void createCache();
static void dropCache();
static void symbolize(const FramePointers& frame_pointers, size_t offset,
size_t size,
StackTrace::Frames& frames);
diff --git a/be/src/service/doris_main.cpp b/be/src/service/doris_main.cpp
index 2405ef6eab..8d24f39936 100644
--- a/be/src/service/doris_main.cpp
+++ b/be/src/service/doris_main.cpp
@@ -39,6 +39,7 @@
#include <tuple>
#include <vector>
+#include "common/stack_trace.h"
#include "olap/tablet_schema_cache.h"
#include "olap/utils.h"
#include "runtime/memory/mem_tracker_limiter.h"
@@ -307,6 +308,8 @@ struct Checker {
int main(int argc, char** argv) {
doris::signal::InstallFailureSignalHandler();
doris::init_signals();
+ // create StackTraceCache Instance, at the beginning, other static
destructors may use.
+ StackTrace::createCache();
// check if print version or help
if (argc > 1) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]