Opened 5 years ago

Closed 2 years ago

#7567 closed bug (worksforme)

invalidateModSummaryCache throws exception if ms_hs_date is 0

Reported by: edsko Owned by: thoughtpolice
Priority: high Milestone:
Component: Compiler Version: 7.6.1
Keywords: 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:


It will try to subtract one, and the negative value will cause Time.toClockTime: invalid input to be thrown.

Change History (11)

comment:1 Changed 5 years ago by edsko

Note that this exception may or may not be thrown, depending on the timezone (Europe/Dublin works fine for me, UTC or GMT do not, even though they come down to the same thing, at least in winter time).

comment:2 Changed 5 years ago by edsko

Incidentally, the exception is an error, so it is only thrown when ms_hs_date is forced (ModSummary does not use strict fields).

comment:3 Changed 5 years ago by igloo

difficulty: Unknown
Milestone: 7.8.1
Priority: normalhigh

comment:4 Changed 4 years ago by bgamari

Is it not safe to assume that the users environment will be non-broken enough to have functional mtimes? Under what circumstances did this happen?

comment:5 Changed 4 years ago by edsko

Under circumstances where we manually set those mtimes (to work around

comment:6 Changed 3 years ago by thoughtpolice


Moving to 7.8.4.

comment:7 Changed 3 years ago by thoughtpolice

Owner: set to thoughtpolice

comment:8 Changed 3 years ago by thoughtpolice


Moving (in bulk) to 7.10.4

comment:9 Changed 3 years ago by thoughtpolice


Moving to 7.12.1

comment:10 Changed 3 years ago by thomie

Status: newinfoneeded

Edsko: I am having trouble reproducing your issue.

The file main/GHC.hs uses Data.Time from the time package, and has so from the beginning. Time.toClockTime is a function from the old-time package, which GHC doesn't use. How can it throw an error?

Also if I call addUTCTime (-1) on UTCTime (ModifiedJulianDay 0) (secondsToDiffTime 0), and force its result, nothing bad happens. Can you give me instructions how to trigger the bug. Thanks.

comment:11 Changed 2 years ago by thomie

Milestone: 7.12.1
Resolution: worksforme
Status: infoneededclosed

This issue should be fixed with the switch to the time package.

In commit 08894f96407635781a233145435a78f144accab0:

Author: Ian Lynagh <>
Date:   Sat Jan 14 17:07:10 2012 +0000

    Switch to using the time package, rather than old-time
Note: See TracTickets for help on using tickets.