mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [musl] friendly errors for ABI mismatch
Date: Mon, 27 Jul 2020 12:03:30 -0400	[thread overview]
Message-ID: <20200727160326.GN6949@brightrain.aerifal.cx> (raw)
In-Reply-To: <1667998.jfqktxE8f0@localhost>

On Mon, Jul 27, 2020 at 09:27:28AM -0600, Ariadne Conill wrote:
> Hello,
> 
> On 32-bit systems, musl 1.2 has a new ABI (due to time64).  This results in 
> programs built against musl 1.2 failing to run against musl 1.1.  That part is 
> fine, but you get an error message about being unable to relocate symbols, 
> which is not really insightful if you don't know about the ABI break.
> 
> glibc, on the other hand, has a minimum version specified in every binary, and 
> prints an error message saying the glibc is too old if this situation is 
> encountered.
> 
> I think we should add this feature to musl, so that in the future if we have 
> another ABI break, users will be given useful advice about how to fix it.  Due 
> to the relocation error message, a few Alpine contributors have been tripped 
> up while trying to debug their work...

What you're seeing here is just a special case of the general property
that, if you've linked to a version of libc (or any library) that has
a new symbol and attempt to run with an older version, you'll get a
missing symbol error. It's very intentional (see libc comparison and
"forward compatibility") that we don't encode "minimum version number"
required anywhere. If you attempt to run with a library that has all
the symbols, it will run, subject to any bugs in the library version
you have and any functionality that returns with failure because it's
not supported in the version you have, etc.

There is no way to give a more high-level reason for the runtime link
failure like "your program needs time64 and you're running with an old
musl" because the code reporting the error *is the old musl* that's
not aware of whatever it is that the new binary is missing. Maybe you
have something else in mind that I don't fully understand, but
whatever it is it would only address future missing symbol errors, not
the ones you're seeing right now.

In regards to Alpine, I get this kind of error *all the time* with all
sorts of non-libc libraries while using edge. It's a consequence of
the package management system not encoding a dependency on the version
of the library package it was built against, which can be a good thing
(see "forwards compatibility" above -- it avoids the need to
unnecessarily upgrade a library package just because the system the
dependent package was built on happened to have a newer version
installed) but inherently leads to this sort of issue. Even if we
could "fix" it in libc somehow, it would still happen all over the
place with other libraries.

Rich

  reply	other threads:[~2020-07-27 16:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-27 15:27 Ariadne Conill
2020-07-27 16:03 ` Rich Felker [this message]
2020-07-27 20:54   ` A. Wilcox
2020-07-27 20:57   ` Ariadne Conill
2020-07-27 21:50     ` Rich Felker
2020-07-28  8:40       ` Florian Weimer
2020-07-29  1:16         ` Rich Felker
2020-07-27 21:16 ` Florian Weimer

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=20200727160326.GN6949@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --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).