public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "eggert at cs dot ucla.edu" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug time/30701] New: getutxent misbehaves on 32-bit x86 when _TIME_BITS=64
Date: Sun, 30 Jul 2023 20:07:29 +0000	[thread overview]
Message-ID: <bug-30701-131@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=30701

            Bug ID: 30701
           Summary: getutxent misbehaves on 32-bit x86 when _TIME_BITS=64
           Product: glibc
           Version: 2.37
            Status: NEW
          Severity: normal
          Priority: P2
         Component: time
          Assignee: unassigned at sourceware dot org
          Reporter: eggert at cs dot ucla.edu
  Target Milestone: ---

Created attachment 15024
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15024&action=edit
Source code illustrating the bug, when compiled with -m32

A user ran into this problem with Coreutils 'who'.[1] Although we have a
workaround in Gnulib[2] it's hacky as it delves into glibc internals.

This bug is distinct from glibc bug 28146 because it occurs now, not in the
year 2038.

Compile and run the attached program on Fedora 38 with 'gcc -m32 badutmpx.c;
./a.out'. I see output lines like this:

user=reboot id=~~ line=~ pid=0 type=2 tv=2385233251778666.000000

The timestamp is wrong, and the line should look like this:

user=reboot id=~~ line=~ pid=0 type=2 tv=1689108586.555355

The problem is that getutmpx is not converting the external format in
/var/run/utmp with 32-bit timestamps to in-memory format, where time_t is 64
bits not 32.

[1]: https://bugs.gnu.org/64937
[2]: https://lists.gnu.org/r/bug-gnulib/2023-07/msg00159.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2023-07-30 20:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-30 20:07 eggert at cs dot ucla.edu [this message]
2023-07-31  6:42 ` [Bug time/30701] " bruno at clisp dot org
2023-07-31  9:49 ` sam at gentoo dot org
2023-08-01  9:10 ` aurelien at aurel32 dot net
2023-08-01 14:19 ` jwilk at jwilk dot net
2023-08-05 18:27 ` eggert at cs dot ucla.edu
2023-08-14 13:12 ` bruno at clisp dot org
2023-08-14 13:20 ` bruno at clisp dot org
2024-04-09  7:17 ` fweimer at redhat dot com
2024-04-15 11:52 ` fweimer at redhat dot com
2024-05-03  7:29 ` fweimer at redhat dot com
2024-05-03  7:29 ` fweimer at redhat dot com
2024-05-06 22:54 ` lksfbdij at 10mail dot org
2024-05-06 23:36 ` fweimer at redhat dot com

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=bug-30701-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@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).