From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 90D2D3858D1E; Sat, 3 Jun 2023 20:39:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 90D2D3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685824782; bh=Fn1HSVjC4UFQ0/SJfmn0rCHwkoPJXApc0/5eSt/MbQ0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MoV3ny+WZStj7QutaKZkN6F10jjP8Qw+12aO5ueiVQgGO4h7R3Lb+T/2+2nCO4VU1 7xFLbEHTYpGZYC9HvzcRNv9Tv0/0BhxM8h/zLb2z1e1GFZR7yN+aSaCt9nshh3XBUj Z4zXpK9OISl5uLr131KzWgWBGQ5nQUZTyxBLFW1k= From: "carlosgalvezp at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgcc/109712] Segmentation fault in linear_search_fdes Date: Sat, 03 Jun 2023 20:39:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgcc X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: carlosgalvezp at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: 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://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109712 --- Comment #10 from Carlos Galvez --- Hi! I've continued to look into this and am having a slightly different but essentially same error with yet another Nvidia library, but this time is wi= th a pure shared library, "libnvinfer.so", which was compiled against GCC 7. Most likely the library is statically linked against libcudart_static.a. The iss= ue is not solved using bfd or lld linker. My program simply links against that library, which internally throws an exception. I get a very similar backtrace: #0 linear_search_fdes (ob=3D0x7fffffffd350, this_fde=3D0x0, pc=3D0x7fffdf4= b6a69) at ../../../gcc/libgcc/unwind-dw2-fde.c:973 #1 0x00007fffdde1cde1 in find_fde_tail (dbase=3D2424076, bases=3D0x7ffffff= fd5a8, hdr=3D0x7ffff690ca70, pc=3D140736939649641) at ../../../gcc/libgcc/unwind-dw2-fde-dip.c:519 #2 _Unwind_Find_FDE (pc=3D, bases=3Dbases@entry=3D0x7ffffff= fd5a8) at ../../../gcc/libgcc/unwind-dw2-fde-dip.c:573 #3 0x00007fffdde1847a in uw_frame_state_for (context=3D0x7fffffffd500, fs=3D0x7fffffffd5f0) at ../../../gcc/libgcc/unwind-dw2.c:1005 #4 0x00007fffdde19ecd in _Unwind_RaiseException (exc=3D0x904320) at ../../../gcc/libgcc/unwind.inc:104 #5 0x00007fffde2b7e6a in __cxa_throw () from /path/to/usr/lib64/libstdc++.= so.6 #6 0x00007fffdf4b6a6a in ?? () from /path/to/nvinfer/lib/libnvinfer.so.8 #7 0x00007fffdf4c21b5 in ?? () from /path/to/nvinfer/lib/libnvinfer.so.8 #8 0x00007fffdfbddf02 in ?? () from /path/to/nvinfer/lib/libnvinfer.so.8 #9 0x00007fffdf42a118 in createInferBuilder_INTERNAL () from /path/to/nvinfer/lib/libnvinfer.so.8 #10 0x0000000000401163 in nvinfer1::(anonymous namespace)::createInferBuild= er (logger=3D...) at nvinfer/include/NvInfer.h:9093 #11 0x0000000000401182 in main () at main.cpp:13 So the library was compiled with GCC 7 and has a dependency on libstdc++.so= .6. Via LD_LIBRARY_PATH, I run my executable using GCC trunk (14)'s libstdc++.s= o.6. Now, I try to see if "libnvinfer_static.a" uses any symbol from "libgcc_eh.= a", by doing: - Run "nm libgcc_eh.a" and store a list of all "T" or "t" symbols. - Run "nm libnvinfer_static.a" and store a list of all "U" symbols. - Compute the intersection between those two lists. This results in that "libnvinfer_static.a" only uses 1 symbol from libgcc_e= h.a: _Unwind_Resume. Is the above test procedure correct to determine the symbols used from libgcc_eh.a? How come linking a pure shared library such as libnvinfer.so would lead to mixing types from different versions of libgcc_eh.a, i.e. how could those internal changes leak outside the shared library boundaries?=20 After all this comes from __cxa_throw() from libstdc++.so.6, which is a versioned symbol. Shouldn't that function get a new symbol version if there= 's an ABI incompatible change? Thank you for your time and help, really appreciated!=