[GHC] #10001: GHC crash trying to build a project within Nix-shell

#10001: GHC crash trying to build a project within Nix-shell -------------------------------------+------------------------------------- Reporter: wolftune | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Keywords: | Operating System: Linux Architecture: x86_64 | Type of failure: Compile-time (amd64) | crash Test Case: | Blocked By: Blocking: | Related Tickets: 9825 Differential Revisions: | -------------------------------------+------------------------------------- {{{ <no location info>: ghc: panic! (the 'impossible' happened) (GHC version 7.8.4 for x86_64-unknown-linux): Loading temp shared object failed: /run/user/1000/ghc19915_0/ghc19915_20.so: failed to map segment from shared object Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug [20 of 99] Compiling Settings.StaticFiles ( Settings/StaticFiles.hs, dist/build/Settings/StaticFiles.o ) <no location info>: ghc: panic! (the 'impossible' happened) (GHC version 7.8.4 for x86_64-unknown-linux): Loading temp shared object failed: /run/user/1000/ghc19915_0/ghc19915_21.so: failed to map segment from shared object }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10001 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10001: GHC crash trying to build a project within Nix-shell -------------------------------------+------------------------------------- Reporter: wolftune | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: 9825 | Differential Revisions: -------------------------------------+------------------------------------- Comment (by teh): I have a reproducible example: https://gist.github.com/teh/d94a704254c834af6cdf I get {{{ [...] Loading package pretty-1.1.1.1 ... linking ... done. Loading package template-haskell ... linking ... done. <no location info>: ghc: panic! (the 'impossible' happened) (GHC version 7.8.4 for x86_64-unknown-linux): Loading temp shared object failed: /run/user/1000/ghc1352_0/ghc1352_3.so: failed to map segment from shared object }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10001#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10001: GHC crash trying to build a project within Nix-shell -------------------------------------+------------------------------------- Reporter: wolftune | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: 9825 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * status: new => infoneeded Comment: Does your example also fail outside a Nix-shell? I don't know what a Nix- shell is, so I can't reproduce this. Could this be related to #10131 ("improve error message for build on noexec-mounted device") -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10001#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10001: GHC crash trying to build a project within Nix-shell -------------------------------------+------------------------------------- Reporter: wolftune | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: 9825 | Differential Revisions: -------------------------------------+------------------------------------- Comment (by siddhanathan): This example does fail outside a Nix-shell. I just had the same issue with GHC 7.10.1 Reproducing should be simple. Just install the nix package manager ([http://nixos.org/nix/]), copy the files in the gist to a new folder, run `nix-shell` in the folder, and then `cabal sandbox init && cabal install`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10001#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10001: GHC crash trying to build a project within Nix-shell -------------------------------------+------------------------------------- Reporter: wolftune | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: 9825 | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rwbarton): Can we get instructions to reproduce that do not include "Just install the nix package manager"? The panic must depend on some feature of the environment. At a guess, perhaps TMPDIR is pointing at a filesystem (`/run`) that is mounted with noexec? That won't work (#10131). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10001#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10001: GHC crash trying to build a project within Nix-shell -------------------------------------+------------------------------------- Reporter: wolftune | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: 9825 | Differential Revisions: -------------------------------------+------------------------------------- Comment (by johnleuner): I managed to work around this problem by creating a temporary directory in my working directory. From my nix shell: export TMPDIR=$(pwd)/temp cabal install -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10001#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10001: GHC crash trying to build a project within Nix-shell -------------------------------------+------------------------------------- Reporter: wolftune | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: 9825 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by spl): * cc: sean.leather@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10001#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10001: GHC crash trying to build a project within Nix-shell -------------------------------------+------------------------------------- Reporter: wolftune | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: invalid | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: 9825 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by siddhanathan): * status: infoneeded => closed * resolution: => invalid Comment: So turns out `TMPDIR` was not set by default on my machine (using Ubuntu), and in such situations, nix defaults to using a temporary directory in `/run` which causes the panic. Setting `TMPDIR` to `/tmp` should fix the issue. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10001#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC