[GHC] #588: Exception: Time.toClockTime: picoseconds out of range

GHC trac at galois.com
Thu Mar 9 23:36:44 EST 2006


#588: Exception: Time.toClockTime: picoseconds out of range
-----------------------------+----------------------------------------------
  Reporter:  anonymous       |          Owner:         
      Type:  bug             |         Status:  new    
  Priority:  normal          |      Milestone:         
 Component:  libraries/base  |        Version:  6.4.1  
  Severity:  normal          |     Resolution:         
  Keywords:                  |             Os:  Unknown
Difficulty:  Easy (1 hr)     |   Architecture:  Unknown
-----------------------------+----------------------------------------------
Changes (by dylex at dylex.net):

  * architecture:  => Unknown
  * difficulty:  => Easy (1 hr)
  * component:  GHCi => libraries/base
  * os:  => Unknown

Comment:

 I ran into this too.  I think this patch fixes it (I presume that's why
 the
 FIXME was there):

 {{{
 --- libraries/base/System/Time.hsc.orig 2006-03-09 20:25:14.000000000
 -0800
 +++ libraries/base/System/Time.hsc      2006-03-09 20:28:37.000000000
 -0800
 @@ -270,8 +270,8 @@
                       60 * toInteger min +
                       3600 * toInteger hour +
                       24 * 3600 * toInteger day
 -         cal      = toUTCTime (TOD (c_sec + sec_diff) (c_psec + psec))
 -                                                       -- FIXME! ^^^^
 +         (d_sec, d_psec) = (c_psec + psec) `quotRem` 1000000000000
 +         cal      = toUTCTime (TOD (c_sec + sec_diff + d_sec) d_psec)
            new_mon  = fromEnum (ctMonth cal) + r_mon
           month' = fst tmp
           yr_diff = snd tmp
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/588>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list