abseil / abseil/abseil-cpp

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

Aberta
#1,376 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
C++
Estrelas
18.1k
Forks
3.2k
Merge médio
20h 36min
PRs com merge (30d)
1

Descrição

### 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_

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.