[GHC] #1115: GHC concurrency runtime "breaks" every 497 (and a bit)
days
GHC
trac at galois.com
Tue Jan 23 08:07:23 EST 2007
#1115: GHC concurrency runtime "breaks" every 497 (and a bit) days
---------------------------------+------------------------------------------
Reporter: Neil Davies | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Runtime System | Version: 6.6
Severity: major | Keywords:
Difficulty: Moderate (1 day) | Testcase:
Architecture: Unknown | Os: Unknown
---------------------------------+------------------------------------------
The GHC concurrency model does all of its time calculations for delays in
"ticks"
- a tick being fixed at 1/50th of a second. It performs all of these
calculations in terms the number of these ticks since the Unix epoch
(Jan 1970). Which is stored as an Int - unfortunately this (typically)
2^31 bits
overflows every 497 (and a bit) days.
When it does overflow any threads on the timer queue will either a)
run immediately or b) not be run for another 497 days - depending on
which way the sign changes. Also any timer calculation that spans the
wrapround (sometime in the preceeding 35 or so minutes) will not be dealt
with correctly.
Although this doesn't happen often (the last one was around Sat Sep 30
18:32:51 UTC 2006 and the next one will not be until Sat Feb 9
21:00:44 UTC 2008) it nees to be resolved.
Take a look at the definition of getTicksofDay (in
base/include/HsBase.h (non-windows) / base/cbits/Win32Utils.c) and
getDelay (in base/GHC/Conc.lhs) to understand the details of the
issue.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1115>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list