GNU bug report logs -
#21906
julian-day->date negative input breakage
Previous Next
Reported by: Zefram <zefram <at> fysh.org>
Date: Fri, 13 Nov 2015 14:32:03 UTC
Severity: normal
Done: Mark H Weaver <mhw <at> netris.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#21906: julian-day->date negative input breakage
which was filed against the guile package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 21906 <at> debbugs.gnu.org.
--
21906: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21906
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Zefram <zefram <at> fysh.org> writes:
> scheme@(guile-user)> (use-modules (srfi srfi-19))
> scheme@(guile-user)> (julian-day->date 0 0)
> $1 = #<date nanosecond: 0 second: 0 minute: 0 hour: 12 day: 24 month: 11 year: -4714 zone-offset: 0>
> scheme@(guile-user)> (julian-day->date -1 0)
> $2 = #<date nanosecond: 0 second: 0 minute: 0 hour: -12 day: 24 month: 11 year: -4714 zone-offset: 0>
> scheme@(guile-user)> (julian-day->date -100000 0)
> $3 = #<date nanosecond: 0 second: 0 minute: 0 hour: -12 day: -19 month: 3 year: -4987 zone-offset: 0>
> scheme@(guile-user)> (julian-day->date -10000000 0)
> $4 = #<date nanosecond: 0 second: 0 minute: 0 hour: -12 day: -30 month: 0 year: -32092 zone-offset: 0>
This is fixed by commit a58c7abd72648f77e4ede5f62a2c4e7969bb7f95 on the
stable-2.2 branch. I'm closing this bug, but please reopen if
appropriate.
Thanks!
Mark
[Message part 3 (message/rfc822, inline)]
scheme@(guile-user)> (use-modules (srfi srfi-19))
scheme@(guile-user)> (julian-day->date 0 0)
$1 = #<date nanosecond: 0 second: 0 minute: 0 hour: 12 day: 24 month: 11 year: -4714 zone-offset: 0>
scheme@(guile-user)> (julian-day->date -1 0)
$2 = #<date nanosecond: 0 second: 0 minute: 0 hour: -12 day: 24 month: 11 year: -4714 zone-offset: 0>
scheme@(guile-user)> (julian-day->date -100000 0)
$3 = #<date nanosecond: 0 second: 0 minute: 0 hour: -12 day: -19 month: 3 year: -4987 zone-offset: 0>
scheme@(guile-user)> (julian-day->date -10000000 0)
$4 = #<date nanosecond: 0 second: 0 minute: 0 hour: -12 day: -30 month: 0 year: -32092 zone-offset: 0>
Observe the various erroneous field values: negative hour, negative
day-of-month, zero month. These occur in general for various negative
JD inputs. Not only should the conversion not produce these kinds of
values, the date structure type probably ought to reject them if they
get that far.
-zefram
This bug report was last modified 6 years and 211 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.