[GHC] #13137: Dynamic linker not initialised.

#13137: Dynamic linker not initialised. ----------------------------------------+--------------------------------- Reporter: djduke | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Keywords: | Operating System: MacOS X Architecture: Unknown/Multiple | Type of failure: None/Unknown Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: ----------------------------------------+--------------------------------- Attempting to build accelerate-llvm-1.0.0.0 cloned from the repo at https://github.com/AccelerateHS/accelerate-llvm, using: OSX 10.12.2 (Sierra) GHC 8.0.2 Command line tools for Xcode 8.2.1 [25 of 52] Compiling Data.Range.Range ( Data/Range/Range.hs, dist/build/Data/Range/Range.o ) (GHC version 8.0.2 for x86_64-apple-darwin): Dynamic linker not initialised Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug [26 of 52] Compiling Data.Array.Accelerate.LLVM.Util ( Data/Array/Accelerate/LLVM/Util.hs, dist/build/Data/Array/Accelerate/LLVM/Util.o ) <no location info>: error: <command line>: can't load .so/.DLL for: /Users/scsdjd/Library/Haskell/ghc-8.0.2-x86_64/lib/x86_64-osx-ghc-8.0.2 /libHSllvm-general-3.8.0.0-KHGbcTTSuxFL0az0gf3S53-ghc8.0.2.dylib (dlopen(/Users/scsdjd/Library/Haskell/ghc-8.0.2-x86_64/lib/x86_64-osx- ghc-8.0.2/libHSllvm-general-3.8.0.0-KHGbcTTSuxFL0az0gf3S53-ghc8.0.2.dylib, 5): Symbol not found: __ZTIN4llvm11InstructionE Referenced from: /Users/scsdjd/Library/Haskell/ghc-8.0.2-x86_64/lib/x86_64-osx-ghc-8.0.2 /libHSllvm-general-3.8.0.0-KHGbcTTSuxFL0az0gf3S53-ghc8.0.2.dylib Expected in: flat namespace in /Users/scsdjd/Library/Haskell/ghc-8.0.2-x86_64/lib/x86_64-osx- ghc-8.0.2/libHSllvm-general-3.8.0.0-KHGbcTTSuxFL0az0gf3S53-ghc8.0.2.dylib) [27 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Ptr ( Data/Array/Accelerate/LLVM/CodeGen/Ptr.hs, dist/build/Data/Array/Accelerate/LLVM/CodeGen/Ptr.o ) <no location info>: error: ghc: panic! (the 'impossible' happened) (GHC version 8.0.2 for x86_64-apple-darwin): Dynamic linker not initialised Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug ... so I have. I note previous tickets for "Dynamic linker not initialised", but not clear they are relevant due to different OS etc. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13137 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13137: Dynamic linker not initialised. -------------------------------------+------------------------------------- Reporter: djduke | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #13093 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: Phyx- (added) * os: MacOS X => Unknown/Multiple * related: => #13093 Comment: I've also observed this on Windows at https://github.com/AccelerateHS/accelerate/pull/342#issuecomment-271469942. Sadly, I don't know yet how to trim `accelerate-llvm` down into a smaller testcase that also triggers this panic. But I strongly suspect that the solution is related to Phyx-'s planned fix for #13093. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13137#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13137: Dynamic linker not initialised. -------------------------------------+------------------------------------- Reporter: djduke | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #13093 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Phyx-): * cc: angerman (added) Comment: This is unrelated to the changes I'm currently working on (though in all likelihood you'll need it when not using the system linker). This seems to be coming from c3c702441137dc8f7ee0dd5ac313be96d625459a which is the stuff angerman has been working on. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13137#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13137: Dynamic linker not initialised. -------------------------------------+------------------------------------- Reporter: djduke | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * related: #13093 => Comment: Ah, good point. I suppose //any// linker issue might trigger this bug, and #13093 just happened to be the one. Another question is why `accelerate-llvm` seems to be tickling this bug. As far as I can tell, it doesn't use any GHC plugins or anything of the sort. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13137#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13137: Dynamic linker not initialised. -------------------------------------+------------------------------------- Reporter: djduke | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-): Don't really know, I can look into it when I'm finished with my changes. But it would be far faster if @angerman takes a look. I couldn't really find a trac issue motivating the changes. So it's a bit stabbing in the dark for me atm. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13137#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13137: Dynamic linker not initialised. -------------------------------------+------------------------------------- Reporter: djduke | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Just as a sanity check, I did confirm that this isn't an OS-specific thing, and that this affects all GHCs built with `DYNAMIC_GHC_PROGRAMS=NO`, as I managed to receive the same error on Linux with a version of GHC HEAD built with `DYNAMIC_GHC_PROGRAMS=NO`: {{{ $ cabal build Building accelerate-llvm-1.0.0.0... Preprocessing library accelerate-llvm-1.0.0.0... ghc-stage2: /usr/lib/llvm-3.8/lib/libLLVMSupport.a: unknown symbol `_ZGVZN4llvm7hashing6detail18get_execution_seedEvE4seed' ghc-stage2: Could not on-demand load symbol '_ZN4llvm16FoldingSetNodeID10AddIntegerEj' ghc-stage2: /usr/lib/llvm-3.8/lib/libLLVMSupport.a: unknown symbol `_ZN4llvm16FoldingSetNodeID10AddIntegerEj' ghc-stage2: Could not on-demand load symbol '_ZNK4llvm5APInt13EqualSlowCaseEm' ghc-stage2: /usr/lib/llvm-3.8/lib/libLLVMCore.a: unknown symbol `_ZNK4llvm5APInt13EqualSlowCaseEm' ghc-stage2: Could not on-demand load symbol '_ZNK4llvm5Value7getNameEv' ghc-stage2: /usr/lib/llvm-3.8/lib/libLLVMNVPTXCodeGen.a: unknown symbol `_ZNK4llvm5Value7getNameEv' ghc-stage2: Could not on-demand load symbol '_ZN4llvm3sys10SmartMutexILb0EED1Ev' ghc-stage2: /usr/lib/llvm-3.8/lib/libLLVMSupport.a: unknown symbol `_ZN4llvm3sys10SmartMutexILb0EED1Ev' ghc-stage2: Could not on-demand load symbol '_ZNK4llvm17ManagedStaticBase21RegisterManagedStaticEPFPvvEPFvS1_E' ghc-stage2: /usr/lib/llvm-3.8/lib/libLLVMCore.a: unknown symbol `_ZNK4llvm17ManagedStaticBase21RegisterManagedStaticEPFPvvEPFvS1_E' ghc-stage2: Could not on-demand load symbol '_ZN4llvm12PassRegistry15getPassRegistryEv' ghc-stage2: /usr/lib/llvm-3.8/lib/libLLVMLTO.a: unknown symbol `_ZN4llvm12PassRegistry15getPassRegistryEv' ghc-stage2: Could not on-demand load symbol '_ZTVN4llvm17DiagnosticPrinterE' ghc-stage2: /usr/lib/llvm-3.8/lib/libLLVMCore.a: unknown symbol `_ZTVN4llvm17DiagnosticPrinterE' ghc-stage2: Could not on-demand load symbol 'LLVMIsMultithreaded' ghc-stage2: /home/rgscott/.cabal/lib/x86_64-linux-ghc-8.1.20170116/llvm- general-3.8.0.0-ANwvTQYpoC83vup0OmjiSV/HSllvm- general-3.8.0.0-ANwvTQYpoC83vup0OmjiSV.o: unknown symbol `LLVMIsMultithreaded' [25 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Monad[boot] ( Data/Array/Accelerate/LLVM/CodeGen/Monad.hs-boot, dist/build/Data/Array/Accelerate/LLVM/CodeGen/Monad.o-boot ) [26 of 52] Compiling Data.Array.Accelerate.LLVM.Util ( Data/Array/Accelerate/LLVM/Util.hs, dist/build/Data/Array/Accelerate/LLVM/Util.o ) <no location info>: error: ghc-stage2: unable to load package `llvm-general-3.8.0.0' [27 of 52] Compiling Data.Range.Range ( Data/Range/Range.hs, dist/build/Data/Range/Range.o ) <no location info>: error: ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.1.20170116 for x86_64-unknown-linux): Dynamic linker not initialised Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug [34 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Ptr ( Data/Array/Accelerate/LLVM/CodeGen/Ptr.hs, dist/build/Data/Array/Accelerate/LLVM/CodeGen/Ptr.o ) <no location info>: error: ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.1.20170116 for x86_64-unknown-linux): Dynamic linker not initialised Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug [35 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.IR ( Data/Array/Accelerate/LLVM/CodeGen/IR.hs, dist/build/Data/Array/Accelerate/LLVM/CodeGen/IR.o ) <no location info>: error: ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.1.20170116 for x86_64-unknown-linux): Dynamic linker not initialised Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13137#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13137: Dynamic linker not initialised. -------------------------------------+------------------------------------- Reporter: djduke | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by angerman): I'm a bit at a loss here, as I do not see the connection yet. All the change did, was remove the need to call reinitializeGlobals from plugins, which was done through the saveLinkerGlobals, restoreLinkerGlobals; essentially doing what the now deleted comment from that commit said. The diff did turn the MVar PersistentLinkerState into a sharedGlobal, I however do believe that the issue might more likely be with the calling (or not calling of) getOrSetLibHSghcInitLinkerDone. Phyx- if you could take a look, that would be great, as I would likely only find time to investigate this earliest next week :( -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13137#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13137: Dynamic linker not initialised. -------------------------------------+------------------------------------- Reporter: djduke | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by dobenour: @@ -8,0 +8,1 @@ + {{{ @@ -43,1 +44,1 @@ - + }}} New description: Attempting to build accelerate-llvm-1.0.0.0 cloned from the repo at https://github.com/AccelerateHS/accelerate-llvm, using: OSX 10.12.2 (Sierra) GHC 8.0.2 Command line tools for Xcode 8.2.1 {{{ [25 of 52] Compiling Data.Range.Range ( Data/Range/Range.hs, dist/build/Data/Range/Range.o ) (GHC version 8.0.2 for x86_64-apple-darwin): Dynamic linker not initialised Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug [26 of 52] Compiling Data.Array.Accelerate.LLVM.Util ( Data/Array/Accelerate/LLVM/Util.hs, dist/build/Data/Array/Accelerate/LLVM/Util.o ) <no location info>: error: <command line>: can't load .so/.DLL for: /Users/scsdjd/Library/Haskell/ghc-8.0.2-x86_64/lib/x86_64-osx-ghc-8.0.2 /libHSllvm-general-3.8.0.0-KHGbcTTSuxFL0az0gf3S53-ghc8.0.2.dylib (dlopen(/Users/scsdjd/Library/Haskell/ghc-8.0.2-x86_64/lib/x86_64-osx- ghc-8.0.2/libHSllvm-general-3.8.0.0-KHGbcTTSuxFL0az0gf3S53-ghc8.0.2.dylib, 5): Symbol not found: __ZTIN4llvm11InstructionE Referenced from: /Users/scsdjd/Library/Haskell/ghc-8.0.2-x86_64/lib/x86_64-osx-ghc-8.0.2 /libHSllvm-general-3.8.0.0-KHGbcTTSuxFL0az0gf3S53-ghc8.0.2.dylib Expected in: flat namespace in /Users/scsdjd/Library/Haskell/ghc-8.0.2-x86_64/lib/x86_64-osx- ghc-8.0.2/libHSllvm-general-3.8.0.0-KHGbcTTSuxFL0az0gf3S53-ghc8.0.2.dylib) [27 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Ptr ( Data/Array/Accelerate/LLVM/CodeGen/Ptr.hs, dist/build/Data/Array/Accelerate/LLVM/CodeGen/Ptr.o ) <no location info>: error: ghc: panic! (the 'impossible' happened) (GHC version 8.0.2 for x86_64-apple-darwin): Dynamic linker not initialised Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} ... so I have. I note previous tickets for "Dynamic linker not initialised", but not clear they are relevant due to different OS etc. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13137#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13137: Dynamic linker not initialised. -------------------------------------+------------------------------------- Reporter: djduke | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by nh2): Does your build use `ghc -j`? If yes, see #13531 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13137#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13137: Dynamic linker not initialised. -------------------------------------+------------------------------------- Reporter: djduke | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9868, #10355, | Differential Rev(s): Phab:D5012 #10919, #13531, #13607 | Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D5012 * related: => #9868, #10355, #10919, #13531, #13607 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13137#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13137: Dynamic linker not initialised.
-------------------------------------+-------------------------------------
Reporter: djduke | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #9868, #10355, | Differential Rev(s): Phab:D5012
#10919, #13531, #13607 |
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#13137: Dynamic linker not initialised. -------------------------------------+------------------------------------- Reporter: djduke | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.0.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9868, #10355, | Differential Rev(s): Phab:D5012 #10919, #13531, #13607 | Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.6.1 Comment: I believe this should be fixed in 8.6. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13137#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC