Opened 6 years ago

Closed 15 months 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 Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

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 6 years ago.
This is able to reproduce the bug, at least for me.
PicoTest2.hs (408 bytes) - added by Ansible 6 years ago.
PicoTest2.hs

Download all attachments as: .zip

Change History (8)

Changed 6 years ago by Ansible

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

comment:1 Changed 6 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 6 years ago by Ansible

PicoTest2.hs

comment:2 Changed 6 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 6 years ago by igloo

  • Difficulty set to Unknown
  • Milestone set to _|_

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

comment:4 Changed 6 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:5 Changed 6 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple

comment:6 Changed 15 months ago by monoidal

  • Resolution set to wontfix
  • Status changed from new to closed
  • Type of failure set to None/Unknown

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

Note: See TracTickets for help on using tickets.