mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Mayer <mmayer@broadcom.com>
To: Musl Mailing List <musl@lists.openwall.com>
Cc: Colin Cross <ccross@google.com>
Subject: Re: [musl] [PATCH 0/1] ldso: continue searching if wrong architecture is found
Date: Tue, 2 Apr 2024 13:59:47 -0700	[thread overview]
Message-ID: <CAGt4E5sYcwr2mawhFVHdOYstBieTN45KRQ30S9suqxDbxjc37w@mail.gmail.com> (raw)
In-Reply-To: <CAMbhsRTaOwWuFss_ncpOnphQ1--8OT5H9=w-4e07gFcZhi4uug@mail.gmail.com>

On Wed, 7 Feb 2024 at 10:09, Colin Cross <ccross@google.com> wrote:
>
> On Tue, Feb 6, 2024 at 5:23 PM Markus Mayer <mmayer@broadcom.com> wrote:
[...]
> > The problem:
> >
> > If LD_LIBRARY_PATH is set to a directory containing 32-bit libraries and
> > then a 64-bit binary is invoked, the shared library loader will pick up
> > the 32-bit version of a library first, because it'll look at
> > LD_LIBRARY_PATH before anything else. Mapping the 32-bit library into
> > the 64-bit process will fail. This much is expected.
> >
> > However, even though the correct library resides on the system, the
> > shared library loader never attempts to look for it. The 64-bit process
> > will fail to launch, even though there is no reason for the failure. The
> > problem only exists, because the shared library launcher doesn't look in
> > the remaining shared library directories.
> >
[...]
> > Continuing to search the system directories does seem to be the right
> > thing to do under the circumstances described here. Also, it is what
> > glibc does.
[...]
>
> There is a previous discussion of the same issue at
> https://www.openwall.com/lists/musl/2023/02/07/3.

Thanks, Colin, for pointing this out. This was very helpful.

We have been able to determine that Colin's patch series from February
2023 does address our issue. If I apply Colin's patches, the shared
library loader will continue searching for a shared library match
after unsuccessfully trying to load a 32-bit library into a 64-bit
process. This behaviour is just what one would expect. Consequently,
launching a 64-bit binary no longer fails just because the shared
library loader happens to find the 32-bit version of a library it
needs first.

In light of this, does it make sense to revive Colin's series from
last year and reconsider it for inclusion? If there is anything I can
do to facilitate the process, please let me know. I can certainly help
with testing.

If Colin's series is somehow not acceptable, please let me know as
well, and I will see what I can come up with to resolve the issue.

Thanks,
-Markus

      reply	other threads:[~2024-04-02 21:00 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
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 [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=CAGt4E5sYcwr2mawhFVHdOYstBieTN45KRQ30S9suqxDbxjc37w@mail.gmail.com \
    --to=mmayer@broadcom.com \
    --cc=ccross@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).