[GHC] #13461: Panic on compile of file with a hole, importing a module with a lot of identifiers

#13461: Panic on compile of file with a hole, importing a module with a lot of identifiers -------------------------------------+------------------------------------- Reporter: Tritlo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 (Type checker) | Keywords: | Operating System: MacOS X Architecture: x86_64 | Type of failure: None/Unknown (amd64) | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- So I was trying to test the performance of `validSubstitutions`, I generated a file with a lot of identifiers, and compiled it with my current GHC, `The Glorious Glasgow Haskell Compilation System, version 8.0.2`. The example was very simple, just: {{{ import ManyIds test :: Int -> Int test = _ }}} Where `ManyIds.hs` was generated with the python script: {{{ print("module ManyIds where") print() for i in range(10000): print("a{} :: Int -> Int".format(i)) print("a{} _ = {}".format(i,i)) print() }}} i.e. it has a lot of identifiers of the form {{{ ... a1337 :: Int -> Int a1337 _ = 1337 a1338 :: Int -> Int a1338 _ = 1338 ... }}} The error I got was: {{{ [2 of 2] Compiling Main ( manyIdsTest.hs, manyIdsTest.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.2 for x86_64-apple-darwin): initTc: unsolved constraints WC {wc_insol = [W] __a5IO :: t_a5IN[tau:1] (CHoleCan: _)} Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13461 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13461: Panic on compile of file with a hole and nothing else -------------------------------------+------------------------------------- Reporter: Tritlo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.2 checker) | Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by Tritlo: Old description:
So I was trying to test the performance of `validSubstitutions`, I generated a file with a lot of identifiers, and compiled it with my current GHC, `The Glorious Glasgow Haskell Compilation System, version 8.0.2`.
The example was very simple, just:
{{{ import ManyIds
test :: Int -> Int test = _ }}}
Where `ManyIds.hs` was generated with the python script: {{{ print("module ManyIds where") print()
for i in range(10000): print("a{} :: Int -> Int".format(i)) print("a{} _ = {}".format(i,i)) print() }}}
i.e. it has a lot of identifiers of the form
{{{ ... a1337 :: Int -> Int a1337 _ = 1337
a1338 :: Int -> Int a1338 _ = 1338 ... }}}
The error I got was:
{{{ [2 of 2] Compiling Main ( manyIdsTest.hs, manyIdsTest.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.2 for x86_64-apple-darwin): initTc: unsolved constraints WC {wc_insol = [W] __a5IO :: t_a5IN[tau:1] (CHoleCan: _)}
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}}
New description: The example is very simple, just: {{{ test :: Int -> Int test = _ }}} which produces the panic: {{{ [1 of 1] Compiling Main ( manyIdsTest.hs, manyIdsTest.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.2 for x86_64-apple-darwin): initTc: unsolved constraints WC {wc_insol = [W] __awc :: t_awb[tau:1] (CHoleCan: _)} }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13461#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13461: Panic on compile of file with a hole and nothing else -------------------------------------+------------------------------------- Reporter: Tritlo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.2 checker) | Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Old description:
The example is very simple, just:
{{{ test :: Int -> Int test = _ }}}
which produces the panic:
{{{ [1 of 1] Compiling Main ( manyIdsTest.hs, manyIdsTest.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.2 for x86_64-apple-darwin): initTc: unsolved constraints WC {wc_insol = [W] __awc :: t_awb[tau:1] (CHoleCan: _)} }}}
New description: The example is very simple, just: {{{ test :: Int -> Int test = _ }}} which produces the panic: {{{ [1 of 1] Compiling Main ( manyIdsTest.hs, manyIdsTest.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.2 for x86_64-apple-darwin): initTc: unsolved constraints WC {wc_insol = [W] __awc :: t_awb[tau:1] (CHoleCan: _)} }}} I suspect that there might be a missing case when there is nothing else in scope. -- Comment (by Tritlo): Replying to [ticket:13461 Tritlo]:
The example is very simple, just:
{{{ test :: Int -> Int test = _ }}}
which produces the panic:
{{{ [1 of 1] Compiling Main ( manyIdsTest.hs, manyIdsTest.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.2 for x86_64-apple-darwin): initTc: unsolved constraints WC {wc_insol = [W] __awc :: t_awb[tau:1] (CHoleCan: _)} }}}
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13461#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13461: Panic on compile of file with a hole and nothing else -------------------------------------+------------------------------------- Reporter: Tritlo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.2 checker) | Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by Tritlo: Old description:
The example is very simple, just:
{{{ test :: Int -> Int test = _ }}}
which produces the panic:
{{{ [1 of 1] Compiling Main ( manyIdsTest.hs, manyIdsTest.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.2 for x86_64-apple-darwin): initTc: unsolved constraints WC {wc_insol = [W] __awc :: t_awb[tau:1] (CHoleCan: _)} }}}
I suspect that there might be a missing case when there is nothing else in scope.
New description: The example is very simple, just: {{{ test :: Int -> Int test = _ }}} which produces the panic: {{{ [1 of 1] Compiling Main ( manyIdsTest.hs, manyIdsTest.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.2 for x86_64-apple-darwin): initTc: unsolved constraints WC {wc_insol = [W] __awc :: t_awb[tau:1] (CHoleCan: _)} }}} I suspect that there might be a missing case when there is nothing else in scope, since {{{ test :: Int -> Int test = _ main :: IO () main = return () }}} compiles just fine (i.e. with no panic, but still reports the typed hole. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13461#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13461: Panic on compile of file with a hole and nothing else -------------------------------------+------------------------------------- Reporter: Tritlo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.2 checker) | Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Could this be #13106? Try with HEAD? Thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13461#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13461: Panic on compile of file with a hole and nothing else -------------------------------------+------------------------------------- Reporter: Tritlo | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.2 checker) | Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Tritlo): * status: new => merge Comment: It works on HEAD! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13461#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13461: Panic on compile of file with a hole and nothing else -------------------------------------+------------------------------------- Reporter: Tritlo | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.2 checker) | Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Tritlo): * status: merge => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13461#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13461: Panic on compile of file with a hole and nothing else -------------------------------------+------------------------------------- Reporter: Tritlo | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.2 checker) | Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Tritlo): * status: closed => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13461#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13461: Panic on compile of file with a hole and nothing else -------------------------------------+------------------------------------- Reporter: Tritlo | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.2 checker) | Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Tritlo): * status: merge => closed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13461#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC