NetBSD Problem Report #46542

From christos@zoulas.com  Mon Jun  4 23:47:21 2012
Return-Path: <christos@zoulas.com>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 653B063BA27
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  4 Jun 2012 23:47:21 +0000 (UTC)
Message-Id: <20120604234719.2230E97124@rebar.astron.com>
Date: Mon,  4 Jun 2012 23:47:19 +0000 (UTC)
From: christos@zoulas.com
Reply-To: christos@zoulas.com
To: gnats-bugs@gnats.NetBSD.org
Subject: date does not work too welll far in the future.
X-Send-Pr-Version: 3.95

>Number:         46542
>Category:       lib
>Synopsis:       date does not work too welll far in the future.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kre
>State:          feedback
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 04 23:50:00 +0000 2012
>Closed-Date:    
>Last-Modified:  Sat Jul 10 13:50:01 +0000 2021
>Originator:     Christos Zoulas
>Release:        NetBSD 5.99.59
>Organization:
	Future Perfect, Inc.
>Environment:
System: NetBSD rebar.astron.com 5.99.59 NetBSD 5.99.59 (GENERIC) #7: Fri Dec 30 15:19:49 EST 2011 christos@rebar.astron.com:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
Date is too slow when referring to years in the future and does not detect
overflow.
>How-To-Repeat:
[7:41pm] 10029>date -d '1000050000 years' +%s
31558531186453268
TIME=0:05.73 CPU=100.0% (5.739u 0.000s) SWAPS=0 (0+104)pf (0i+1o) (0Kc+0Kd)
[7:41pm] 10030>date -d '10000500000 years' +%s
3599
TIME=1:12.02 CPU=99.9% (72.019u 0.000s) SWAPS=0 (0+104)pf (0i+1o) (0Kc+0Kd)
>Fix:
	Unk

>Release-Note:

>Audit-Trail:
From: "Jukka Ruohonen" <jruoho@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46542 CVS commit: src
Date: Fri, 3 Jul 2020 03:59:18 +0000

 Module Name:	src
 Committed By:	jruoho
 Date:		Fri Jul  3 03:59:18 UTC 2020

 Modified Files:
 	src/distrib/sets/lists/tests: mi
 	src/etc/mtree: NetBSD.dist.tests
 	src/tests/bin: Makefile
 Added Files:
 	src/tests/bin/date: Makefile t_date.sh

 Log Message:
 Add a check for the overflow noted in PR lib/46542.


 To generate a diff of this commit:
 cvs rdiff -u -r1.870 -r1.871 src/distrib/sets/lists/tests/mi
 cvs rdiff -u -r1.171 -r1.172 src/etc/mtree/NetBSD.dist.tests
 cvs rdiff -u -r1.3 -r1.4 src/tests/bin/Makefile
 cvs rdiff -u -r0 -r1.1 src/tests/bin/date/Makefile \
     src/tests/bin/date/t_date.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

Responsible-Changed-From-To: lib-bug-people->kre
Responsible-Changed-By: kre@NetBSD.org
Responsible-Changed-When: Thu, 29 Oct 2020 22:00:26 +0000
Responsible-Changed-Why:
I am working on a solution for this problem (which is missing
overflow, and lots more, checking in parsedate() - date is
simply one of parsedate()'s clients).


From: "Robert Elz" <kre@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46542 CVS commit: src/lib/libutil
Date: Fri, 30 Oct 2020 22:03:11 +0000

 Module Name:	src
 Committed By:	kre
 Date:		Fri Oct 30 22:03:11 UTC 2020

 Modified Files:
 	src/lib/libutil: parsedate.y

 Log Message:
 PR lib/46542

 Add checks to detect overflow, and also detect other invalid
 (out of range) inputs for parsedate().

 There could be more, and some of what is being added is not
 perfect, but many calculation overflows will be detected now
 (and cause an error return) and some of the most bizarre
 inputs that were previously accepted no longer will be.


 To generate a diff of this commit:
 cvs rdiff -u -r1.35 -r1.36 src/lib/libutil/parsedate.y

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 10 Jul 2021 05:50:30 +0000
State-Changed-Why:
is this fixed now?


From: Robert Elz <kre@munnari.OZ.AU>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: lib/46542 (date does not work too welll far in the future.)
Date: Sat, 10 Jul 2021 20:43:16 +0700

     Date:        Sat, 10 Jul 2021 05:50:30 +0000 (UTC)
     From:        dholland@NetBSD.org
     Message-ID:  <20210710055030.88FEF1A9247@mollari.NetBSD.org>

   | is this fixed now?

 I think so, but it wasn't my PR.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.