unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Potential bug with SRFI-19 Time, seconds and nanoseconds flipped
@ 2017-07-16  8:59 Christopher Baines
  2017-07-16 18:06 ` Mark H Weaver
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Baines @ 2017-07-16  8:59 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 1772 bytes --]

The seconds and nanoseconds fields seem to get swapped around, but I
can't quite work out how.

See the trace below, the values seem right at the point where
#<time type: time-tai nanosecond: 670560000 second: 1500195344>
is created, but the final value seems to have the values the
wrong way around.

GNU Guile 2.2.2
Copyright (C) 1995-2017 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> ,m (srfi srfi-19)
scheme@(srfi srfi-19)> (current-time-monotonic)
$1 = #<time type: time-monotonic nanosecond: 500195342 second: 273413001>
scheme@(srfi srfi-19)> ,trace (current-time-monotonic) 273413001>
trace: (current-time-monotonic)
trace: |  (current-time-tai)
trace: |  |  (gettimeofday)
trace: |  |  (1500195308 . 670560)
trace: |  |  (leap-second-delta 1500195308)
trace: |  |  36
trace: |  (make-time time-tai 670560000 1500195344)
trace: |  (time-normalize! #<time type: time-tai nanosecond: 670560000 second: 1500195344>)
trace: |  |  (abs 670560000)
trace: |  |  670560000
trace: |  #<time type: time-tai nanosecond: 670560000 second: 1500195344>
trace: (make-time time-monotonic 1500195344 670560000)
trace: (time-normalize! #<time type: time-monotonic nanosecond: 1500195344 second: 670560000>)
trace: |  (abs 1500195344)
trace: |  1500195344
trace: |  (split-real 1500195344)
trace: |  |  (integer? 1500195344)
trace: |  |  #t
trace: |  |  (inexact->exact 1500195344)
trace: |  |  1500195344
trace: |  2 values: 1500195344 0
trace: #<time type: time-monotonic nanosecond: 500195344 second: 670560001>

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Potential bug with SRFI-19 Time, seconds and nanoseconds flipped
  2017-07-16  8:59 Potential bug with SRFI-19 Time, seconds and nanoseconds flipped Christopher Baines
@ 2017-07-16 18:06 ` Mark H Weaver
  2017-07-16 18:48   ` Christopher Baines
  0 siblings, 1 reply; 3+ messages in thread
From: Mark H Weaver @ 2017-07-16 18:06 UTC (permalink / raw)
  To: Christopher Baines; +Cc: guile-devel

Christopher Baines <mail@cbaines.net> writes:
> The seconds and nanoseconds fields seem to get swapped around, but I
> can't quite work out how.

Indeed.  This was discovered shortly after the 2.2.2 release in April,
and fixed here:

  https://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=886ac3e2abce89bd3f47f957c36bcec16613c509

guile-2.2.3 will include this fix when it's released.  In the meantime,
here's how GNU Guix works around the problem:

  https://git.savannah.gnu.org/cgit/guix.git/commit/?id=1fe958d62ac33ef5e6da26ccc9213f4dae2ee1ae

     Mark



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Potential bug with SRFI-19 Time, seconds and nanoseconds flipped
  2017-07-16 18:06 ` Mark H Weaver
@ 2017-07-16 18:48   ` Christopher Baines
  0 siblings, 0 replies; 3+ messages in thread
From: Christopher Baines @ 2017-07-16 18:48 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 1010 bytes --]

On Sun, 16 Jul 2017 14:06:59 -0400
Mark H Weaver <mhw@netris.org> wrote:

> Christopher Baines <mail@cbaines.net> writes:
> > The seconds and nanoseconds fields seem to get swapped around, but I
> > can't quite work out how.  
> 
> Indeed.  This was discovered shortly after the 2.2.2 release in April,
> and fixed here:
> 
>   https://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=886ac3e2abce89bd3f47f957c36bcec16613c509

Ah, I'm glad that its a real problem, and that its been fixed.
This also explains why I couldn't see a problem in the guile
repository, I probably should have been looking at the source code
relevant to the version I was running...

> guile-2.2.3 will include this fix when it's released.  In the
> meantime, here's how GNU Guix works around the problem:
> 
>   https://git.savannah.gnu.org/cgit/guix.git/commit/?id=1fe958d62ac33ef5e6da26ccc9213f4dae2ee1ae

Thanks for mentioning this, as it looks to be a neat workaround.

Thanks again,

Chris

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-16 18:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-16  8:59 Potential bug with SRFI-19 Time, seconds and nanoseconds flipped Christopher Baines
2017-07-16 18:06 ` Mark H Weaver
2017-07-16 18:48   ` Christopher Baines

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 read-only IMAP folder(s) and NNTP newsgroup(s).