From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DAEDF3857009; Wed, 3 May 2023 11:58:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DAEDF3857009 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683115086; bh=H78ce21Fthl9WkXTAfIBawn6gZo4sH/a8kgnOweJM4E=; h=From:To:Subject:Date:From; b=Z3uzIRRLOyQgUR85JjhSUiqUB7VSnftXz0eiItMyNm4sR0FVeuWxNLj9lEyblsFYT BgmfEzoedB81ob+MNDNXOquWDoR3OBhCjM9nOsXSvxS8jXWTeIvfNfbUslgblKNCxw Wf9Q/igVVZedwmLRGG+4OWEBWHXAtDyoD38K9pUg= From: "carlosgalvezp at gmail dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: carlosgalvezp at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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 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=3D54978&action=3Dedit 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=3D0x7fffffffd690, this_fde=3D0x0, pc=3D0x404248 ) 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=3D0x7fffffffd690, this_fde=3D0x0, pc=3D0x404248 ) at ../../../gcc/libgcc/unwind-dw2-fde.c:969 #1 0x00007ffff77c1e11 in find_fde_tail (dbase=3D18446744073709383432, bases=3D0x7fffffffd8e8, hdr=3D0x4aaa34, pc=3D4211272) at ../../../gcc/libgcc/unwind-dw2-fde-dip.c:519 #2 _Unwind_Find_FDE (pc=3D, bases=3Dbases@entry=3D0x7ffffff= fd8e8) at ../../../gcc/libgcc/unwind-dw2-fde-dip.c:573 #3 0x00007ffff77bd4aa in uw_frame_state_for (context=3D0x7fffffffd840, fs=3D0x7fffffffd930) at ../../../gcc/libgcc/unwind-dw2.c:1005 #4 0x00007ffff77beefd in _Unwind_RaiseException (exc=3D0xcfc390) 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-instal= led libraries, it runs fine. Thank you for your time!=