public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "woodard at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgcc/109054] _Unwind_GetLanguageSpecificData should have protected visibility
Date: Tue, 07 Mar 2023 17:42:43 +0000	[thread overview]
Message-ID: <bug-109054-4-Dzstp4YECR@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109054-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Ben Woodard <woodard at redhat dot com> ---
Actually what we were hoping to achieve was not to substitute another version
of _Unwind_GetLanguageSpecificData for the one that is in libgcc_s.so but
rather to make it so that that another implementation of the function couldn't
replace the specialized one that is currently in libgcc_s.so

The problem that I ran into was that a library that an application was using
libzmq from zeromq had a dependency on libunwind. Because of the loading order,
this libunwind was loaded before libgcc_s.so and so the dynamic loader found
the _Unwind_GetLanguageSpecificData in libunwind before it looked in
libgcc_s.so this broke C++ exception handling.

What I was hoping could be done is that libgcc_s.so could be forced to ALWAYS
use its own version of _Unwind_GetLanguageSpecificData rather than one found in
another library like libunwind.

Regarding: "Though, I wonder how can unwinding work properly even if we did
that.
Because e.g. libstdc++.so.6 (or libsupc++.a) C++ EH personality routine calls
various _Unwind_* APIs too, including _Unwind_GetLanguageSpecificData,
_Unwind_GetGR, _Unwind_GetIP*, _Unwind_GetRegionStart, so if it gets some
subset of those symbols from a different unwinder, it can't work correctly."

I can authoritatively state that it doesn't work at least on RHEL8 on ppc64le.

Maybe making it "protected" visibility is the wrong solution. If there is a way
to make it so that libsupc++ or libstdc++'s C++ EH personality routine could be
made to only call its own routines rather than ones coming from a different
library that would resolve the problem that we have run into. Is there another
way to make this happen since all these functions need to be used together as a
cohort and cannot be mixed and matched.

  parent reply	other threads:[~2023-03-07 17:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 15:39 [Bug libgcc/109054] New: " woodard at redhat dot com
2023-03-07 15:53 ` [Bug libgcc/109054] " jakub at gcc dot gnu.org
2023-03-07 16:16 ` jakub at gcc dot gnu.org
2023-03-07 17:42 ` woodard at redhat dot com [this message]
2023-03-07 17:49 ` jakub at gcc dot gnu.org
2023-03-07 17:58 ` woodard at redhat dot com

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-109054-4-Dzstp4YECR@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).