[From nobody Tue Nov 24 12:03:09 2026
Received: (at submit) by bugs.debian.org; 27 Jun 2025 21:41:58 +0000
X-Spam-Checker-Version: SpamAssassin 4.0.1-bugs.debian.org_2005_01_02
 (2024-03-25) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-12.8 required=4.0 tests=BAYES_00,
 BODY_INCLUDES_PACKAGE,DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FOURLA,
 FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,FVGT_m_MULTI_ODD,GMAIL,
 HAS_PACKAGE,NML_ADSP_CUSTOM_MED,RDNS_NONE,SPF_SOFTFAIL,
 SPOOFED_FREEMAIL,SPOOFED_FREEMAIL_NO_RDNS,SPOOF_GMAIL_MID,WEIRD_PORT,
 XMAILER_REPORTBUG autolearn=ham autolearn_force=no
 version=4.0.1-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 88; hammy, 150; neutral, 215; spammy,
 0. spammytokens: hammytokens:0.000-+--XDebbugsCc,
 0.000-+--X-Debbugs-Cc, 0.000-+--H*M:reportbug, 0.000-+--H*MI:reportbug,
 0.000-+--sysv
Return-path: &lt;nolange79@gmail.com&gt;
Received: from [194.0.72.115] (port=19840 helo=[127.0.1.1])
 by buxtehude.debian.org with esmtp (Exim 4.96)
 (envelope-from &lt;nolange79@gmail.com&gt;) id 1uVGpZ-00EPXM-1a
 for submit@bugs.debian.org; Fri, 27 Jun 2025 21:41:58 +0000
Content-Type: text/plain; charset=&quot;us-ascii&quot;
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Norbert Lange &lt;nolange79@gmail.com&gt;
To: Debian Bug Tracking System &lt;submit@bugs.debian.org&gt;
Subject: libc++1-19: should not use libunwind,
 it can always cause a mess with libgcc_s
Message-ID: &lt;175106051519.9066.17606029341238788793.reportbug@debian-noppl&gt;
X-Mailer: reportbug 13.2.0
Date: Fri, 27 Jun 2025 23:41:55 +0200
Delivered-To: submit@bugs.debian.org

Package: libc++abi1-19
Version: 1:19.1.7-3+b1
Severity: important
X-Debbugs-Cc: nolange79@gmail.com

On systems using glibc there are apparently some ways libgcc_s is dynamically
loaded during backtrace or stack unwinding.
libunwind and libgcc_s then have conflicting definitions, which typically leads to a seqfault.

The issue is discussed at https://reviews.llvm.org/D106703, I also made an issue at
https://github.com/llvm/llvm-project/issues/90041.

Tough it seems specific to debian, and as far as I understand you should not
use libunwind with glibc as libgcc_s will be always mixed in.
In a distro based on glibc, libunwind should probably not be used at all,
removing it from libc++abi1 should atleast make libc++ work.


Simple example:

------
#include &lt;pthread.h&gt;
#include &lt;thread&gt;
extern &quot;C&quot; int main()
{
    std::thread systhr([]() { std::this_thread::sleep_for(std::chrono::seconds(10000)); });

    std::this_thread::sleep_for(std::chrono::seconds(1));
    pthread_cancel(systhr.native_handle());

    systhr.join();
    return 0;
}
------

Compile the code with either unwind library:

clang++ -stdlib=libc++ test.cpp
clang++ -stdlib=libc++ -unwindlib=libunwind --rtlib=compiler-rt -O2 test.cpp

Running the program will crash, as libgcc's unwinder will *always* be used:

------
#0  0x0000000000000000 in ?? ()
#1  0x00007ffff7e51cb4 in __unw_get_proc_info () at build-llvm/tools/clang/stage2-bins/runtimes/runtimes-bins/libunwind/src/libunwind.cpp:201
#2  0x00007ffff7e571e6 in _Unwind_GetLanguageSpecificData () at build-llvm/tools/clang/stage2-bins/runtimes/runtimes-bins/libunwind/src/UnwindLevel1.c:528
#3  0x00007ffff7e89415 in scan_eh_tab () at build-llvm/tools/clang/stage2-bins/runtimes/runtimes-bins/libcxxabi/src/cxa_personality.cpp:626
#4  __gxx_personality_v0 () at build-llvm/tools/clang/stage2-bins/runtimes/runtimes-bins/libcxxabi/src/cxa_personality.cpp:957
#5  0x00007ffff735a860 in _Unwind_ForcedUnwind_Phase2 (exc=exc@entry=0x7ffff7b65d30, context=context@entry=0x7ffff7b64ce0, frames_p=frames_p@entry=0x7ffff7b64be8) at ../../../src/libgcc/unwind.inc:183
#6  0x00007ffff735af40 in _Unwind_ForcedUnwind (exc=0x7ffff7b65d30, stop=0x7ffff7c04f30 &lt;unwind_stop&gt;, stop_argument=&lt;optimized out&gt;) at ../../../src/libgcc/unwind.inc:218
#7  0x00007ffff7c050b0 in __GI___pthread_unwind (buf=&lt;optimized out&gt;) at ./nptl/unwind.c:130
#8  0x00007ffff7bf9613 in __do_cancel (result=0xffffffffffffffff) at ../sysdeps/nptl/pthreadP.h:273
#9  __syscall_do_cancel () at ./nptl/cancellation.c:109
#10 0x00007ffff7bf969d in __internal_syscall_cancel (a1=a1@entry=0, a2=a2@entry=0, a3=&lt;optimized out&gt;, a4=&lt;optimized out&gt;, a5=a5@entry=0, a6=a6@entry=0, nr=230) at ./nptl/cancellation.c:61
#11 0x00007ffff7c45f7a in __GI___clock_nanosleep (clock_id=&lt;optimized out&gt;, clock_id@entry=0, flags=flags@entry=0, req=&lt;optimized out&gt;, rem=&lt;optimized out&gt;) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:48
#12 0x00007ffff7c51393 in __GI___nanosleep (req=&lt;optimized out&gt;, rem=&lt;optimized out&gt;) at ../sysdeps/unix/sysv/linux/nanosleep.c:25
#13 0x00007ffff7effceb in __libcpp_thread_sleep_for () at build-llvm/tools/clang/stage2-bins/include/c++/v1/__thread/support/pthread.h:198
#14 sleep_for () at build-llvm/tools/clang/stage2-bins/runtimes/runtimes-bins/libcxx/src/thread.cpp:94
#15 0x000055555555530e in void* std::__1::__thread_proxy[abi:ne190107]&lt;std::__1::tuple&lt;std::__1::unique_ptr&lt;std::__1::__thread_struct, std::__1::default_delete&lt;std::__1::__thread_struct&gt; &gt;, main::$_0&gt; &gt;(void*) ()
#16 0x00007ffff7bfcb7b in start_thread (arg=&lt;optimized out&gt;) at ./nptl/pthread_create.c:448
#17 0x00007ffff7c7a7b8 in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
------


This is also a duplicate of #1071210, but I guess Bugs for llvm-toolchain-18
receive no attention.



-- System Information:
Debian Release: 13.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.12.33+deb13-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libc++abi1-19 depends on:
ii  libc6         2.41-9
ii  libunwind-19  1:19.1.7-3+b1

libc++abi1-19 recommends no packages.

libc++abi1-19 suggests no packages.

-- no debconf information
]