Opened 9 years ago

Closed 5 years ago

#2519 closed bug (wontfix)

Time.toClockTime: picoseconds out of range, after diffClockTimes

Reported by: Ansible Owned by:
Priority: normal Milestone:
Component: GHCi Version: 6.8.2
Keywords: TimeDiff Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

I've found a consistent problem where the picoseconds field of TimeDiff is less than zero. I'm attaching a program that is able to reproduce this problem under 6.8.2.

Attachments (2)

PicoTest.hs (1.3 KB) - added by Ansible 9 years ago.
This is able to reproduce the bug, at least for me.
PicoTest2.hs (408 bytes) - added by Ansible 9 years ago.
PicoTest2.hs

Download all attachments as: .zip

Change History (8)

Changed 9 years ago by Ansible

Attachment: PicoTest.hs added

This is able to reproduce the bug, at least for me.

comment:1 Changed 9 years ago by Ansible

Output from PicoTest.hs:

*Main> main Welcome to the picotest. Enter 'q' to quit. Hit enter for test:

Clocktime1 1218999538 seconds; 896297000000 picoseconds. Clocktime2 1218999539 seconds; 943780000000 picoseconds. TimeDiff TimeDiff {tdYear = 0, tdMonth = 0, tdDay = 0, tdHour = 0, tdMin = 0, tdSec = 1, tdPicosec = 47483000000} converted to seconds: 1.047483 Hit enter for test:

Clocktime1 1218999539 seconds; 946978000000 picoseconds. Clocktime2 1218999540 seconds; 931424000000 picoseconds. TimeDiff TimeDiff {tdYear = 0, tdMonth = 0, tdDay = 0, tdHour = 0, tdMin = 0, tdSec = 1, tdPicosec = -15554000000} converted to seconds: * Exception: Time.toClockTime: picoseconds out of range

Changed 9 years ago by Ansible

Attachment: PicoTest2.hs added

PicoTest2.hs

comment:2 Changed 9 years ago by Ansible

Output from PicoTest2.hs. Does not produce the bug, although the same ClockTime values are used.

[1 of 1] Compiling Main ( PicoTest2.hs, interpreted ) Ok, modules loaded: Main. *Main> main TimeDiff {tdYear = 0, tdMonth = 0, tdDay = 0, tdHour = 0, tdMin = 0, tdSec = -1, tdPicosec = 15554000000} -0.984446 *Main>

comment:3 Changed 9 years ago by igloo

difficulty: Unknown
Milestone: _|_

I recommend you use the new time package instead of old-time.

comment:4 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:5 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple

comment:6 Changed 5 years ago by monoidal

Resolution: wontfix
Status: newclosed
Type of failure: None/Unknown

Closing - the ticket concerns old-time which is abandoned.

Note: See TracTickets for help on using tickets.