public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "carlosgalvezp at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-109712-4-43GPWDAw91@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109712-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109712

--- Comment #10 from Carlos Galvez <carlosgalvezp at gmail dot com> ---
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 with a
pure shared library, "libnvinfer.so", which was compiled against GCC 7. Most
likely the library is statically linked against libcudart_static.a. The issue
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=0x7fffffffd350, this_fde=0x0, pc=0x7fffdf4b6a69) at
../../../gcc/libgcc/unwind-dw2-fde.c:973
#1  0x00007fffdde1cde1 in find_fde_tail (dbase=2424076, bases=0x7fffffffd5a8,
hdr=0x7ffff690ca70, pc=140736939649641) at
../../../gcc/libgcc/unwind-dw2-fde-dip.c:519
#2  _Unwind_Find_FDE (pc=<optimized out>, bases=bases@entry=0x7fffffffd5a8) at
../../../gcc/libgcc/unwind-dw2-fde-dip.c:573
#3  0x00007fffdde1847a in uw_frame_state_for (context=0x7fffffffd500,
fs=0x7fffffffd5f0) at ../../../gcc/libgcc/unwind-dw2.c:1005
#4  0x00007fffdde19ecd in _Unwind_RaiseException (exc=0x904320) 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)::createInferBuilder
(logger=...) 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++.so.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_eh.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? 

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!

  parent reply	other threads:[~2023-06-03 20:39 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-03 11:58 [Bug c++/109712] New: " carlosgalvezp at gmail dot com
2023-05-03 13:13 ` [Bug c++/109712] " rguenth at gcc dot gnu.org
2023-05-03 18:36 ` [Bug libgcc/109712] " pinskia at gcc dot gnu.org
2023-05-03 18:42 ` pinskia at gcc dot gnu.org
2023-05-04  7:38 ` carlosgalvezp at gmail dot com
2023-05-04  7:46 ` carlosgalvezp at gmail dot com
2023-05-13  8:23 ` carlosgalvezp at gmail dot com
2023-05-15  6:06 ` rguenth at gcc dot gnu.org
2023-05-15 14:36 ` carlosgalvezp at gmail dot com
2023-05-17  7:15 ` rguenth at gcc dot gnu.org
2023-06-03 20:39 ` carlosgalvezp at gmail dot com [this message]
2023-06-03 20:45 ` pinskia at gcc dot gnu.org
2023-06-04  6:20 ` carlosgalvezp at gmail dot com
2023-06-05  7:23 ` rguenth at gcc dot gnu.org
2023-06-05 10:44 ` tneumann at users dot sourceforge.net
2023-06-05 13:52 ` carlosgalvezp at gmail dot com
2023-06-05 14:53 ` tneumann at users dot sourceforge.net
2023-06-05 14:59 ` tneumann at users dot sourceforge.net
2023-06-05 15:17 ` carlosgalvezp at gmail dot com
2023-06-05 15:24 ` tneumann at users dot sourceforge.net
2023-06-05 15:34 ` fw at gcc dot gnu.org
2023-06-05 16:27 ` tneumann at users dot sourceforge.net
2023-06-05 20:34 ` carlosgalvezp at gmail dot com
2023-06-05 20:47 ` fw at gcc dot gnu.org
2023-06-05 20:48 ` fw at gcc dot gnu.org
2023-06-05 20:52 ` carlosgalvezp at gmail dot com
2023-06-05 20:59 ` tneumann at users dot sourceforge.net
2023-06-06  7:45 ` [Bug libgcc/109712] [13/14 Regression] " rguenth at gcc dot gnu.org
2023-06-06  9:52 ` fw at gcc dot gnu.org
2023-06-07 12:20 ` carlosgalvezp at gmail dot com
2023-06-07 12:23 ` carlosgalvezp at gmail dot com
2023-06-07 15:55 ` cvs-commit at gcc dot gnu.org
2023-06-07 15:56 ` fw at gcc dot gnu.org
2023-07-09  6:54 ` [Bug libgcc/109712] [13 " pinskia at gcc dot gnu.org
2023-07-10 10:28 ` fw at gcc dot gnu.org
2023-07-18 13:55 ` rguenth at gcc dot gnu.org
2023-07-18 14:28 ` fw at gcc dot gnu.org
2023-07-18 15:02 ` cvs-commit at gcc dot gnu.org
2023-07-18 15:11 ` fw at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-109712-4-43GPWDAw91@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).