Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] get_stack_trace default use libunwind in arm environment #46947

Open
2 of 3 tasks
ilkiku opened this issue Jan 14, 2025 · 1 comment
Open
2 of 3 tasks

[Bug] get_stack_trace default use libunwind in arm environment #46947

ilkiku opened this issue Jan 14, 2025 · 1 comment

Comments

@ilkiku
Copy link

ilkiku commented Jan 14, 2025

Search before asking

  • I had searched in the issues and found no similar issues.

Version

2.1.7

What's Wrong?

#22683
When compiling for the ARM version with use_unwind=off, but get_stack_trace still defaults to using libunwind for stack trace printing.

std::string get_stack_trace(int start_pointers_index, std::string dwarf_location_info_mode) {
#ifdef ENABLE_STACKTRACE
if (dwarf_location_info_mode.empty()) {
dwarf_location_info_mode = config::dwarf_location_info_mode;
}
auto tool = config::get_stack_trace_tool;
if (tool == "glog") {
return get_stack_trace_by_glog();
} else if (tool == "boost") {
return get_stack_trace_by_boost();
} 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(start_pointers_index, dwarf_location_info_mode);
} else {
return "no stack";
}
#endif
return "no enable stack";
}

What You Expected?

add a condition #if USE_UNWIND

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@xinyiZzz
Copy link
Contributor

xinyiZzz commented Jan 15, 2025

USE_UNWIND is effective in StackTrace::tryCapture().
For ARM, although get_stack_trace_by_libunwind is called, the standard backtrace function from execinfo.h is actually used instead of unw_backtrace, regardless of whether USE_UNWIND is ON or OFF.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants