From: Paul Eggert <eggert@cs.ucla.edu>
To: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>,
libc-alpha <libc-alpha@sourceware.org>,
Bruno Haible <bruno@clisp.org>, Thorsten Kukuk <kukuk@suse.com>
Subject: Re: utmp 64 bit time_t support
Date: Fri, 4 Aug 2023 00:00:15 -0700 [thread overview]
Message-ID: <c372beb0-153b-f3c0-4b78-ed7f966a78c3@cs.ucla.edu> (raw)
In-Reply-To: <ca8064d9-d7bc-b5b8-cce8-bc2259d56526@linaro.org>
On 2023-08-01 13:28, Adhemerval Zanella Netto via Libc-alpha wrote:
> The gnulib developers has reported that the lack of 64-bit support on utmp
> records has created some real issues [1]. This issue is problematic because
> now some 32-bit architectures when built with 64-bit time_t support have
> a different utmp struct size, which essentially breaks __WORDSIZE_TIME64_COMPAT32
> support. The simple straightforward fix would to make utmp/utmpx always 32-bit
> for theses architecture (mips, mips64n32, riscv32, sparcv9, and i686) but this
> would be an ABI break.
Isn't there a less-simple but still reasonably-straightforward fix that
wouldn't break the ABI? On these traditionally-32-bit time_t platforms
when _TIME_BITS=64, do what Gnulib is doing[8], namely, convert from
file format to internal format while reading the utmp data.
Obviously this Gnulib hack won't work after the year 2038, but it's
still a win because struct utmpx doesn't work today. That is, with
current glibc, utmpx-using programs fail today if compiled with
_TIME_BITS=64 on 32-bit platforms. This is why I filed glibc bug 30701.
I suspect this bug will need to be fixed regardless of whether utmpx
becomes deprecated in the next glibc release.
> [1] https://sourceware.org/bugzilla/show_bug.cgi?id=30701
> [2] https://github.com/thkukuk/utmpx/blob/main/Y2038.md
> [3] https://sourceware.org/bugzilla/show_bug.cgi?id=28146
> [4] https://sourceware.org/bugzilla/show_bug.cgi?id=17470
> [5] https://sourceware.org/bugzilla/show_bug.cgi?id=24492
> [6] https://sourceware.org/pipermail/libc-alpha/2020-July/116742.html
> [7] https://sourceware.org/pipermail/libc-alpha/2020-July/116764.html
[8]: https://lists.gnu.org/r/bug-gnulib/2023-07/msg00159.html
next prev parent reply other threads:[~2023-08-04 7:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 20:28 Adhemerval Zanella Netto
2023-08-01 20:46 ` Thorsten Kukuk
2023-08-04 7:00 ` Paul Eggert [this message]
2023-08-04 7:28 ` Andreas Schwab
2023-08-05 18:22 ` Paul Eggert
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=c372beb0-153b-f3c0-4b78-ed7f966a78c3@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=adhemerval.zanella@linaro.org \
--cc=bruno@clisp.org \
--cc=kukuk@suse.com \
--cc=libc-alpha@sourceware.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).