public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug time/30701] New: getutxent misbehaves on 32-bit x86 when _TIME_BITS=64
@ 2023-07-30 20:07 eggert at cs dot ucla.edu
  2023-07-31  6:42 ` [Bug time/30701] " bruno at clisp dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: eggert at cs dot ucla.edu @ 2023-07-30 20:07 UTC (permalink / raw)
  To: glibc-bugs

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.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-05-06 23:36 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-30 20:07 [Bug time/30701] New: getutxent misbehaves on 32-bit x86 when _TIME_BITS=64 eggert at cs dot ucla.edu
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

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).