#2457: Seq causes panic in GHCi
------------------------------+---------------------------------------------
    Reporter:  thoughtpolice  |       Owner:          
        Type:  bug            |      Status:  new     
    Priority:  normal         |   Component:  Compiler
     Version:  6.8.3          |    Severity:  normal  
    Keywords:                 |    Testcase:          
Architecture:  x86            |          Os:  MacOS X 
------------------------------+---------------------------------------------
 While trying to understand the semantic differences between seq and pseq,
 when looking at the Control.Parallel page, it says that the compiler may
 transform "x `seq` y" into "y `seq` x `seq` y"

 Trying this in GHCi lead me to this:


 {{{
 $ ghci
 GHCi, version 6.8.3: http://www.haskell.org/ghc/  :? for help
 Loading package base ... linking ... done.
 Prelude> let x = tail [1..]
 Prelude> x `seq` ()
 ()
 Prelude> () `seq` x `seq` ()
 ghc-6.8.3: panic! (the 'impossible' happened)
   (GHC version 6.8.3 for i386-apple-darwin):
         nameModule (){v 71}

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

 Prelude>
 }}}

 When testing this in a file however, things go smoothly:

 {{{
 $ cat seq.hs
 x = tail [1..]

 -- x `seq` y can apparently be transformed
 -- into y `seq` x `seq y
 v = () `seq` x `seq` ()

 main = return v
 $ ghc --make seq.hs
 [1 of 1] Compiling Main             ( seq.hs, seq.o )
 Linking seq ...
 $ ./seq; echo $?
 0
 $
 }}}

 I cannot be sure if this bug still occurs as of GHC 6.9.20080720, as ghci
 is apparently broken in my build (this could have to do with build
 settings but I am not sure, it has to do with the fact that the base
 library can't find the _environ symbol; should I file another report?)

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2457>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to