Opened 3 years ago

Closed 2 months 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):


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 3 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 3 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 3 years ago by igloo

  • difficulty set to Unknown
  • Milestone set to 7.8.1
  • Priority changed from normal to high

comment:4 Changed 2 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 2 years ago by edsko

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

comment:6 Changed 16 months ago by thoughtpolice

  • Milestone changed from 7.8.3 to 7.8.4

Moving to 7.8.4.

comment:7 Changed 13 months ago by thoughtpolice

  • Owner set to thoughtpolice

comment:8 Changed 12 months ago by thoughtpolice

  • Milestone changed from 7.8.4 to 7.10.1

Moving (in bulk) to 7.10.4

comment:9 Changed 9 months ago by thoughtpolice

  • Milestone changed from 7.10.1 to 7.12.1

Moving to 7.12.1

comment:10 Changed 6 months ago by thomie

  • Status changed from new to infoneeded

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 months ago by thomie

  • Milestone 7.12.1 deleted
  • Resolution set to worksforme
  • Status changed from infoneeded to closed

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.