From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E87353858D35; Sun, 30 Jul 2023 20:07:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E87353858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690747649; bh=xvtTTQt0vLVFVGV4epBKMtLGxAUwCfXO/ob4mg7ZOdg=; h=From:To:Subject:Date:From; b=Kf2mS1EqEUzxltKX9aXrLlFQIFqqngzVYQCuOAGMcL9IPkH3RU39kkarFtLoiGm8E /kCXANSJFIHC26oZOcLPTAVc4RHbK3DNPra63pPxW4ShdImDpAVbwMUjMguGfS8xUN cDbfbPWgrV6eTIpw2dPAdlN3VhM50AhR1Ys7x/Yg= From: "eggert at cs dot ucla.edu" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: time X-Bugzilla-Version: 2.37 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: eggert at cs dot ucla.edu X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30701 Bug ID: 30701 Summary: getutxent misbehaves on 32-bit x86 when _TIME_BITS=3D64 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=3D15024&action=3Ded= it 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=3Dreboot id=3D~~ line=3D~ pid=3D0 type=3D2 tv=3D2385233251778666.000000 The timestamp is wrong, and the line should look like this: user=3Dreboot id=3D~~ line=3D~ pid=3D0 type=3D2 tv=3D1689108586.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 --=20 You are receiving this mail because: You are on the CC list for the bug.=