mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Alexander Scherbatiy <alexander.scherbatiy@bell-sw.com>
To: Rich Felker <dalias@libc.org>
Cc: musl@lists.openwall.com
Subject: Re: [musl] musl libc version
Date: Wed, 27 May 2020 19:31:38 +0300	[thread overview]
Message-ID: <51927e73-f02d-4cbb-13b1-65ac86c18ade@bell-sw.com> (raw)
In-Reply-To: <20200527155735.GU1079@brightrain.aerifal.cx>

On 27.05.2020 18:57, Rich Felker wrote:

> On Wed, May 27, 2020 at 06:44:38PM +0300, Alexander Scherbatiy wrote:
>> Hello,
>>
>> Using glibc it is possible to get GNU C library version using
>> confstr() function and _CS_GNU_LIBC_VERSION constant.
>>
>> In musl the confstr() returns EINVAL for _CS_GNU_LIBC_VERSION.
>> Is there a way to get libc version in musl?
> Can you describe what you're trying to achieve with a version number?
  It is used mostly for logging purposes.
  For example the JVM crash dump [1] prints libc version as "unknown 
unknown".
  This is because the confstr is used in os_linux.cpp [2]

   It would be nice to know from a crash dump was JDK linked with glibc 
or musl in Alpine Linux and which version of musl has been used.

[1] https://bugs.openjdk.java.net/secure/attachment/87289/hs_err_pid5502.log
[2] 
https://hg.openjdk.java.net/portola/portola/file/7ff60204a181/src/hotspot/os/linux/os_linux.cpp#l607

  Thanks,
  Alexander.

> musl specifically doesn't publish version numbers via macros or
> runtime interfaces because they're a poor proxy for checking for the
> particular feature/property/whatever you care about. For instance,
> distros may backport the thing you want to an older version, and even
> if not, you end up hard-coding knowledge about particular libcs that
> quickly bitrots rather than making something robust and future-proof.
>
> With that said, ability to test for some things is presently
> inadequate, and there's a proposal I've made (based on previous
> discussions with others) on libc-coord to improve this in a cross-libc
> manner:
>
> https://www.openwall.com/lists/libc-coord/2020/04/22/1
>
> If you have input into what kinds of things you need to be able to
> test for it would be very helpful.
>
> Rich

  reply	other threads:[~2020-05-27 16:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27 15:44 Alexander Scherbatiy
2020-05-27 15:57 ` Rich Felker
2020-05-27 16:31   ` Alexander Scherbatiy [this message]
2020-05-27 18:28   ` Dmitry Samersoff

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=51927e73-f02d-4cbb-13b1-65ac86c18ade@bell-sw.com \
    --to=alexander.scherbatiy@bell-sw.com \
    --cc=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).