Issue #17616 has been reported by xtkoba (Tee KOBAYASHI).

----------------------------------------
Feature #17616: Support backtracing on Linux with non-GNU-libc + libunwind
https://bugs.ruby-lang.org/issues/17616

* Author: xtkoba (Tee KOBAYASHI)
* Status: Open
* Priority: Normal
----------------------------------------
Currently, `vm_dump.c` assumes that the availability of `backtrace` implies the existence of `execinfo.h`, but it is not the case with non-GNU libc (e.g. musl or Bionic) Linux systems where libunwind is installed.

A patch is attached to enable backtracing on those systems. With this patch, we modify `configure` so that it (1) always checks if `execinfo.h` exists, and that (2) when it cannot find that file on Linux, then checks if `unw_backtrace` is available.

In this patch, we assume (in `vm_dump.c`) that on Linux the availability of `unw_backtrace` implies the existence of `libunwind.h`. If it is not the case, a further modification will be needed.

It is preferable if we can choose between `backtrace` in glibc or `unw_backtrace` in libunwind when both are available. With this patch, the former is chosen by default, and the latter is chosen when `ac_cv_header_execinfo_h=no` is passed to `configure`.

---Files--------------------------------
ruby-linux-non_glibc-libunwind-backtrace.patch (1.79 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>