mailing list of musl libc
 help / color / mirror / code / Atom feed
From: enh <enh@google.com>
To: musl@lists.openwall.com
Subject: Re: [musl] [PATCH 0/1] ldso: continue searching if wrong architecture is found
Date: Wed, 7 Feb 2024 08:45:19 -0800	[thread overview]
Message-ID: <CAJgzZoo2bp6gb_axnPe=Dmsn8UsvBAdZQk4saLHE=NP4b+M5pQ@mail.gmail.com> (raw)
In-Reply-To: <ZcM+twzp0WHa8EmL@localhost>

On Wed, Feb 7, 2024 at 12:29 AM <i262jq@0w.se> wrote:
>
> On Tue, Feb 06, 2024 at 05:22:42PM -0800, Markus Mayer wrote:
> > script of the app will set LD_LIBRARY_PATH to the directory containing
> [...]
> > What we have discovered is that 64-bit applications launched by the
> > 32-bit app will fail due to a shared library mismatch. The 32-bit app
>
> This is a known problem with the LD_LIBRARY_PATH semantics.
>
> > The solution:
> >
> > The shared library loader needs to keep searching the rest of the
> > library search path if the library it found in LD_LIBRARY_PATH could not
> > be mapped. If the library loader does this, everything will work fine as
> > long as the library resides on the system in a well known path.
>
> This would possibly solve your particular case, but not the main trouble
> inherent in LD_LIBRARY_PATH (a child process mapping an unexpected
> library instance).
>
> A well working solution is to wrap each application binary in a starter
> which explicitly runs the dynamic loader with the argument
>  --library-path <where the libraries are>
> (then the path to the application binary and the arguments, of course)
>
> This solves the problems reliably and is well proven.

(in particular: this is the way Android went... we originally did
support just ignoring invalid entries on the path, but that was
confusing and error-prone so we switched to a clear "your library path
is wrong for this binary" error. surprisingly [to me] it was also
helpful in catching cases where people had libraries for the wrong
_architecture_, not just the wrong bitness. "with enough users, all
errors are common" :-) )

> My 2c
> /i262jq

  reply	other threads:[~2024-02-07 16:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07  1:22 Markus Mayer
2024-02-07  1:22 ` [musl] [PATCH 1/1] ldso: continue searching if wrong architecture is found first Markus Mayer
2024-02-07 17:30   ` Rich Felker
2024-02-07 19:10     ` i262jq
2024-02-07 19:51       ` Thorsten Glaser
2024-02-08 15:52         ` i262jq
2024-02-07 20:59     ` Markus Mayer
2024-02-07  8:26 ` [musl] [PATCH 0/1] ldso: continue searching if wrong architecture is found i262jq
2024-02-07 16:45   ` enh [this message]
2024-02-07 17:07     ` Thorsten Glaser
2024-02-07 17:54       ` enh
2024-02-07 18:09 ` Colin Cross
2024-04-02 20:59   ` Markus Mayer

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='CAJgzZoo2bp6gb_axnPe=Dmsn8UsvBAdZQk4saLHE=NP4b+M5pQ@mail.gmail.com' \
    --to=enh@google.com \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).