[GHC] #13435: Segfaults on levity-polymorphic type class

#13435: Segfaults on levity-polymorphic type class -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- {{{#!hs {-# Language FlexibleInstances, TypeFamilies, TypeInType, MagicHash #-} import Data.Kind import GHC.Exts class Shw (a :: TYPE rep) where shw :: a -> String instance Int# ~ a => Shw (a :: TYPE IntRep) where shw a = "I#" ++ show (I# a) main = putStrLn (shw 3#) }}} induces a segfault {{{ $ runghc --version runghc 8.0.1 $ runghc test.hs I#Segmentation fault }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13435 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13435: Segfaults on levity-polymorphic type class -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | LevityPolymorphism Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Iceland_jack): * keywords: => LevityPolymorphism -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13435#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13435: Segfaults on levity-polymorphic type class -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | LevityPolymorphism Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by dfeuer): I believe the type checker should reject that class declaration. I'm not an expert at levity polymorphism, but I ''think'' class methods are supposed to have uniform calling conventions. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13435#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13435: Segfaults on levity-polymorphic type class -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | LevityPolymorphism Operating System: Unknown/Multiple | Architecture: Type of failure: GHC accepts | Unknown/Multiple invalid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by dfeuer): * failure: None/Unknown => GHC accepts invalid program -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13435#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13435: Segfaults on levity-polymorphic type class -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler (Type | Version: 8.0.1 checker) | Keywords: Resolution: | LevityPolymorphism Operating System: Unknown/Multiple | Architecture: Type of failure: GHC accepts | Unknown/Multiple invalid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by dfeuer): * component: Compiler => Compiler (Type checker) * milestone: => 8.4.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13435#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13435: Segfaults on levity-polymorphic type class
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.4.1
Component: Compiler (Type | Version: 8.0.1
checker) | Keywords:
Resolution: | LevityPolymorphism
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC accepts | Unknown/Multiple
invalid program | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg

#13435: Segfaults on levity-polymorphic type class -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.0.1 checker) | Keywords: Resolution: | LevityPolymorphism Operating System: Unknown/Multiple | Architecture: Type of failure: GHC accepts | Unknown/Multiple invalid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => merge * milestone: 8.4.1 => 8.2.1 Comment: Levity polymorphism will evolve, and so I think it's worth merging. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13435#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13435: Segfaults on levity-polymorphic type class -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.0.1 checker) | Keywords: Resolution: | LevityPolymorphism Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | typecheck/should_run/T13435 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * testcase: => typecheck/should_run/T13435 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13435#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13435: Segfaults on levity-polymorphic type class -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.0.1 checker) | Keywords: Resolution: | LevityPolymorphism Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: | typecheck/should_run/T13435 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by dfeuer): * failure: GHC accepts invalid program => Runtime crash Comment: Guess I was wrong.... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13435#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13435: Segfaults on levity-polymorphic type class -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.0.1 checker) | Keywords: Resolution: | LevityPolymorphism Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: | typecheck/should_run/T13435 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): I don't get this. David says it crashes; Richard adds a test that succeeds. Who is right? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13435#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13435: Segfaults on levity-polymorphic type class -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.0.1 checker) | Keywords: Resolution: fixed | LevityPolymorphism Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: | typecheck/should_run/T13435 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-8.2` as d40d5e8b40a1a795fef43f0abdf7aaf143fca911. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13435#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13435: Segfaults on levity-polymorphic type class -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.0.1 checker) | Keywords: Resolution: fixed | LevityPolymorphism Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: | typecheck/should_run/T13435 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by dfeuer): I was just wrong, I believe. Sorry. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13435#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13435: Segfaults on levity-polymorphic type class -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.0.1 checker) | Keywords: Resolution: fixed | LevityPolymorphism Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: | typecheck/should_run/T13435 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): During my levity-polymorphism sweep, I saw that this was newly working. I'm not sure exactly what did it, but the seg-fault is gone, and the program looks good to me. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13435#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13435: Segfaults on levity-polymorphic type class -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.0.1 checker) | Keywords: Resolution: fixed | LevityPolymorphism Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: | typecheck/should_run/T13435 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): Great! Cheers Richard -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13435#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC