[DocDB] Optimize stack trace collection and symbolization #19085
Labels
area/docdb
YugabyteDB core features
kind/enhancement
This is an enhancement of an existing feature
priority/medium
Medium priority issue
Jira Link: DB-7896
Description
To collect a stack trace (an array of raw program counters) we currently have the following ways:
To symbolize a stack trace (convert program counters to function names as well as file names / line numbers, if possible) in StackTrace::Symbolize we do one of the following:
There is also absl::Symbolize which is much faster than google::Symbolize according to @SrivastavaAnubhav. We should prefer to use that function.
libbacktrace is a library that has some issues (internal deadlocks under some circumstances) so we don't use it in release by default. It is controlled by the FLAGS_libbacktrace, which is true by default in debug mode and false in release mode on Linux, and always false on macOS. libbacktrace is only supported on Linux.
Also, we have a separate implementation of a combined collect + symbolize function called GetStackTrace:
We need to clean up this inconsistency and make GetStackTrace() the same as StackTrace::Collect() followed by Symbolize().
A proposed format for stack traces is as follows (using function names provided by
absl::Symbolize
):Also, libbacktrace produces really long function names/signatures with all the template arguments, and the resulting stack traces become unreadable. absl::Symbolize produces much more reasonable function names/signatures.
Warning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: