[Ntp] Antw: Re: Leap second draft

"Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de> Mon, 27 January 2020 07:37 UTC

Return-Path: <Ulrich.Windl@rz.uni-regensburg.de>
X-Original-To: ntp@ietfa.amsl.com
Delivered-To: ntp@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 74566120104 for <ntp@ietfa.amsl.com>; Sun, 26 Jan 2020 23:37:36 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.199
X-Spam-Level:
X-Spam-Status: No, score=-4.199 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D0Gu9SX0jzm9 for <ntp@ietfa.amsl.com>; Sun, 26 Jan 2020 23:37:34 -0800 (PST)
Received: from mx4.uni-regensburg.de (mx4.uni-regensburg.de [194.94.157.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 911A2120125 for <ntp@ietf.org>; Sun, 26 Jan 2020 23:37:34 -0800 (PST)
Received: from mx4.uni-regensburg.de (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id E175F6000058 for <ntp@ietf.org>; Mon, 27 Jan 2020 08:37:32 +0100 (CET)
Received: from gwsmtp.uni-regensburg.de (gwsmtp1.uni-regensburg.de [132.199.5.51]) by mx4.uni-regensburg.de (Postfix) with ESMTP id C55B86000055 for <ntp@ietf.org>; Mon, 27 Jan 2020 08:37:32 +0100 (CET)
Received: from uni-regensburg-smtp1-MTA by gwsmtp.uni-regensburg.de with Novell_GroupWise; Mon, 27 Jan 2020 08:37:32 +0100
Message-Id: <5E2E933A020000A10003697D@gwsmtp.uni-regensburg.de>
X-Mailer: Novell GroupWise Internet Agent 18.2.0
Date: Mon, 27 Jan 2020 08:37:30 +0100
From: Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
To: imp@bsdimp.com, paf@frobbit.se
Cc: Daniel Franke <dfoxfranke@gmail.com>, watsonbladd@gmail.com, "ntp@ietf.org" <ntp@ietf.org>
References: <CAJm83bD5Ozkpg5TpkogOW6xeeNQL3ZziLO9URM7haqN8Wrp=Wg@mail.gmail.com> <CACsn0cmZkRifrnbVbPw2=9ww+ttmbAGCW39LhT+jhDLLyU8e+A@mail.gmail.com> <CANCZdfo_cbo3UngOWEc4mM4_nLK=J81zSiF0shvsu5mENUGPMw@mail.gmail.com> <CANCZdfo-OW7d454Qqo9eqfOpw367A4gg4-2UJ5XdC=n0u_t+BQ@mail.gmail.com> <F7D6BF99-260C-467B-9AF7-94F1F5E2721B@frobbit.se> <CANCZdfoh0dTDLeJtJHaVtdSnpTc-jzc+nSUk2qDzrFcGr7=zfg@mail.gmail.com> <01C94076-A916-42F8-8BA7-8AE8C4AB71D2@frobbit.se> <CANCZdfqDqYdP+Z9ais3puWqoKJz0DbjmUCPn5gkSYNo=VX-Meg@mail.gmail.com>
In-Reply-To: <CANCZdfqDqYdP+Z9ais3puWqoKJz0DbjmUCPn5gkSYNo=VX-Meg@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/8JkK64-61i4eKBBX2MDIYETY91Y>
Subject: [Ntp] Antw: Re: Leap second draft
X-BeenThere: ntp@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <ntp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ntp>, <mailto:ntp-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ntp/>
List-Post: <mailto:ntp@ietf.org>
List-Help: <mailto:ntp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ntp>, <mailto:ntp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Jan 2020 07:37:36 -0000

>>> Warner Losh <imp@bsdimp.com> schrieb am 24.01.2020 um 16:42 in Nachricht
<CANCZdfqDqYdP+Z9ais3puWqoKJz0DbjmUCPn5gkSYNo=VX-Meg@mail.gmail.com>:
> On Fri, Jan 24, 2020 at 7:45 AM Patrik Fältström <paf@frobbit.se> wrote:
> 
>> On 24 Jan 2020, at 15:12, Warner Losh wrote:
>>
>> > No. That is wrong. The numbering of the leap second is undefined. This
>> is one way to resolve the issue, but it is not the only way. You will not
>> find this specified, except indirectly via math on the struct tm, which
>> isn't definitive about what to do during the leap.
>>
>> What I see are two things. First the math:
>>
>> > If the year is <1970 or the value is negative, the relationship is
>> undefined. If the year is >=1970 and the value is non-negative, the value
>> is related to a Coordinated Universal Time name according to the
C-language
>> expression, where tm_sec, tm_min, tm_hour, tm_yday, and tm_year are all
>> integer types:
>> >
>> > tm_sec + tm_min*60 + tm_hour*3600 + tm_yday*86400 +
>> >     (tm_year-70)*31536000 + ((tm_year-69)/4)*86400 -
>> >     ((tm_year-1)/100)*86400 + ((tm_year+299)/400)*86400
>>
>> Then the definition of tm_sec which can have values [0,61].
>>
>> So far, so good, and the number of seconds in a day with an added leap
>> second will then be 86401, and the first second of the following day (the
>> following second) will have the same value.
>>
>> Where I agree with you that the leap second is undefined is the plain text
>> which says:
>>
>> > As represented in seconds since the Epoch, each and every day shall be
>> accounted for by exactly 86400 seconds.
>>
>> This implies that even if the math gives 86401 seconds (including the fact
>> tm_sec can have a value of 61), the value 86401 seconds in a day is not
>> valid.
>>
> 
> Yes. It's ambiguous. A POSIX time_t is not defined at the leap second. You
> could use your math to get one answer. However, that answer, back
> translated to a struct tm gives the wrong day, so is also incorrect. In
> POSIX land, leap seconds don't exist, and any definitive statement about
> the 'proper' time_t encoding for a leap second cannot be made. It's
> undefined.

I think that is the major bug in POSIX leap seconds: While time_t is the
internal representation of time, struct tm is only the human-readable
representation. Leap seconds were based on the human representation (61st
second in minute), while most software works with the internal representation.
So converting between both representations is not unique.


> 
> Warner