From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14124 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general,gmane.comp.gnu.coreutils.general Subject: Re: date-debug test failure with musl Date: Mon, 13 May 2019 14:23:39 -0400 Message-ID: <20190513182339.GR23599@brightrain.aerifal.cx> References: <87929f3b-ce4d-cd2d-0baf-dfae49fee58e@nh2.me> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="267901"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.5.21 (2010-09-15) Cc: coreutils@gnu.org, mjbauer95@gmail.com, musl@lists.openwall.com To: Niklas =?utf-8?Q?Hamb=C3=BCchen?= Original-X-From: musl-return-14140-gllmg-musl=m.gmane.org@lists.openwall.com Mon May 13 20:24:01 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1hQFcG-0017al-Jt for gllmg-musl@m.gmane.org; Mon, 13 May 2019 20:24:00 +0200 Original-Received: (qmail 29833 invoked by uid 550); 13 May 2019 18:23:57 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 29802 invoked from network); 13 May 2019 18:23:56 -0000 Content-Disposition: inline In-Reply-To: <87929f3b-ce4d-cd2d-0baf-dfae49fee58e@nh2.me> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:14124 gmane.comp.gnu.coreutils.general:9144 Archived-At: On Mon, May 13, 2019 at 05:02:48AM +0200, Niklas Hambüchen wrote: > Dear coreutils maintainers, > > when compiling coreutils commit 6e97d36 against musl v1.1.22 on Ubuntu, I get a test failure and differing output than when using glibc. > > Running `src/date --debug -d 'TZ="America/Edmonton" 2006-04-02 02:30:00'` with each: > > With glibc it prints: > > date: normalized time: '(Y-M-D) 2006-04-02 03:30:00' > > With musl it prints: > > date: normalized time: '(Y-M-D) 2006-04-02 01:30:00'` > > This difference results in tests/misc/date-debug to fail. > > What's happening here? Is there a bug in musl, or some quirks going on? > Any insight would be appreciated. The requested time is right in the middle of the "leap forward" DST transition; no such time exists. As I understand, it's been requested from mktime with tm_isdst<0 to "cause mktime() to attempt to determine whether Daylight Savings Time is in effect for the specified time." The standard provides no definition for "attempt" or what should happen if such an attempt fails due to ambiguity or nonexistence, and I don't see any fundamental reason to prefer the glibc or musl result here. One is more natural working backwards from 3am; the other is more natural working forwards from 1:59:59am. As long as coreutils' date is producing the desired "invalid" error either way, which it seems to be, I think it's a mistake that the debug output for "normalized time" is being compared as part of the test assertion. Only the result should matter, not the path by which it's reached. Rich