This is an automated email from the ASF dual-hosted git repository.

zouxinyi 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 5876a326800 [fix](memory) Allocator address sanitizers enable print 
stack trace (#33853)
5876a326800 is described below

commit 5876a32680033dcacbb12a9e4cf5d4b4cf2edcda
Author: Xinyi Zou <zouxiny...@gmail.com>
AuthorDate: Mon Apr 22 10:45:44 2024 +0800

    [fix](memory) Allocator address sanitizers enable print stack trace (#33853)
    
    Allocator address sanitizers enable dwarf_location_info_mode=DISABLED stack 
trace, this will no stack line numbers, maybe cause performance reduce 1x
---
 be/src/common/config.cpp                      | 2 +-
 be/src/runtime/memory/mem_tracker_limiter.cpp | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index 6431a03beb2..a6972828209 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -1060,7 +1060,7 @@ DEFINE_mString(kerberos_krb5_conf_path, "/etc/krb5.conf");
 
 DEFINE_mString(get_stack_trace_tool, "libunwind");
 DEFINE_mString(dwarf_location_info_mode, "FAST");
-DEFINE_mBool(enable_address_sanitizers_with_stack_trace, "false");
+DEFINE_mBool(enable_address_sanitizers_with_stack_trace, "true");
 
 // the ratio of _prefetch_size/_batch_size in AutoIncIDBuffer
 DEFINE_mInt64(auto_inc_prefetch_size_ratio, "10");
diff --git a/be/src/runtime/memory/mem_tracker_limiter.cpp 
b/be/src/runtime/memory/mem_tracker_limiter.cpp
index 647c7629301..b110b2becbe 100644
--- a/be/src/runtime/memory/mem_tracker_limiter.cpp
+++ b/be/src/runtime/memory/mem_tracker_limiter.cpp
@@ -152,13 +152,13 @@ void MemTrackerLimiter::add_address_sanitizers(void* buf, 
size_t size) {
                       << ", peak consumption: " << _consumption->peak_value() 
<< ", buf: " << buf
                       << ", size: " << size << ", old buf: " << it->first
                       << ", old size: " << it->second.size
-                      << ", new stack_trace: " << get_stack_trace()
+                      << ", new stack_trace: " << get_stack_trace(1, 
"DISABLED")
                       << ", old stack_trace: " << it->second.stack_trace;
         }
 
         // if alignment not equal to 0, maybe usable_size > size.
         AddressSanitizer as = {size, 
doris::config::enable_address_sanitizers_with_stack_trace
-                                             ? get_stack_trace()
+                                             ? get_stack_trace(1, "DISABLED")
                                              : ""};
         _address_sanitizers.emplace(buf, as);
     }
@@ -176,7 +176,7 @@ void MemTrackerLimiter::remove_address_sanitizers(void* 
buf, size_t size) {
                           << ", peak consumption: " << 
_consumption->peak_value()
                           << ", buf: " << buf << ", size: " << size << ", old 
buf: " << it->first
                           << ", old size: " << it->second.size
-                          << ", new stack_trace: " << get_stack_trace()
+                          << ", new stack_trace: " << get_stack_trace(1, 
"DISABLED")
                           << ", old stack_trace: " << it->second.stack_trace;
             }
             _address_sanitizers.erase(buf);
@@ -184,7 +184,7 @@ void MemTrackerLimiter::remove_address_sanitizers(void* 
buf, size_t size) {
             LOG(INFO) << "[Address Sanitizer] memory buf not exist, mem 
tracker label: " << _label
                       << ", consumption: " << _consumption->current_value()
                       << ", peak consumption: " << _consumption->peak_value() 
<< ", buf: " << buf
-                      << ", size: " << size << ", stack_trace: " << 
get_stack_trace();
+                      << ", size: " << size << ", stack_trace: " << 
get_stack_trace(1, "DISABLED");
         }
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to