From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0FB2838582AC; Tue, 12 Dec 2023 05:46:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0FB2838582AC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1702359992; bh=GeyTYGSfb9c5C4FFPkN/AkaUAMSxD+7xSzrHoOTI3cs=; h=From:To:Subject:Date:From; b=Ka93Hcsp882Jh1ydub1aWacCyW+WmCXJ1Z+c2/EJ7K20FgC46AqrinsOyOWBbNolj 8gkMSJI8Bxu0cDQCvxMFXhly4H9nFZE89FQakjVmjdJe7TsBm197VzizRGFEy+64tO /B7T3YYv6WSv1ddJU8xgTrBUGvuJ0u7pQ2RiFTbs= From: "aurelien at aurel32 dot net" To: glibc-bugs@sourceware.org Subject: [Bug time/31144] New: mktime: returns clock for UTC with isdst=1 Date: Tue, 12 Dec 2023 05:46:31 +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: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: aurelien at aurel32 dot net 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_file_loc 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=3D31144 Bug ID: 31144 Summary: mktime: returns clock for UTC with isdst=3D1 Product: glibc Version: unspecified URL: http://bugs.debian.org/1057856 Status: NEW Severity: normal Priority: P2 Component: time Assignee: unassigned at sourceware dot org Reporter: aurelien at aurel32 dot net Target Milestone: --- Created attachment 15253 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D15253&action=3Ded= it Reproducer A Debian user reported a behaviour change of the mktime function affecting Erlang/OTP. When passing isdst=3D1 with an UTC timezone, a time is now retu= rned (with isdst=3D0), while in the past it returned an error. The issue has been tracked to the following commit 83859e1115269cf56d21669361d4ddbe2687831c which went into 2.37, and got backported to the 2.34, 2.35 and 2.36 branches. The C standard is not fully clear about the behaviour in that case: "A positive or 0 value for tm_isdst shall cause mktime() to presume initial= ly that Daylight Savings Time, respectively, is or is not in effect for the specified time. A negative value for tm_isdst shall cause mktime() to attem= pt to determine whether Daylight Savings Time is in effect for the specified time." However it appears that the original GNU libc behaviour before that commit matches the FreeBSD libc behaviour. The user provided a small test program to exercise the issue (see attacheme= nt): $ gcc -o check_dst check_dst.c $ TZ=3DUTC ./check_dst 0=20 tzname[0]: UTC, tzname[1]: UTC dst before: 0 dst after: 0 clock: 1217548800 $ TZ=3DUTC ./check_dst 1 tzname[0]: UTC, tzname[1]: UTC dst before: 1 dst after: 0 clock: 1217545200 --=20 You are receiving this mail because: You are on the CC list for the bug.=