dqlite
dqlite copied to clipboard
Use execinfo.h instead of libbacktrace
@just-now suggested this
https://man7.org/linux/man-pages/man3/backtrace.3.html
what will be involved in this:
- get rid of the
--enable-backtrace
switch in configure.ac, don't try to link libbacktrace - in configure.ac, check for the
execinfo.h
header and use that to setDQLITE_ASSERT_WITH_BACKTRACE
- get rid of src/raft/assert.h and use src/assert.h everywhere
- rewrite the code in src/assert.h to use the execinfo.h functions instead of the libbacktrace API
- test to make sure a backtrace is generated as expected when using glibc + gcc and glibc + clang. Bonus: see what happens with musl
- remove
--enable-backtrace
and libbacktrace installation from our CI
I can't assign the issue to him but @letFunny is working on this
Closing because the execinfo.h API doesn't read DWARF info, hence you can't get a helpful backtrace unless you postprocess it with addr2line, which makes this feature less convenient for quick debugging -- and quick debugging is really what it's good for.