[GHC] #12152: panic: Loading temp shared object failed

#12152: panic: Loading temp shared object failed -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 (Linking) | Keywords: | Operating System: Linux Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I've attached a no-Haskell-code project that fails when I run `cabal repl` with the following: {{{ ghc: panic! (the 'impossible' happened) (GHC version 7.10.3 for x86_64-unknown-linux): Loading temp shared object failed: /tmp/ghc60744_0/libghc_1.so: undefined symbol: _ZN2Zq1qE }}} Building the project works fine, so the problem seems to be (only) with dynamic linking. The issue can be resolved by swapping the order of the .cpp files in the cabal file. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12152 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12152: panic: Loading temp shared object failed -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 (Linking) | Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by crockeea): * Attachment "bug.tar.gz" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12152 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12152: panic: Loading temp shared object failed -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 (Linking) | Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by crockeea: @@ -2,1 +2,1 @@ - with the following: + with the following error: New description: I've attached a no-Haskell-code project that fails when I run `cabal repl` with the following error: {{{ ghc: panic! (the 'impossible' happened) (GHC version 7.10.3 for x86_64-unknown-linux): Loading temp shared object failed: /tmp/ghc60744_0/libghc_1.so: undefined symbol: _ZN2Zq1qE }}} Building the project works fine, so the problem seems to be (only) with dynamic linking. The issue can be resolved by swapping the order of the .cpp files in the cabal file. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12152#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12152: panic: Loading temp shared object failed -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 (Linking) | Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by crockeea): * Attachment "testcase2.tar.gz" added. Another test case that produces a similar error. May or may not be the same issue. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12152 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12152: panic: Loading temp shared object failed -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 (Linking) | Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by crockeea): In bug.tar.gz, a workaround to get `cabal repl` working is to swap the order of the cpp files in the `c-sources` section of the cabal file. However, stack links the `c-sources` in alphabetical order, regardless of the order in the cabal file. This means I still get the linking error when I run `stack ghci` (if the file that should be linked first is alphabetically after another c-source file), and I don't know of a workaround in that case. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12152#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12152: panic: Loading temp shared object failed -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 (Linking) | Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by crockeea): * failure: None/Unknown => GHCi crash -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12152#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12152: panic: Loading temp shared object failed -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 (Linking) | Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by crockeea): Workaround for testcase2: link with g++ using `ghc-options: -pgmlg++`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12152#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12152: panic: Loading temp shared object failed -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 (Linking) | Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): I don't know why but for me `cabal repl` doesn't even attempt to launch an interpreter for your `bug`, it just builds the project. Can you give instructions to reproduce that don't depend on cabal (or stack)? It may be a cabal bug. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12152#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12152: panic: Loading temp shared object failed -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 (Linking) | Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): Never mind, it's just `ghci b.o a.o`, where `b.o` refers to data (not a function) defined in `a.o`. You don't need C++ either. We should probably link together all `.o` files given on the command line at once. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12152#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12152: panic: Loading temp shared object failed -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1 (Linking) | Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * version: 7.10.3 => 7.8.1 Comment: Testcase for comment:6: a.c: {{{#!c int x; }}} b.c: {{{#!c extern int x; int f(void) { return x; } }}} {{{ $ ghc -c a.c -fPIC && ghc -c b.c -fPIC }}} ok: {{{ $ ghci a.o b.o Prelude> }}} not ok: {{{ $ ghci b.o a.o ghc: panic! (the 'impossible' happened) (GHC version 8.0.1 for x86_64-unknown-linux): Loading temp shared object failed: /tmp/ghc19123_0/libghc_1.so: undefined symbol: x }}} I can not reproduce the problem on Windows (`DYNAMIC_GHC_PROGRAMS=NO`). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12152#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12152: panic: Loading temp shared object failed -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1 (Linking) | Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by basvandijk): * cc: v.dijk.bas@… (added) Comment: I'm having a similar / the same problem after upgrading to NixOS-16.09. Details are here: https://github.com/NixOS/nixpkgs/issues/18558 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12152#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12152: panic: Loading temp shared object failed -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1 (Linking) | Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by crockeea): This appears to be fixed in 8.2. @basvandijk, can you confirm for your case? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12152#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12152: panic: Loading temp shared object failed -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.2.2 Component: Compiler | Version: 7.8.1 (Linking) | Resolution: fixed | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed * milestone: => 8.2.2 Comment: I'm going to close this under the assumption that it is fixed. Feel free to reopen if not. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12152#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12152: panic: Loading temp shared object failed -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.2.2 Component: Compiler | Version: 7.8.1 (Linking) | Resolution: fixed | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by toonn): I think I ran into this with 8.2.2: {{{ Loading cabal new-repl --ghc-options=-fobject-code test-suite:mpw ... Build profile: -w ghc-8.2.2 -O1 In order, the following will be built (use -v for more details): - skeletonkey-0.0.0.0 (test:mpw) (file tests/Main.hs changed) Preprocessing test suite 'mpw' for skeletonkey-0.0.0.0.. GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help <no location info>: warning: [-Wmissing-home-modules] These modules are needed for compilation but not listed in your .cabal file's other-modules: KDF MAC MPAlgorithm MPW.Path MPW.Test MPWTemplates Types Ok, 8 modules loaded. All good (8 modules, at 13:42:23) Running test... ghc: panic! (the 'impossible' happened) (GHC version 8.2.2 for x86_64-unknown-linux): Loading temp shared object failed: /tmp/ghc24637_0/libghc_3.so: undefined symbol: MPWziPath_mpwTestsXml_closure Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug ...done }}} I created `MPW.Path` so I could avoid having `{-# LANGUAGE CPP #-}` in `MPW.Tests` because that doesn't agree with string gaps. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12152#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12152: panic: Loading temp shared object failed -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.2.2 Component: Compiler | Version: 7.8.1 (Linking) | Resolution: fixed | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by toonn): Seems I was too quick. Rerunning the ghcid command gave the same error message but running it after a run of `cabal new-test` has fixed the problem. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12152#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC