Opened 2 years ago

Closed 2 years ago

#8882 closed bug (fixed)

internal error (deriving generic / cyclical imports?)

Reported by: mf825 Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.6.3
Keywords: panic Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: GHCi crash Test Case:
Blocked By: Blocking:
Related Tickets: 7878, 8374 Differential Rev(s):
Wiki Page:


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 ./ (Possibly you don't need to populate the sandbox and can crash it manually in your environment right away.)

Attachments (1)

ghc-bug.tar.bz2 (1.6 KB) - added by mf825 2 years ago.

Download all attachments as: .zip

Change History (8)

Changed 2 years ago by mf825


comment:1 Changed 2 years ago by thoughtpolice

This seems to be fixed in 7.8.1. Using 7.8.1-rc2, running I get:

$ ./
... 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.

comment:2 Changed 2 years ago by simonpj

See also #8374

Try with -fno-warn-amp?


comment:3 Changed 2 years ago by monoidal

I'm almost certain this is #7878.

comment:4 Changed 2 years ago 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 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. i am ok with closing this issue.

thanks everybody for the great help!

Last edited 2 years ago by mf825 (previous) (diff)

comment:5 Changed 2 years ago by mf825

comment:6 Changed 2 years ago 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.

comment:7 Changed 2 years ago by monoidal

  • Resolution set to fixed
  • Status changed from new to closed

Closing, as discussed above.

Note: See TracTickets for help on using tickets.