[GHC] #14972: MacOS panic on TH
GHC
ghc-devs at haskell.org
Sun Apr 1 00:44:48 UTC 2018
#14972: MacOS panic on TH
-------------------------------------+-------------------------------------
Reporter: harpocrates | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.4.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
crash or panic | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by ezyang):
I've diagnosed the proximate cause. In the failing version of the
compiler, an inplace build creates a `gmp` directory in `libraries
/integer-gmp/dist-install/build/`:
{{{
MacBook-Pro-97:ghc-quick1 ezyang$ ls libraries/integer-gmp/dist-
install/build/
GHC gmp
HSinteger-gmp-1.0.1.0.o include
autogen integer-gmp.buildinfo
cbits libHSinteger-
gmp-1.0.1.0-ghc8.5.20180331.dylib
config.log libHSinteger-gmp-1.0.1.0.a
config.status
}}}
Unfortuantely, this changes the behavior of our print file name
invocation:
{{{
MacBook-Pro-97:ghc-quick1 ezyang$ gcc -fno-stack-protector
-DTABLES_NEXT_TO_CODE -B/Users/ezyang/Dev/ghc-quick1/libraries/integer-gmp
/dist-install/build --print-file-name gmp
/Users/ezyang/Dev/ghc-quick1/libraries/integer-gmp/dist-install/build/gmp
}}}
This should return `gmp`. When it returns a file path, we attempt to open
this location, which clearly will not work:
{{{
*** gcc:
gcc -fno-stack-protector -DTABLES_NEXT_TO_CODE -B/Users/ezyang/Dev/ghc-
quick1/libraries/integer-gmp/dist-install/build --print-file-name gmp
addLibrarySearchPath: dll_path = `/Users/ezyang/Dev/ghc-quick1/libraries
/integer-gmp/dist-install/build'
Loading package integer-gmp-1.0.1.0 ... addDLL: dll_name =
'/Users/ezyang/Dev/ghc-quick1/libraries/integer-gmp/dist-install/build
/libHSinteger-gmp-1.0.1.0-ghc8.5.20180331.dylib'
internal_dlopen: dll_name = '/Users/ezyang/Dev/ghc-quick1/libraries
/integer-gmp/dist-install/build/libHSinteger-
gmp-1.0.1.0-ghc8.5.20180331.dylib'
loadArchive: start
loadArchive: Loading archive `/Users/ezyang/Dev/ghc-quick1/libraries
/integer-gmp/dist-install/build/gmp'
ghc-stage2: loadArchive: Failed reading header from `/Users/ezyang/Dev
/ghc-quick1/libraries/integer-gmp/dist-install/build/gmp'
loadArchive: done
*** Deleting temp files:
Deleting:
*** Deleting temp dirs:
Deleting:
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.5.20180331 for x86_64-apple-darwin):
loadArchive "/Users/ezyang/Dev/ghc-quick1/libraries/integer-gmp
/dist-install/build/gmp": failed
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
}}}
I hazard some change in Cabal caused the 'gmp' directory to be created.
Not entirely sure what the correct fix is yet.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14972#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list