
#10058: Panic: Loading temp shared object failed -----------------------------------------+--------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.10.1-rc2 Keywords: | Operating System: MacOS X Architecture: x86_64 (amd64) | Type of failure: None/Unknown Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -----------------------------------------+--------------------------------- I ran into a panic when updating `singletons` for 7.10. I'm clueless as to what's going on here, so sorry for not minimizing the test case. A little testing has me convinced it's Template Haskell in some way. To reproduce: {{{
git clone http://github.com/goldfirere/singletons.git cd singletons git checkout ghc-loading-panic-test-case cabal update cabal install --only-dependencies cabal configure cabal build cat dist/build/autogen/cabal_macros.h # copy the value for CURRENT_PACKAGE_KEY from the end of cabal_macros.h cd tests/compile-and-dump ghc -c -this-package-key <package key from cabal_macros.h> -i../../dist/build -XTemplateHaskell Singletons/Maybe.hs }}}
You will see something like {{{ ghc: panic! (the 'impossible' happened) (GHC version 7.10.0.20150123 for x86_64-apple-darwin): Loading temp shared object failed: dlopen(/var/folders/ps/s45r2x1s6r15ws78py_zypl00000gn/T/ghc45837_0/libghc45837_1.dylib, 5): Symbol not found: _mtlzuJNaGzzEkFfL43R3LZZNRlPRm_ControlziMonadziReaderziClass_DZCMonadReader_con_info Referenced from: /var/folders/ps/s45r2x1s6r15ws78py_zypl00000gn/T/ghc45837_0/libghc45837_1.dylib Expected in: flat namespace in /var/folders/ps/s45r2x1s6r15ws78py_zypl00000gn/T/ghc45837_0/libghc45837_1.dylib Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} I've observed this on a Mac, but Travis has the same problem, so it's not strictly Mac-specific. You can see representative Travis output [https ://travis-ci.org/goldfirere/singletons/jobs/49103793 here]. Why am I doing such a crazy thing? It's part of the `singletons` test suite, where it's important to test the output of a run of ghc with `-ddump-splices`. Getting the test cases to compile against the built-but- not-yet-installed `singletons` object files should work with `-this- package-key`. I'm sure there's a better way to structure a testsuite, but this general technique works (with `-package-name` instead of `-this- package-key`) with 7.8. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10058 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler