[GHC] #9975: RecordWildCards and PatternSynonyms cause impossible bug

#9975: RecordWildCards and PatternSynonyms cause impossible bug -------------------------------------+------------------------------------- Reporter: gamegoblin | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Keywords: | Operating System: MacOS X RecordWildCards PatternSynonyms | Type of failure: Compile-time Architecture: x86_64 | crash (amd64) | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- When using RecordWildCards with PatternSynonyms, I have found a way to cause this bug: $ /usr/local/bin/ghc-7.10.0.20141222 test.hs [1 of 1] Compiling Main ( test.hs, test.o ) ghc: panic! (the 'impossible' happened) (GHC version 7.10.0.20141222 for x86_64-apple-darwin): find_tycon Test [Test defined at test.hs:6:9, Test parent:Test defined at test.hs:4:13] Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug Here is the full code that causes it: {{{#!hs {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE PatternSynonyms #-} data Test = Test { x :: Int } pattern Test wat = Test { x = wat } }}} If you remove RecordWildCards, the bug does not happen. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9975 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9975: RecordWildCards and PatternSynonyms cause impossible bug -------------------------------------+------------------------------------- Reporter: gamegoblin | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: MacOS X | RecordWildCards PatternSynonyms Type of failure: Compile-time | Architecture: x86_64 crash | (amd64) Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by gamegoblin): * version: 7.8.4 => 7.10.1-rc1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9975#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9975: RecordWildcards and PatternSynonyms cause impossible bug -------------------------------------+------------------------------------- Reporter: gamegoblin | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: MacOS X | RecordWildcards PatternSynonyms Type of failure: Compile-time | Architecture: x86_64 crash | (amd64) Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by gamegoblin): * keywords: RecordWildCards PatternSynonyms => RecordWildcards PatternSynonyms Old description:
When using RecordWildCards with PatternSynonyms, I have found a way to cause this bug:
$ /usr/local/bin/ghc-7.10.0.20141222 test.hs [1 of 1] Compiling Main ( test.hs, test.o ) ghc: panic! (the 'impossible' happened) (GHC version 7.10.0.20141222 for x86_64-apple-darwin): find_tycon Test [Test defined at test.hs:6:9, Test parent:Test defined at test.hs:4:13]
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Here is the full code that causes it:
{{{#!hs {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE PatternSynonyms #-} data Test = Test { x :: Int } pattern Test wat = Test { x = wat } }}}
If you remove RecordWildCards, the bug does not happen.
New description: When using RecordWildcards with PatternSynonyms, I have found a way to cause this bug: $ /usr/local/bin/ghc-7.10.0.20141222 test.hs [1 of 1] Compiling Main ( test.hs, test.o ) ghc: panic! (the 'impossible' happened) (GHC version 7.10.0.20141222 for x86_64-apple-darwin): find_tycon Test [Test defined at test.hs:6:9, Test parent:Test defined at test.hs:4:13] Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug Here is the full code that causes it: {{{#!hs {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE PatternSynonyms #-} data Test = Test { x :: Int } pattern Test wat = Test { x = wat } }}} If you remove RecordWildCards, the bug does not happen. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9975#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9975: RecordWildcards and PatternSynonyms cause impossible bug -------------------------------------+------------------------------------- Reporter: gamegoblin | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | RecordWildcards PatternSynonyms Type of failure: Compile-time | Architecture: x86_64 crash | (amd64) Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by hvr): * cc: cactus (added) * os: MacOS X => Unknown/Multiple * milestone: => 7.10.1 Old description:
When using RecordWildcards with PatternSynonyms, I have found a way to cause this bug:
$ /usr/local/bin/ghc-7.10.0.20141222 test.hs [1 of 1] Compiling Main ( test.hs, test.o ) ghc: panic! (the 'impossible' happened) (GHC version 7.10.0.20141222 for x86_64-apple-darwin): find_tycon Test [Test defined at test.hs:6:9, Test parent:Test defined at test.hs:4:13]
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Here is the full code that causes it:
{{{#!hs {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE PatternSynonyms #-} data Test = Test { x :: Int } pattern Test wat = Test { x = wat } }}}
If you remove RecordWildCards, the bug does not happen.
New description: When using RecordWildcards with PatternSynonyms, I have found a way to cause this bug: {{{ $ /usr/local/bin/ghc-7.10.0.20141222 test.hs [1 of 1] Compiling Main ( test.hs, test.o ) ghc: panic! (the 'impossible' happened) (GHC version 7.10.0.20141222 for x86_64-apple-darwin): find_tycon Test [Test defined at test.hs:6:9, Test parent:Test defined at test.hs:4:13] Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} Here is the full code that causes it: {{{#!hs {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE PatternSynonyms #-} data Test = Test { x :: Int } pattern Test wat = Test { x = wat } }}} If you remove `RecordWildCards`, the bug does not happen. -- Comment: Maybe this was fixed already, as I can't reproduce it anymore with a current `ghc-7.10` snapshot: {{{ $ ghc-7.10.0.20150119 -c test.hs test.hs:4:1: Multiple declarations of ‘Test’ Declared at: test.hs:3:13 test.hs:4:1 }}} It may be worth bisecting to find out which commit fixed it, unless cactus happens to know already which commit fixed it... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9975#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9975: RecordWildcards and PatternSynonyms cause impossible bug -------------------------------------+------------------------------------- Reporter: gamegoblin | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | RecordWildcards PatternSynonyms Type of failure: Compile-time | Architecture: x86_64 crash | (amd64) Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by cactus): Is 7.10.1-rc1 properly tagged in Git? I can't seem to find the exact commit corresponding to it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9975#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9975: RecordWildcards and PatternSynonyms cause impossible bug -------------------------------------+------------------------------------- Reporter: gamegoblin | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | RecordWildcards PatternSynonyms Type of failure: Compile-time | Architecture: x86_64 crash | (amd64) Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by hvr): cactus, it's not tagged (RCs weren't tagged in the past either), but luckily `ghc --info` nowadays spits out the commit id (and it's contained in the src tarball), so it's: {{{ $ tar xOf ghc-7.10.0.20141222-src.tar.xz --wildcards '*/GIT_COMMIT_ID' a8c556dfca3eca5277615cc2bf9d6c8f1f143c9a }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9975#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9975: RecordWildcards and PatternSynonyms cause impossible bug
-------------------------------------+-------------------------------------
Reporter: gamegoblin | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.10.1
Component: Compiler | Version: 7.10.1-rc1
Resolution: | Keywords:
Operating System: Unknown/Multiple | RecordWildcards PatternSynonyms
Type of failure: Compile-time | Architecture: x86_64
crash | (amd64)
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#9975: RecordWildcards and PatternSynonyms cause impossible bug -------------------------------------+------------------------------------- Reporter: gamegoblin | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.10.1-rc1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | RecordWildcards PatternSynonyms Type of failure: Compile-time | Architecture: x86_64 crash | (amd64) Blocked By: | Test Case: Related Tickets: | patsyn/should_compile/T9975a,b | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * testcase: => patsyn/should_compile/T9975a,b * resolution: => fixed Comment: I'm not sure what fixed it, but I'm content to let sleeping dogs lie. I've added a regression test though. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9975#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9975: RecordWildcards and PatternSynonyms cause impossible bug -------------------------------------+------------------------------------- Reporter: gamegoblin | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.10.1-rc1 Resolution: fixed | Keywords: | RecordWildcards PatternSynonyms Operating System: Unknown/Multiple | Architecture: x86_64 | (amd64) Type of failure: Compile-time | Test Case: crash | patsyn/should_compile/T9975a,b Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by adamgundry): See also #11283, which is essentially the same bug. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9975#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC