#2877: crash when printig a list (IO ())
-------------------------------+--------------------------------------------
    Reporter:  guest           |        Owner:         
        Type:  bug             |       Status:  new    
    Priority:  normal          |    Milestone:         
   Component:  GHCi            |      Version:  6.10.1 
    Severity:  normal          |   Resolution:         
    Keywords:                  |   Difficulty:  Unknown
    Testcase:                  |           Os:  Windows
Architecture:  x86_64 (amd64)  |  
-------------------------------+--------------------------------------------
Changes (by simonpj):

  * difficulty:  => Unknown

Old description:

> data InputSignal = IS1 |
>                    IS2
>
> data OutputSignal = OS1 Widget [Int] |
>                     OS2 Widget [String]
>
> type Widget = InputSignal -> OutputSignal
>

> testWidgetSignalProcessor :: (Int, Int, Int) -> Widget
> testWidgetSignalProcessor pos@(x, y, z) IS1 = OS1
> (testWidgetSignalProcessor pos) [1, 2, 3]
> testWidgetSignalProcessor pos@(x, y, z) IS2 = OS2
> (testWidgetSignalProcessor (666, 666, 666)) ["ich", "kack", "ab"]
>

> makeTestWidget :: (Int, Int, Int) -> Widget
> makeTestWidget pos = testWidgetSignalProcessor pos
>

> display :: OutputSignal -> IO ()
> display (OS1 widget list) = print list
> display (OS2 widget list) = print list
>

> test :: IO ()
> test = do
>   let testWidget = makeTestWidget (0, 0, 0)
>   display $ testWidget IS1
>   display $ testWidget IS2
>

> when i enter "test" at the interpreter-prompt (i'm using ghci from
> emacs), it crashes with the following message:
>
> : panic! (the 'impossible' happened)
>   (GHC version 6.10.1 for i386-unknown-mingw32):
>         loadObj: failed

New description:

 {{{
 data InputSignal = IS1 |
                    IS2

 data OutputSignal = OS1 Widget [Int] |
                     OS2 Widget [String]

 type Widget = InputSignal -> OutputSignal


 testWidgetSignalProcessor :: (Int, Int, Int) -> Widget
 testWidgetSignalProcessor pos@(x, y, z) IS1 = OS1
 (testWidgetSignalProcessor pos) [1, 2, 3]
 testWidgetSignalProcessor pos@(x, y, z) IS2 = OS2
 (testWidgetSignalProcessor (666, 666, 666)) ["ich", "kack", "ab"]


 makeTestWidget :: (Int, Int, Int) -> Widget
 makeTestWidget pos = testWidgetSignalProcessor pos


 display :: OutputSignal -> IO ()
 display (OS1 widget list) = print list
 display (OS2 widget list) = print list


 test :: IO ()
 test = do
   let testWidget = makeTestWidget (0, 0, 0)
   display $ testWidget IS1
   display $ testWidget IS2
 }}}

 when i enter "test" at the interpreter-prompt (i'm using ghci from emacs),
 it crashes with the following message:
 {{{
 : panic! (the 'impossible' happened)
   (GHC version 6.10.1 for i386-unknown-mingw32):
         loadObj: failed
 }}}}

Comment:

 That's odd.  On our x86_64 machine it works fine:
 {{{
 [1 of 1] Compiling T2877            ( T2877.hs, interpreted )
 Ok, modules loaded: T2877.
 *T2877> test
 [1,2,3]
 ["ich","kack","ab"]
 *T2877>
 }}}
 Can others try?

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2877#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to