[GHC] #8882: internal error (deriving generic / cyclical imports?)

#8882: internal error (deriving generic / cyclical imports?) ----------------------------------+------------------------------- Reporter: mf825 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Keywords: panic | Operating System: Linux Architecture: x86_64 (amd64) | Type of failure: GHCi crash Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ----------------------------------+------------------------------- Hi everybody, I often get compiler crashes in my larger and less well-maintained projects of this sort: ghc: panic! (the 'impossible' happened) (GHC version 7.6.3 for x86_64-unknown-linux): tcIfaceGlobal (local): not found: <<details unavailable>> This happened on earlier 7.* ghc versions (debian 64bit), and from the counter-example I have condensed today my vague guess is that it has something to do with cyclical imports and -XDerivingGeneric or some other type system related language extension. I witnessed this in both ghc and ghci, but the counter-example is in ghci. I want to investigate this further later, but in the hope that somebody can immediately see what's wrong, I decided to open this ticket with my preliminary findings. Just unpack and run ./crash.sh. (Possibly you don't need to populate the sandbox and can crash it manually in your environment right away.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8882 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8882: internal error (deriving generic / cyclical imports?) -------------------------------+---------------------------------- Reporter: mf825 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: panic Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+---------------------------------- Comment (by thoughtpolice): This seems to be fixed in 7.8.1. Using 7.8.1-rc2, running `crash.sh` I get: {{{ $ ./crash.sh ... lots of stuff ... Loading package profunctors-4.0.2 ... linking ... done. Loading package reflection-1.4 ... linking ... done. Loading package split-0.2.2 ... linking ... done. Loading package void-0.6.1 ... linking ... done. Loading package lens-4.0.5 ... linking ... done. [1 of 5] Compiling Adhocracy.DataModel.Types ( src/Adhocracy/DataModel/Types.hs, interpreted ) [2 of 5] Compiling Adhocracy.Types ( src/Adhocracy/Types.hs, interpreted ) [3 of 5] Compiling Adhocracy.DataModel.Universes[boot] ( src/Adhocracy/DataModel/Universes.hs-boot, interpreted ) [4 of 5] Compiling Adhocracy.DataModel.Default ( src/Adhocracy/DataModel/Default.hs, interpreted ) [5 of 5] Compiling Adhocracy.DataModel.Universes ( src/Adhocracy/DataModel/Universes.hs, interpreted ) Ok, modules loaded: Adhocracy.DataModel.Default, Adhocracy.DataModel.Types, Adhocracy.DataModel.Universes, Adhocracy.DataModel.Universes, Adhocracy.Types. *Adhocracy.DataModel.Default> *Adhocracy.DataModel.Default Adhocracy.DataModel.Default> Top level: Not in scope: data constructor ‘WDF’ }}} The last error message looks like a bug in your script since I have no idea where `WDF` is supposed to come from. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8882#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8882: internal error (deriving generic / cyclical imports?) -------------------------------+---------------------------------- Reporter: mf825 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: panic Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+---------------------------------- Comment (by simonpj): See also #8374 Try with `-fno-warn-amp`? Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8882#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8882: internal error (deriving generic / cyclical imports?) -------------------------------+---------------------------------- Reporter: mf825 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: panic Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+---------------------------------- Comment (by monoidal): I'm almost certain this is #7878. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8882#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8882: internal error (deriving generic / cyclical imports?) -------------------------------+---------------------------------- Reporter: mf825 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: panic Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+---------------------------------- Comment (by mf825): @thoughpolice: you are right, WDF got shrunk away at some point, but the fact that you are getting this far without the bug showing proves that it is gone in 7.8 (assuming this is what you used to run crash.sh). great! @simon: ghc-7.6.3 does not understand -fno-warn-amp, and i could not find it in the manual either. if you still think it is relevant, could you give me another hint? @monoidal: yes, that seems likely. in my case, the -XDerivingGeneric is in module Default, and the hs-boot file belongs to module Universes. but when i disable DerivingGeneric in Default, the problem goes away. i think i'll try to get 7.8 running now. Ii am ok with closing this issue. thanks everybody for the great help! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8882#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8882: internal error (deriving generic / cyclical imports?) -------------------------------+---------------------------------- Reporter: mf825 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: panic Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: 7878, 8374 -------------------------------+---------------------------------- Changes (by mf825): * related: => 7878, 8374 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8882#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8882: internal error (deriving generic / cyclical imports?) -------------------------------+---------------------------------- Reporter: mf825 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: panic Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: 7878, 8374 -------------------------------+---------------------------------- Comment (by simonpj): I think my guess about #8374 and `-fwarn-amp` was wrong. Monoidal is likely right. In which case we can close as already-fixed. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8882#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8882: internal error (deriving generic / cyclical imports?) -------------------------------+---------------------------------- Reporter: mf825 | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: fixed | Keywords: panic Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: 7878, 8374 -------------------------------+---------------------------------- Changes (by monoidal): * status: new => closed * resolution: => fixed Comment: Closing, as discussed above. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8882#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC