public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@redhat.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	libc-alpha@sourceware.org
Subject: Re: [PATCH] Add RTLD_RELOAD to dlopen
Date: Thu, 20 Jul 2017 19:31:00 -0000	[thread overview]
Message-ID: <169b9578-5546-2b44-1b5c-94e9215efc24@redhat.com> (raw)
In-Reply-To: <20170720191517.xah6rggoaeqgbokf@var.youpi.perso.aquilenet.fr>

On 07/20/2017 03:15 PM, Samuel Thibault wrote:
> Hello,
> 
> In our parallel programming projects, we would like to load some DSO
> several times within the same process, because we want to share the
> addresse space for passing data pointers between parallel executions,
> and the DSO has global variables and such which we want to see
> duplicated.
> 
> Unfortunately, dlopen() does not re-load the DSO when it is already
> loaded. One workaround is to cp the file under another name, but that's
> ugly and does not share the memory pages.
> 
> The patch proposed here simply adds an RTLD_RELOAD flag which disables
> checking for the DSO being already loaded, thus always loading the DSO
> again. There is no actual code modification, only the addition of two
> if()s and reindent.
 
This is what Solaris designed dlmopen() for, is there any reason you
can't use dlmopen()?

I have a branch with fixes for dlmopen() which finish implementing the
missing pieces that we need e.g. carlos/dlmopen.

I strongly suggest dlmopen() as the way to solve this problem, particularly
since dlmopen() offers much stronger isolation, and ensures that the globals
get the correct binding and don't escape the namespace and accidentally
resolve to the first definition by the first opened library.

-- 
Cheers,
Carlos.

  reply	other threads:[~2017-07-20 19:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-20 19:15 Samuel Thibault
2017-07-20 19:31 ` Carlos O'Donell [this message]
2017-07-20 19:34   ` Samuel Thibault
2017-07-20 20:03     ` Carlos O'Donell
2017-07-20 20:19       ` Samuel Thibault
2017-07-20 20:26         ` Samuel Thibault
2017-07-20 20:31       ` Samuel Thibault
2017-07-23 10:17 ` Florian Weimer
2017-08-03 14:37 ` Samuel Thibault
2017-08-03 17:26   ` Florian Weimer
2017-08-03 19:57     ` Carlos O'Donell

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=169b9578-5546-2b44-1b5c-94e9215efc24@redhat.com \
    --to=carlos@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=samuel.thibault@ens-lyon.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).