mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: "Niklas Hambüchen" <mail@nh2.me>
Cc: coreutils@gnu.org, mjbauer95@gmail.com, musl@lists.openwall.com
Subject: Re: date-debug test failure with musl
Date: Mon, 13 May 2019 14:23:39 -0400	[thread overview]
Message-ID: <20190513182339.GR23599@brightrain.aerifal.cx> (raw)
In-Reply-To: <87929f3b-ce4d-cd2d-0baf-dfae49fee58e@nh2.me>

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


       reply	other threads:[~2019-05-13 18:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87929f3b-ce4d-cd2d-0baf-dfae49fee58e@nh2.me>
2019-05-13 18:23 ` Rich Felker [this message]
2019-05-13 22:49   ` Assaf Gordon
     [not found]     ` <98551500-3d6a-d123-d1d4-a47a0c6619e1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-05-14 13:38       ` [musl] " Niklas Hambüchen
     [not found]         ` <26965951-d4f2-ae57-2b7e-b307fc39d60f-7wQd5C9ZzNw@public.gmane.org>
2019-05-16 17:52           ` Niklas Hambüchen
2019-06-13  3:35             ` Assaf Gordon
2019-06-13 12:58               ` Niklas Hambüchen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190513182339.GR23599@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=coreutils@gnu.org \
    --cc=mail@nh2.me \
    --cc=mjbauer95@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).