From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 81B953858D28; Mon, 8 Apr 2024 19:57:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 81B953858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712606230; bh=tq3AddLZ6Bxp9mtAjNUBbZontoVtWhxQ87bJjw/rBNQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mGQhxeucJ1i3ju/DAIWRrVNpN2rWDr1XwPghYMyOY1W1suL5AwUXDxYU61QQxL52p oBUTx8dhrUwh2gXs+4OIgE3eqOhpqvBcqRT3FXjfByVrDe9StAXcHPv2Vxk7FomKQw FX5AeyHOS2K3pW0mIcEWxx71stdbIjmVi0A2C7/c= From: "fweimer at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug nptl/5784] Fix static linking with -lpthread. Date: Mon, 08 Apr 2024 19:57:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: nptl X-Bugzilla-Version: 2.40 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: fweimer at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D5784 --- Comment #10 from Florian Weimer --- Backtrace: #0 0x0000000000000000 in ?? () #1 0x000000000040c645 in close_unit_1 () #2 0x000000000040c78a in _gfortrani_close_units () #3 0x0000000000463914 in call_fini () #4 0x000000000046c80a in __run_exit_handlers () #5 0x000000000046c96e in exit () #6 0x0000000000463daf in __libc_start_call_main () #7 0x0000000000465d18 in __libc_start_main_impl () #8 0x00000000004039b5 in _start () Crash location: 0x000000000040c639 <+233>: lea 0xe0(%rbx),%rdi 0x000000000040c640 <+240>: call 0x0 =3D> 0x000000000040c645 <+245>: mov %rbx,%rdi So this is a weak symbol. Looking at the symbol table: File: /usr/lib/gcc/x86_64-redhat-linux/13/libgfortran.a(unit.o) [=E2=80=A6] 102: 0000000000000000 0 NOTYPE WEAK DEFAULT UND __pthread_key_cr= eate 103: 0000000000000000 0 NOTYPE WEAK DEFAULT UND pthread_mutex_destroy 104: 0000000000000000 0 NOTYPE WEAK DEFAULT UND pthread_mutex_un= lock 105: 0000000000000000 0 NOTYPE WEAK DEFAULT UND pthread_mutex_trylock 106: 0000000000000000 0 NOTYPE WEAK DEFAULT UND pthread_mutex_lo= ck This is a GCC bug. It should not use weak symbols in static builds. Or dyna= mic builds, but there it doesn't matter anymore since glibc 2.34. I think we cleaned all this up for libstdc++, looks like we missed libgfortran. --=20 You are receiving this mail because: You are on the CC list for the bug.=