abseil / abseil/abseil-cpp

[Bug]: absl_stacktrace calls backtrace() which uses libgcc_s unwinding which is ABI incompatible with LLVM libunwind

Ouverte
#1,376 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
C++
Étoiles
18.1k
Forks
3.2k
Merge moyen
20 h 36 min
PR mergées (30 j)
1

Description

### Describe the issue

The absl_stacktrace library performs a call to libc's backtrace(...) function during dynamic initialization: https://github.com/abseil/abseil-cpp/blob/lts_2023_01_25/absl/debugging/internal/stacktrace_generic-inl.inc#L53
This method will in turn dynamically load libgcc_s.so at runtime (https://elixir.bootlin.com/glibc/glibc-2.36/source/debug/backtrace.c#L69 and https://elixir.bootlin.com/glibc/glibc-2.36/source/misc/unwind-link.c#L50) and use the unwinding API from that library to walk the stack.
This poses a problem (i.e. segmentation fault) for applications that were built with LLVM libunwind because the GCC and LLVM unwinders are not ABI compatible.

I checked the absl CMake build system and was unable to find a toggle that would allow me to opt out of stacktrace support or to have it use stacktrace_unimplemented-inl.inc instead of stacktrace_generic-inl.inc with ABSL_STACKTRACE_INL_HEADER not being allowed to be set from the outside.

### Steps to reproduce the problem

Build application, that uses absl, with LLVM libunwind (e.g. --rtlib=compiler-rt -unwindlib=libunwind).
The program will segfault during the call to backtrace() when starting up and before reaching main().

### What version of Abseil are you using?

#define ABSL_LTS_RELEASE_VERSION 20211102
#define ABSL_LTS_RELEASE_PATCH_LEVEL 0

### What operating system and version are you using?

Linux on arm-linux-gnueabihf
glibc 2.23

### What compiler and version are you using?

Clang 13 compiler backed by buildroot GCC 4.9.3 sysroot
libc++13, libc++abi-13, and libunwind 13

### What build system are you using?

cmake version 3.25.1

### Additional context

_No response_

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.