#1031 closed merge (fixed)
ghc 6.6 impossible happened
Reported by: | guest | Owned by: | igloo |
---|---|---|---|
Priority: | normal | Milestone: | 6.6.1 |
Component: | Compiler | Version: | 6.6 |
Keywords: | Cc: | ahey@… | |
Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
Type of failure: | Difficulty: | Unknown | |
Test Case: | dsrun014 | Blocked By: | |
Blocking: | Related Tickets: |
Description
ghc-6.6: panic! (the 'impossible' happened) (GHC version 6.6 for i386-unknown-linux): cgPanic tpl{v sVs} [lid] static binds for: main:Util.RWS.runRWS'{v rpz} [gid] main:Util.RWS.$f4{v rv4} [gid] main:Util.RWS.$f5{v rva} [gid] local binds for: SRT label main:Util.RWS.$f3{v ruN}_srt
the file which caused it is:
-- modification of Control.Monad.RWS to make it strict in its fields, as well as use unboxed tuples internally module Util.RWS ( RWS, module Control.Monad.Reader, module Control.Monad.Writer, module Control.Monad.State, ) where import Prelude import Control.Monad import Control.Monad.Fix import Control.Monad.Trans import Control.Monad.Reader import Control.Monad.Writer import Control.Monad.State import Data.Monoid newtype RWS r w s a = RWS { runRWS' :: r -> s -> (# a, s, w #) } runRWS x r s = case runRWS' x r s of (# a, b, c #) -> (a,b,c) instance Functor (RWS r w s) where fmap f m = RWS $ \r s -> let (# a, s', w #) = runRWS' m r s in s' `seq` w `seq` (# f a, s', w #) instance (Monoid w) => Monad (RWS r w s) where return a = RWS $ \_ s -> (# a, s, mempty #) m >>= k = RWS $ \r s -> case runRWS' m r s of (# a, s', w #) -> case runRWS' (k a) r s' of (# b, s'', w' #) -> let w'' = w `mappend` w' in w'' `seq` (# b, s'', w'' #) --instance (Monoid w) => MonadFix (RWS r w s) where -- mfix f = RWS $ \r s -> let (a, s', w) = runRWS (f a) r s in (a, s', w) instance (Monoid w) => MonadReader r (RWS r w s) where ask = RWS $ \r s -> (# r, s, mempty #) local f m = RWS $ \r s -> let r' = f r in r' `seq` runRWS' m r' s instance (Monoid w) => MonadWriter w (RWS r w s) where tell w = RWS $ \_ s -> (# (), s, w #) listen m = RWS $ \r s -> case runRWS' m r s of (# a, s', w #) -> (# (a, w), s', w #) pass m = RWS $ \r s -> case runRWS' m r s of (# (a, f), s', w #) -> let w' = f w in w' `seq` (# a, s', w' #) instance (Monoid w) => MonadState s (RWS r w s) where get = RWS $ \_ s -> (# s, s, mempty #) put s = RWS $ \_ _ -> s `seq` (# (), s, mempty #)
Attachments (1)
Change History (10)
comment:1 Changed 7 years ago by guest
comment:2 Changed 7 years ago by simonpj
- Owner set to simonpj
I've diagnosed this (note to self: ~/tmp/Foo6.hs).
It's a tricky interaction of seq and unboxed tuples. I'm about to go away for 10 days; I'll look at it when I get back, unless it's a show-stopper for you.
Simon
comment:3 Changed 7 years ago by guest
using bang patterns to enfore strictness rather than 'seq' seems to work around the problem. -John
comment:4 Changed 7 years ago by simonpj
- Cc ahey@… added
Adrian Hey writes: I seem to have hit this problem. (I think, at least I'm getting a very similar incomprehensible error message :-)
I tried using bang patterns instead of seq like this:
let a0_ = f a0 a in a0_ `seq` (# l,hl,a0_,r,hr #)
becomes ..
let !a0_ = f a0 a in (# l,hl,a0_,r,hr #)
but I still get the same error.
The attachment should show the problem (in Windows using
Build.BAT). The problem occurs in the HSet module (and
maybe others).
BTW, regarding the urgency of this, a solution is not
particularly urgent for me as it's part of a generalised
tries lib which probably needs at least another months
work or so before it's ready for prime time, and seeing
as at the end of the week I'm going away until end
of Feb it probably won't be a real show stopper until
about April (and even then it'll only stop a lib that
noone is currently dependent on, not even me :-)
comment:5 Changed 7 years ago by igloo
- Milestone set to 6.6.1
comment:6 Changed 7 years ago by simonpj
- Owner changed from simonpj to igloo
- Test Case set to dsrun014
- Type changed from bug to merge
OK I've fixed this. Please merge to 6.6 branch
Simon
Fri Mar 16 15:17:12 GMT 2007 simonpj@…
- Desugar applications of 'seq' specially; fix Trac #1031
comment:7 Changed 7 years ago by igloo
- Resolution set to fixed
- Status changed from new to closed
Merged, along with
Establish the CoreSyn let/app invariant simonpj@microsoft.com**20070205173150
comment:8 Changed 6 years ago by simonmar
- Architecture changed from Unknown to Unknown/Multiple
comment:9 Changed 6 years ago by simonmar
- Operating System changed from Unknown to Unknown/Multiple
this bug is from John Meacham <john@…>