[GHC] #9140: Unboxed tuples fails in GHCi (7.8.2)

#9140: Unboxed tuples fails in GHCi (7.8.2) ------------------------------------+------------------------------------- Reporter: osa1 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.8.2 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: GHCi crash Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- Creating an unboxed tuple in GHCi causes panic: {{{ ➜ ~ ghci -XUnboxedTuples GHCi, version 7.8.2: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. ghci> let a = (# 1 #) ghc: panic! (the 'impossible' happened) (GHC version 7.8.2 for x86_64-unknown-linux): dsLet: unlifted AbsBinds [a{tv auv} [tv]] [$dNum_auw{v} [lid]] {Exports: [a{v asV} [lid] <= a{v asY} [lid] /\(@ a{tv auy} [tv]). \($dNum_auz{v} [lid] :: base:GHC.Num.Num{tc 2b} a{tv auy} [tv]). let {EvBinds{$dNum_auC{v} [lid] = $dNum_auz{v} [lid]}} (<>) @ a{tv auy} [tv] $dNum_auC{v} [lid]] Exported types: a{v asV} [lid] :: forall a{tv auv} [tv]. base:GHC.Num.Num{tc 2b} a{tv auv} [tv] => (# a{tv auv} [tv] #) [LclId, Str=DmdType] Binds: {<interactive>:2:5-15} a{v asY} [lid] :: (# a{tv auv} [tv] #) [LclId, Str=DmdType] a{v asY} = {<interactive>:2:9-15} (# 1 ((base:GHC.Num.fromInteger{v 02A}) @ a{tv auv} [tv] $dNum_au8{v} [lid] 1) #) <> Evidence: EvBinds{$dNum_au8{v} [lid] = $dNum_auw{v} [lid]}} base:GHC.Base.returnIO{v 0z} [gid] @ [()] (ghc-prim:GHC.Types.:{(w) v 65} [gid[DataCon]] @ () (ghc-prim:GHC.Prim.unsafeCoerce#{(w) v 0u} [gid] @ (forall a{tv auv} [tv]. base:GHC.Num.Num{tc 2b} a{tv auv} [tv] => (# a{tv auv} [tv] #)) @ () a{v asV} [lid]) (ghc-prim:GHC.Types.[]{(w) v 6n} [gid[DataCon]] @ ())) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug ghci> let a = (# 1, 2 #) ghc: panic! (the 'impossible' happened) (GHC version 7.8.2 for x86_64-unknown-linux): dsLet: unlifted AbsBinds [a{tv auW} [tv], a{tv auX} [tv]] [$dNum_auY{v} [lid], $dNum_auZ{v} [lid]] {Exports: [a{v auK} [lid] <= a{v auN} [lid] /\(@ a{tv av1} [tv]). /\(@ a{tv av2} [tv]). \($dNum_av3{v} [lid] :: base:GHC.Num.Num{tc 2b} a{tv av2} [tv]). \($dNum_av4{v} [lid] :: base:GHC.Num.Num{tc 2b} a{tv av1} [tv]). let {EvBinds{$dNum_av8{v} [lid] = $dNum_av3{v} [lid] $dNum_av9{v} [lid] = $dNum_av4{v} [lid]}} (<>) @ a{tv av1} [tv] @ a{tv av2} [tv] $dNum_av8{v} [lid] $dNum_av9{v} [lid]] Exported types: a{v auK} [lid] :: forall a{tv auW} [tv] a{tv auX} [tv]. (base:GHC.Num.Num{tc 2b} a{tv auX} [tv], base:GHC.Num.Num{tc 2b} a{tv auW} [tv]) => (# a{tv auW} [tv], a{tv auX} [tv] #) [LclId, Str=DmdType] Binds: {<interactive>:3:5-18} a{v auN} [lid] :: (# a{tv auW} [tv], a{tv auX} [tv] #) [LclId, Str=DmdType] a{v auN} = {<interactive>:3:9-18} (# 1 ((base:GHC.Num.fromInteger{v 02A}) @ a{tv auW} [tv] $dNum_auR{v} [lid] 1), 2 ((base:GHC.Num.fromInteger{v 02A}) @ a{tv auX} [tv] $dNum_auT{v} [lid] 2) #) <> Evidence: EvBinds{$dNum_auR{v} [lid] = $dNum_auZ{v} [lid] $dNum_auT{v} [lid] = $dNum_auY{v} [lid]}} base:GHC.Base.returnIO{v 0z} [gid] @ [()] (ghc-prim:GHC.Types.:{(w) v 65} [gid[DataCon]] @ () (ghc-prim:GHC.Prim.unsafeCoerce#{(w) v 0u} [gid] @ (forall a{tv auW} [tv] a{tv auX} [tv]. (base:GHC.Num.Num{tc 2b} a{tv auX} [tv], base:GHC.Num.Num{tc 2b} a{tv auW} [tv]) => (# a{tv auW} [tv], a{tv auX} [tv] #)) @ () a{v auK} [lid]) (ghc-prim:GHC.Types.[]{(w) v 6n} [gid[DataCon]] @ ())) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug ghci> }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9140 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9140: Unboxed tuples fails in GHCi (7.8.2) -------------------------------------+------------------------------------ Reporter: osa1 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by archblob): This should probably say {{{GHCi can't bind a variable of unlifted type: a :: (# Integer #)}}} and by doing {{{:set -XMonomorphismRestriction}}} it sure does. Otherwise it gets generalised to {{{Num a => (# a #)}}}. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9140#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9140: Unboxed tuples fails in GHCi (7.8.2) -------------------------------------+------------------------------------ Reporter: osa1 | Owner: archblob Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by archblob): * owner: => archblob -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9140#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9140: Unboxed tuples fails in GHCi (7.8.2) -------------------------------------+------------------------------------ Reporter: osa1 | Owner: archblob Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by archblob): I have attached a fix that validates and I think it's correct, but it should be checked first as there maybe be something I have missed.I have ventured far deeper than I'm comfortable at the moment. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9140#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9140: Unboxed tuples fails in GHCi (7.8.2) -------------------------------------+------------------------------------ Reporter: osa1 | Owner: archblob Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by archblob): The error message will print the binding without a type signature if it was inferred and not given by the user and would be a bit of a nuisance to add. I suggest that we maybe just print the thype like so {{{a :: forall a. Num a => (# a #)}}} instead of {{{a = (# 1, 3 #) :: forall a. Num a => (# a #) }}}. I don't think any valuable info is really lost given that the location information is also printed. If this is not ok I will see what I can do with regard to printing the binding as per the second example. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9140#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9140: Unboxed tuples fails in GHCi (7.8.2) -------------------------------------+------------------------------------ Reporter: osa1 | Owner: archblob Type: bug | Status: patch Priority: normal | Milestone: Component: GHCi | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by archblob): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9140#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9140: Unboxed tuples fails in GHCi (7.8.2) -------------------------------------+------------------------------------ Reporter: osa1 | Owner: archblob Type: bug | Status: patch Priority: normal | Milestone: Component: GHCi | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by archblob): * cc: simonpj@… (added) Comment: This looks like your area of expertise. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9140#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9140: Unboxed tuples fails in GHCi (7.8.2) -------------------------------------+------------------------------------ Reporter: osa1 | Owner: archblob Type: bug | Status: patch Priority: normal | Milestone: 7.10.1 Component: GHCi | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by archblob): * milestone: => 7.10.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9140#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9140: Unboxed tuples fails in GHCi (7.8.2)
-------------------------------------+------------------------------------
Reporter: osa1 | Owner: archblob
Type: bug | Status: patch
Priority: normal | Milestone: 7.10.1
Component: GHCi | Version: 7.8.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: GHCi crash | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+------------------------------------
Comment (by Austin Seipp

#9140: Unboxed tuples fails in GHCi (7.8.2) -------------------------------------+------------------------------------- Reporter: osa1 | Owner: archblob Type: bug | Status: closed Priority: normal | Milestone: 7.10.1 Component: GHCi | Version: 7.8.2 Resolution: fixed | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: GHCi crash | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: patch => closed * resolution: => fixed Comment: Merged, making sure Simon will audit it later. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9140#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9140: Unboxed tuples fails in GHCi (7.8.2) -------------------------------------+------------------------------------- Reporter: osa1 | Owner: archblob Type: bug | Status: closed Priority: normal | Milestone: 7.10.1 Component: GHCi | Version: 7.8.2 Resolution: fixed | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: GHCi crash | Blocked By: Test Case: | Related Tickets: tests/ghci/scripts/T9140 | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * testcase: => tests/ghci/scripts/T9140 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9140#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9140: Unboxed tuples fails in GHCi (7.8.2)
-------------------------------------+-------------------------------------
Reporter: osa1 | Owner: archblob
Type: bug | Status: closed
Priority: normal | Milestone: 7.10.1
Component: GHCi | Version: 7.8.2
Resolution: fixed | Keywords:
Operating System: | Architecture: Unknown/Multiple
Unknown/Multiple | Difficulty: Unknown
Type of failure: GHCi crash | Blocked By:
Test Case: | Related Tickets:
tests/ghci/scripts/T9140 |
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones
participants (1)
-
GHC