Skip to content

Commit

Permalink
[fix](stacktrace) Temporary fix ARM and MacOS stacktrace apache#23650
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyiZzz committed Oct 12, 2023
1 parent 64a4b5c commit a37f431
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion be/src/common/stack_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ StackTrace::StackTrace(const ucontext_t& signal_context) {
void StackTrace::tryCapture() {
// When unw_backtrace is not available, fall back on the standard
// `backtrace` function from execinfo.h.
#if USE_UNWIND
#if USE_UNWIND && defined(__x86_64__) // TODO
size = unw_backtrace(frame_pointers.data(), capacity);
#else
size = backtrace(frame_pointers.data(), capacity);
Expand Down
3 changes: 3 additions & 0 deletions be/src/util/stack_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ std::string get_stack_trace() {
} else if (tool == "glibc") {
return get_stack_trace_by_glibc();
} else if (tool == "libunwind") {
#if defined(__APPLE__) // TODO
return get_stack_trace_by_glog();
#endif
return get_stack_trace_by_libunwind();
} else {
return "no stack";
Expand Down

0 comments on commit a37f431

Please sign in to comment.