From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14125 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Assaf Gordon Newsgroups: gmane.linux.lib.musl.general,gmane.comp.gnu.coreutils.general Subject: Re: Re: date-debug test failure with musl Date: Mon, 13 May 2019 16:49:52 -0600 Message-ID: <98551500-3d6a-d123-d1d4-a47a0c6619e1@gmail.com> References: <87929f3b-ce4d-cd2d-0baf-dfae49fee58e@nh2.me> <20190513182339.GR23599@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------0F4FC45BA2C9278FA0394E18" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="56135"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 Cc: coreutils@gnu.org, mjbauer95@gmail.com To: musl@lists.openwall.com, Rich Felker , =?UTF-8?Q?Niklas_Hamb=c3=bcchen?= Original-X-From: musl-return-14141-gllmg-musl=m.gmane.org@lists.openwall.com Tue May 14 00:50:11 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 1hQJlq-000EU8-SX for gllmg-musl@m.gmane.org; Tue, 14 May 2019 00:50:10 +0200 Original-Received: (qmail 1120 invoked by uid 550); 13 May 2019 22:50:08 -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 1101 invoked from network); 13 May 2019 22:50:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=vlWZd0eDlhQ3Gxbr72WVzDSRysirECc4pHH1B/KV2og=; b=UMO90slm9qpxqEyykDuBgSAfYhGVAF1Pzkb2sxpBwrGDJrqpEH2sGV5oLPtezJJLhX 4KYFKgc6axm1O6RaDXWmD1cVF+NgLiETpHIhwP2PlwTSP04+QOl5KvfLC+U7UMpL6LbY 2bsPVzCwNQUhNuNHQeZ5OG3elLp5/oKXaXg72wW0UxBljKrpFSdflMJIFyyCohYzmRJs upElGpu57qGcsGebVNN0vOJ8vPrdN2ITowALM+tjN0GtBA0U2alCf33any69lzdkJDUI jEkjqdO+2ViXl1R5Yyo5Ql4z1iKxNPOZYJJKyE+HbAJBEAVuGMKBzbDN5Bf5FPdz+Flp Bfdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=vlWZd0eDlhQ3Gxbr72WVzDSRysirECc4pHH1B/KV2og=; b=nvZg974Ypk+9zdaEkaF4EyarSDy3x8tQdLE/rRCkpFh/vdlseo5s3AklFk6i8uNCV5 mOQFjaClRAyTvUeouSLJc/9Lv5BWbsEAaZV3UWsyPQPoNHCy3RIbJ2QCTX/8ztQ4mKD+ PagUv7zOVqA2JHkxgp5a1eI4WULwfKo0s/bFB+mVgLd8/mB1BwYaEpXITGQn95/CtTWp CNhtcFYZmdG05od2jiz/yXd1QLhzh4u4wccdXXKxyFpRwVyKLC6k6ODTDtJ68IcXeeGE iAZlUP/GpOiTmpDDzA2+LkMBGVxpUHKNyASCkr1l1QoboWWbX4oB1ISRpe47eVUH0i3x Ah4A== X-Gm-Message-State: APjAAAVfpCrLt8MLQOEaJvQwS6gIeQcITafRZNjW0YtekeZcM6p5UT9F /VjV4T7J/ICLvykoW+aQR3M= X-Google-Smtp-Source: APXvYqxl3WU1my4tispOe/tr9YUusS8h8K43oXUpmr7b4Uur6txvcsPzvOgVNwkHs8QlrVppvKTNKg== X-Received: by 2002:a17:902:4101:: with SMTP id e1mr35016075pld.25.1557787795042; Mon, 13 May 2019 15:49:55 -0700 (PDT) In-Reply-To: <20190513182339.GR23599@brightrain.aerifal.cx> Content-Language: en-US Xref: news.gmane.org gmane.linux.lib.musl.general:14125 gmane.comp.gnu.coreutils.general:9145 Archived-At: This is a multi-part message in MIME format. --------------0F4FC45BA2C9278FA0394E18 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hello, On 2019-05-13 12:23 p.m., Rich Felker wrote: > 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. Thank you for the report, [...] > 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. And thank you Rich for the quick analysis. The attached patch implements your suggestion. It works on glibc, please give it a test on your Ubuntu/musl-1.1.22 system. regards, - assaf --------------0F4FC45BA2C9278FA0394E18 Content-Type: text/x-patch; name="0001-tests-avoid-false-positive-in-date-debug-test.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0001-tests-avoid-false-positive-in-date-debug-test.patch" >From 402c3646e19c199130e7a6db5238cf5908e51fb8 Mon Sep 17 00:00:00 2001 From: Assaf Gordon Date: Mon, 13 May 2019 16:37:40 -0600 Subject: [PATCH] tests: avoid false-positive in date-debug test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When debugging an invalid date due to DST switching, the intermediate 'normalized time' should not be checked - its value can differ between systems (e.g. glibc vs musl). Reported by Niklas Hambüchen in https://lists.gnu.org/r/coreutils/2019-05/msg00031.html Analyzed by Rich Felker in https://lists.gnu.org/r/coreutils/2019-05/msg00039.html * tests/misc/date-debug.sh: Replace the exact normalized time with 'XX:XX:XX' so different values would not trigger test failure. --- tests/misc/date-debug.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/misc/date-debug.sh b/tests/misc/date-debug.sh index aa47f1abb..2ce6f4ce8 100755 --- a/tests/misc/date-debug.sh +++ b/tests/misc/date-debug.sh @@ -71,7 +71,7 @@ date: input timezone: TZ="America/Edmonton" in date string date: using specified time as starting value: '02:30:00' date: error: invalid date/time value: date: user provided time: '(Y-M-D) 2006-04-02 02:30:00' -date: normalized time: '(Y-M-D) 2006-04-02 03:30:00' +date: normalized time: '(Y-M-D) 2006-04-02 XX:XX:XX' date: -- date: possible reasons: date: non-existing due to daylight-saving time; @@ -81,7 +81,14 @@ date: invalid date 'TZ="America/Edmonton" 2006-04-02 02:30:00' EOF # date should return 1 (error) for invalid date -returns_ 1 date --debug -d "$in2" >out2 2>&1 || fail=1 +returns_ 1 date --debug -d "$in2" >out2-t 2>&1 || fail=1 + +# The output line of "normalized time" can differ between systems +# (e.g. glibc vs musl) and should not be checked. +# See: https://lists.gnu.org/archive/html/coreutils/2019-05/msg00039.html +sed '/normalized time:/s/ [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/ XX:XX:XX/' \ + out2-t > out2 || framework_failure_ + compare exp2 out2 || fail=1 ## -- 2.11.0 --------------0F4FC45BA2C9278FA0394E18--