Opened 4 years ago

Closed 4 years ago

#5268 closed bug (fixed)

ghci panic in ByteCodeGen.schemeE: unhandled case

Reported by: patrikja Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description (last modified by simonpj)

To reproduce:

# install ghc from git HEAD 20110622
tar -zxf MonadicSystems-0.3.0.tar.gz
cd MonadicSystems-0.3.0/
cabal configure
cabal build
ghci MonadicSystems/Example/InputTransition3

Resulting panic is below.

Note that ghc reports a type error (no panic), while ghci panics.

I attach a snapshot of the code (which is not finished yet, but I thought you may have use for the report).

/Patrik

patrikj@dela:~/tmp/MonadicSystems-0.3.0$ ghci MonadicSystems/Example/InputTransition3
GHCi, version 7.1.20110622: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
[ 1 of 12] Compiling MonadicSystems.ConstructorType ( MonadicSystems/ConstructorType.hs, interpreted )
[ 2 of 12] Compiling MonadicSystems.ConstructorType.Instances.Identity ( MonadicSystems/ConstructorType/Instances/Identity.hs, interpreted )
[ 3 of 12] Compiling MonadicSystems.Function2 ( MonadicSystems/Function2.hs, interpreted )
[ 4 of 12] Compiling MonadicSystems.Function ( MonadicSystems/Function.hs, interpreted )
[ 5 of 12] Compiling MonadicSystems.Function.Instances.ToFunction ( MonadicSystems/Function/Instances/ToFunction.hs, interpreted )
[ 6 of 12] Compiling MonadicSystems.Functor ( MonadicSystems/Functor.hs, interpreted )
[ 7 of 12] Compiling MonadicSystems.Functor.Instances.Identity ( MonadicSystems/Functor/Instances/Identity.hs, interpreted )
[ 8 of 12] Compiling MonadicSystems.Monad ( MonadicSystems/Monad.hs, interpreted )
[ 9 of 12] Compiling MonadicSystems.Monad.Instances.Identity ( MonadicSystems/Monad/Instances/Identity.hs, interpreted )
[10 of 12] Compiling MonadicSystems.Coalgebra ( MonadicSystems/Coalgebra.hs, interpreted )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.1.20110622 for x86_64-unknown-linux):
	ByteCodeGen.schemeE: unhandled case CO tpl_B4{v} [lid]

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

With GHC:

patrikj@dela:~/tmp/MonadicSystems-0.3.0$ ghc MonadicSystems/Example/InputTransition3
[ 1 of 12] Compiling MonadicSystems.ConstructorType ( MonadicSystems/ConstructorType.hs, MonadicSystems/ConstructorType.o )
[ 2 of 12] Compiling MonadicSystems.Function ( MonadicSystems/Function.hs, MonadicSystems/Function.o )
[ 3 of 12] Compiling MonadicSystems.Function.Instances.ToFunction ( MonadicSystems/Function/Instances/ToFunction.hs, MonadicSystems/Function/Instances/ToFunction.o )
[ 4 of 12] Compiling MonadicSystems.Functor ( MonadicSystems/Functor.hs, MonadicSystems/Functor.o )
[ 5 of 12] Compiling MonadicSystems.Monad ( MonadicSystems/Monad.hs, MonadicSystems/Monad.o )
[ 6 of 12] Compiling MonadicSystems.Function2 ( MonadicSystems/Function2.hs, MonadicSystems/Function2.o )
[ 7 of 12] Compiling MonadicSystems.Coalgebra ( MonadicSystems/Coalgebra.hs, MonadicSystems/Coalgebra.o )
[ 8 of 12] Compiling MonadicSystems.ConstructorType.Instances.Identity ( MonadicSystems/ConstructorType/Instances/Identity.hs, MonadicSystems/ConstructorType/Instances/Identity.o )
[ 9 of 12] Compiling MonadicSystems.Monad.Instances.Identity ( MonadicSystems/Monad/Instances/Identity.hs, MonadicSystems/Monad/Instances/Identity.o )
[10 of 12] Compiling MonadicSystems.Functor.Instances.Identity ( MonadicSystems/Functor/Instances/Identity.hs, MonadicSystems/Functor/Instances/Identity.o )
[11 of 12] Compiling MonadicSystems.MonadicCoalgebra ( MonadicSystems/MonadicCoalgebra.hs, MonadicSystems/MonadicCoalgebra.o )
[12 of 12] Compiling MonadicSystems.Example.InputTransition3 ( MonadicSystems/Example/InputTransition3.hs, MonadicSystems/Example/InputTransition3.o )

MonadicSystems/Example/InputTransition3.hs:18:10:
    Couldn't match type `Int'
                   with `MS.McA.FunctorTag InputTransition3
                         MS.McA.:@ MS.McA.Codomain InputTransition3'
    In the instance declaration for `MS.McA.CoalgebraWithInput
                                       InputTransition3'

Attachments (1)

MonadicSystems-0.3.0.tar.gz (14.9 KB) - added by patrikja 4 years ago.
Snapshot of the source code leading to the ghci panic.

Download all attachments as: .zip

Change History (6)

Changed 4 years ago by patrikja

Snapshot of the source code leading to the ghci panic.

comment:1 Changed 4 years ago by simonpj

  • Description modified (diff)

comment:2 follow-up: Changed 4 years ago by simonpj

Very quick! I know what to do about the GHCi thing, but maybe the type error is correct?!

It's a big program. Can you write down the argument that says the type error is wrong?

Thx

S

comment:3 in reply to: ↑ 2 Changed 4 years ago by patrikja

Replying to simonpj:

Very quick! I know what to do about the GHCi thing, but maybe the type error is correct?!

It's a big program. Can you write down the argument that says the type error is wrong?

Thx

S

I have no good reason to believe that type error is wrong - the code is in a state of flux.
So the bug report is only about the panic - the type error part was just to help debugging (I found it strange that ghci did not report the same error).

/Patrik

comment:4 Changed 4 years ago by simonpj

Aha! Good. I'm fixing the panic now.

comment:5 Changed 4 years ago by simonpj

  • Resolution set to fixed
  • Status changed from new to closed

Thanks. Fixed by

commit 09d83049b2c5a6a9b44e70f19ae09f9cb08b3da2
Author: Simon Peyton Jones <[email protected]>
Date:   Thu Jun 23 14:28:50 2011 +0100

    Fix Trac #5268: missing case for bytecode generation involving coercions

 compiler/ghci/ByteCodeGen.lhs |   40 ++++++++++++++++++----------------------
 1 files changed, 18 insertions(+), 22 deletions(-)
Note: See TracTickets for help on using tickets.