public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>,
	Libc-help <libc-help@sourceware.org>
Subject: Re: inode-based dlopen caching
Date: Tue, 8 Jun 2021 14:19:28 -0300	[thread overview]
Message-ID: <0242da65-0563-d03d-2ba7-5318c2a6c010@linaro.org> (raw)
In-Reply-To: <87zgw09tww.fsf@oldenburg.str.redhat.com>



On 08/06/2021 13:56, Florian Weimer via Libc-help wrote:
> * Soni L. via Libc-help:
> 
>> Currently dlopen caching is based on filenames, it'd be nice if it was
>> based on inodes to support better "re"loading (aka loading a new module
>> with the same name because unloading modules with threads is never a
>> good idea). This is good for stuff that deals with plugins.
> 
> It's an interesting idea.  We'd probably also want a flag that hides the
> symbols from general binding and makes them available for direct dlsym
> lookups using the handle returned by dlopen (otherwise the old
> definitions stick around).
> 
> The tricky question is what to do about dependencies.  A behavioral
> change for just one level is not too hard, but everything goes further
> is difficult.
> 
> Vivek Das Mohapatra's RTLD_SHARED patches may help with isolating
> dependencies.

The RTLD_SHARED with the -Wl,-z,unique might help with the dependency,
but it would require the caller to proper setup the linker flag on
the specific shared libraries.

But my main reservation with this is the idea of reload the new module
is, although the symbol resolution is a different namespace, it still
share the same process resources.  It would require a lot of careful
code within the library so it can run with multiple instances, we see
the potential issues with our static dlopen support.

  reply	other threads:[~2021-06-08 17:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-05 13:59 Soni L.
2021-06-07 21:53 ` Adhemerval Zanella
2021-06-07 22:50   ` Soni L.
2021-06-08 13:14     ` Adhemerval Zanella
2021-06-08 16:26       ` Soni L.
2021-06-08 16:51         ` Adhemerval Zanella
2021-06-08 16:56 ` Florian Weimer
2021-06-08 17:19   ` Adhemerval Zanella [this message]
2021-06-08 17:20     ` Florian Weimer
2021-06-08 18:10       ` Soni L.
2021-06-08 18:17         ` Florian Weimer
2021-06-08 19:25           ` Adhemerval Zanella

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=0242da65-0563-d03d-2ba7-5318c2a6c010@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=libc-help@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).