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 c++/109712] New: Segmentation fault in linear_search_fdes
Date: Wed, 03 May 2023 11:58:06 +0000	[thread overview]
Message-ID: <bug-109712-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 109712
           Summary: Segmentation fault in linear_search_fdes
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: carlosgalvezp at gmail dot com
  Target Milestone: ---

Created attachment 54978
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54978&action=edit
Reproducible example

Hi!

We are bumping our GCC installation from
6910cad55ffc330dc9767d2c8e0b66ccfa4134af to
07c52d1eec9671af92b7ce977b469f13a87887ad and are now getting a segmentation
fault when an exception is thrown, gdb points at "linear_search_fdes". Here's
the backtrace:

Thread 1 "a.out" received signal SIGSEGV, Segmentation fault.
linear_search_fdes (ob=0x7fffffffd690, this_fde=0x0, pc=0x404248 <foo()+50>) at
../../../gcc/libgcc/unwind-dw2-fde.c:969
969     ../../../gcc/libgcc/unwind-dw2-fde.c: No such file or directory.
(gdb) bt
#0  linear_search_fdes (ob=0x7fffffffd690, this_fde=0x0, pc=0x404248
<foo()+50>) at ../../../gcc/libgcc/unwind-dw2-fde.c:969
#1  0x00007ffff77c1e11 in find_fde_tail (dbase=18446744073709383432,
bases=0x7fffffffd8e8, hdr=0x4aaa34, pc=4211272) at
../../../gcc/libgcc/unwind-dw2-fde-dip.c:519
#2  _Unwind_Find_FDE (pc=<optimized out>, bases=bases@entry=0x7fffffffd8e8) at
../../../gcc/libgcc/unwind-dw2-fde-dip.c:573
#3  0x00007ffff77bd4aa in uw_frame_state_for (context=0x7fffffffd840,
fs=0x7fffffffd930) at ../../../gcc/libgcc/unwind-dw2.c:1005
#4  0x00007ffff77beefd in _Unwind_RaiseException (exc=0xcfc390) at
../../../gcc/libgcc/unwind.inc:104
#5  0x00007ffff7bced8a in __cxa_throw () from
/home/s0000069/src/src/bazel-src/external/gcc_trunk_x86_64_linux/usr/lib64/libstdc++.so.6
#6  0x0000000000404249 in foo () at ../main.cpp:8
#7  0x00000000004042a7 in main () at ../main.cpp:18

I attach a reproducible example that I have tested on Ubuntu 20.04, it will
download dependencies and build the example project. It expects a "GCC_BASE"
variable to be set pointing to the base GCC installation.

I have made the following observations, so I'm not sure the problem is GCC, but
I thought nevertheless to share it in case someone has a good intuition for
what could be happening. If this is not the right forum please let me know
where I should ask!

* The problem happens only when linking libcudart_static.a. If I think
libcudart.so it's fine. I have asked this question at the Nvidia forums as
well, awaiting reply.
* The problem happens only when throwing exceptions.
* The problem happens only when using the Gold linker.
* The problem happens only if I use the GCC trunk's libstdc++.so and
libgcc_s.so at runtime (via rpath). If I use the Ubuntu 20.04 system-installed
libraries, it runs fine.

Thank you for your time!

             reply	other threads:[~2023-05-03 11:58 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-03 11:58 carlosgalvezp at gmail dot com [this message]
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
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@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).