[GHC] #10301: Plugins/dynamic loading subtly broken (it seems)

GHC ghc-devs at haskell.org
Tue Apr 14 12:44:00 UTC 2015


#10301: Plugins/dynamic loading subtly broken (it seems)
-------------------------------------+-------------------------------------
              Reporter:              |             Owner:
  thoughtpolice                      |            Status:  new
                  Type:  bug         |         Milestone:  7.10.2
              Priority:  normal      |           Version:  7.8.2
             Component:  Compiler    |  Operating System:  Unknown/Multiple
              Keywords:              |   Type of failure:  Compile-time
          Architecture:              |  crash
  Unknown/Multiple                   |        Blocked By:
             Test Case:              |   Related Tickets:  #8276
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 Imported from #8276, which was originally about a Haddock bug (that was
 different in nature but appeared similarly):

 > I still experience this panic on GHC 7.8.2 with Windows x86_64:
 >
 > {{{
 > $ ghci
 > GHCi, version 7.8.2: http://www.haskell.org/ghc/  :? for help
 > Loading package ghc-prim ... linking ... done.
 > Loading package integer-gmp ... linking ... done.
 > Loading package base ... linking ... done.
 > λ> import StaticFlags
 > λ> import Data.IORef
 > λ> readIORef v_opt_C_ready
 > Loading package array-0.5.0.0 ... linking ... done.
 > Loading package deepseq-1.3.0.2 ... linking ... done.
 > Loading package bytestring-0.10.4.0 ... linking ... done.
 > Loading package containers-0.5.5.1 ... linking ... done.
 > Loading package Win32-2.3.0.2 ... linking ... done.
 > Loading package filepath-1.3.0.2 ... linking ... done.
 > Loading package old-locale-1.0.0.6 ... linking ... done.
 > Loading package time-1.4.2 ... linking ... done.
 > Loading package directory-1.2.1.0 ... linking ... done.
 > Loading package pretty-1.1.1.1 ... linking ... done.
 > Loading package process-1.2.0.0 ... linking ... done.
 > Loading package Cabal-1.18.1.3 ... linking ... done.
 > Loading package binary-0.7.1.0 ... linking ... done.
 > Loading package bin-package-db-0.0.0.0 ... linking ... done.
 > Loading package hoopl-3.10.0.1 ... linking ... done.
 > Loading package hpc-0.6.0.1 ... linking ... done.
 > Loading package template-haskell ... linking ... done.
 > Loading package transformers-0.3.0.0 ... linking ... done.
 > Loading package ghc-7.8.2 ... linking ... done.
 > False
 > λ> staticFlags
 > ghc.exe: panic! (the 'impossible' happened)
 >   (GHC version 7.8.2 for x86_64-unknown-mingw32):
 >         Static flags have not been initialised!
 >         Please call GHC.parseStaticFlags early enough.
 >
 > Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
 > }}}
 >
 > But not with GHC 7.8.2 on Linux x86_64:
 >
 > {{{
 > $ ghci
 > GHCi, version 7.8.2: http://www.haskell.org/ghc/  :? for help
 > Loading package ghc-prim ... linking ... done.
 > Loading package integer-gmp ... linking ... done.
 > Loading package base ... linking ... done.
 > λ> import StaticFlags
 > λ> import Data.IORef
 > λ> readIORef v_opt_C_ready
 > Loading package array-0.5.0.0 ... linking ... done.
 > Loading package deepseq-1.3.0.2 ... linking ... done.
 > Loading package bytestring-0.10.4.0 ... linking ... done.
 > Loading package containers-0.5.5.1 ... linking ... done.
 > Loading package filepath-1.3.0.2 ... linking ... done.
 > Loading package old-locale-1.0.0.6 ... linking ... done.
 > Loading package time-1.4.2 ... linking ... done.
 > Loading package directory-1.2.1.0 ... linking ... done.
 > Loading package pretty-1.1.1.1 ... linking ... done.
 > Loading package process-1.2.0.0 ... linking ... done.
 > Loading package Cabal-1.18.1.3 ... linking ... done.
 > Loading package binary-0.7.1.0 ... linking ... done.
 > Loading package bin-package-db-0.0.0.0 ... linking ... done.
 > Loading package hoopl-3.10.0.1 ... linking ... done.
 > Loading package hpc-0.6.0.1 ... linking ... done.
 > Loading package template-haskell ... linking ... done.
 > Loading package transformers-0.3.0.0 ... linking ... done.
 > Loading package ghc-7.8.2 ... linking ... done.
 > True
 > λ> staticFlags
 > []
 > }}}
 >
 > This has caused problems for me when running programs such as
 [https://github.com/ku-fpg/hermit/ HERMIT] on Windows, since at some
 point, {{{parseStaticFlagsFull}}} seems to be called during program
 execution. A workaround is to call {{{initStaticOpts}}} manually somewhere
 in the program, but I feel like that shouldn't be necessary.

 The one above was on Windows. Also reported:

 > Hello,
 >
 > A similar panic also happens when running Liquid Haskell
 [http://goto.ucsd.edu/~rjhala/liquid/haskell/blog/about/] on a file that
 uses the Units of Measure plugin [https://github.com/adamgundry/uom-
 plugin]
 >
 >
 > {{{
 > liquid: liquid: panic! (the 'impossible' happened)
 >   (GHC version 7.10.1 for x86_64-unknown-linux):
 >       Static flags have not been initialised!
 >         Please call GHC.parseStaticFlags early enough.
 > }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10301>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list