Bug#1023439: Conflicts with libgcc_s.so
Lingzhu Xiang
xianglingzhu at gmail.com
Fri Nov 4 06:11:41 GMT 2022
Package: libunwind-13
Version: 1:13.0.1-7
Severity: grave
LLVM libunwind and libgcc_s.so export the same unwinding functions.
$ objdump -T libgcc_s.so.1 | grep _Unwind_GetLanguageSpecificData
0000000000014a00 g DF .text 000000000000000c GCC_3.0
_Unwind_GetLanguageSpecificData
$ objdump -T libunwind.so.1.0 | grep _Unwind_GetLanguageSpecificData
0000000000005510 g DF .text 0000000000000043 Base
_Unwind_GetLanguageSpecificData
This would cause many C++ programs linking libunwind to potentially crash.
I have the following reproducer which has a dependency on libgtest-dev:
$ sudo apt install libgtest-dev libunwind-13-dev
$ cat a.cc
#include <gtest/gtest.h>
#include <pthread.h>
TEST(Bug, Repro) {
pthread_exit(nullptr);
}
$ g++ a.cc -lgtest_main -lgtest -lpthread -lunwind
$ ./a.out
...
Segmentation fault
GDB shows the following backtrace:
#0 0x00007ffff7a0e740 in ?? ()
#1 0x00007ffff7f5940a in unw_get_proc_info () from
/lib/x86_64-linux-gnu/libunwind.so.1
#2 0x00007ffff7f5d7ac in _Unwind_GetLanguageSpecificData () from
/lib/x86_64-linux-gnu/libunwind.so.1
#3 0x00007ffff7e1eb98 in __cxxabiv1::__gxx_personality_v0 (...) at
.../eh_personality.cc:446
#4 0x00007ffff7a21d54 in _Unwind_ForcedUnwind_Phase2 (...) at
.../unwind.inc:182
#5 0x00007ffff7a22412 in _Unwind_ForcedUnwind (...) at .../unwind.inc:217
#6 0x00007ffff7f75f66 in __GI___pthread_unwind (buf=<optimized out>) at
unwind.c:121
#7 0x00007ffff7f6c972 in __do_cancel () at pthreadP.h:310
#8 __pthread_exit (value=<optimized out>) at pthread_exit.c:28
(...)
There was a previous discussion that has some details about the conflicts
between libunwind and libgcc_s.so: https://reviews.llvm.org/D106703.
Regards,
Lingzhu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-llvm-team/attachments/20221104/76273a45/attachment-0001.htm>
More information about the Pkg-llvm-team
mailing list