public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "fweimer at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug malloc/25533] dlopen with RTLD_DEEPBIND crashes when using custom memory manager
Date: Mon, 06 Mar 2023 15:52:38 +0000	[thread overview]
Message-ID: <bug-25533-131-uvOeA6z9fd@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-25533-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=25533

--- Comment #8 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Simon Richter from comment #7)
> Rereading the documentation of RTLD_DEEPBIND, I'm even slightly confused why
> applying RTLD_DEEPBIND to an object will also pull the symbols of its
> dependencies to the front (so glibc's "realloc" wins over libtbbmalloc's, as
> libudev is only linked against glibc). I would have expected libudev's
> symbols to take precedence for internal resolution, and then the same order
> as in the rest of the program for the other symbols.

We discussed this during today's patch review call. The issue here is that some
(many?) uses of RTLD_DEEPBIND depend on this altered symbol resolution
behavior: the newly loaded object is supposed to bind against the symbols of
its dependencies as if there was nothing else in the process image, to avoid
unwanted preemption. In some cases, this is even done to prevent preemption
coming from LD_PRELOAD. For malloc, this is pretty much never going to work,
but it might be exactly what's needed for other libc symbols. It's hard to tell
where to draw the line.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

      parent reply	other threads:[~2023-03-06 15:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-25533-131@http.sourceware.org/bugzilla/>
2021-07-05 14:04 ` Simon.Richter at hogyros dot de
2021-07-05 14:10 ` fweimer at redhat dot com
2021-07-05 14:50 ` Simon.Richter at hogyros dot de
2023-02-28 19:52 ` parky at outlook dot com
2023-03-06 15:52 ` fweimer at redhat dot com [this message]

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-25533-131-uvOeA6z9fd@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.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).