-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GHC-8.6.5 bootstrap binary installation segfault on musl #118731
Comments
@nomeata Thanks for reporting this. As you're probably aware, I don't think any of the Haskell maintainers here in Nixpkgs really check up to make sure the musl stuff is always working. I'd be happy to merge a fix for this if you (or anyone else) can figure out a solution to this problem. |
I have bisected this as it is a blocker for static-haskell-nix, see #43795 (comment). Command: NIX_PATH=nixpkgs=. nix-build --no-link -A pkgsMusl.haskell.compiler.ghc865Binary There's another issue that hides the segfault in some cases (resulting in --- a/pkgs/development/compilers/ghc/8.6.5-binary.nix
+++ b/pkgs/development/compilers/ghc/8.6.5-binary.nix
@@ -150,6 +150,8 @@ stdenv.mkDerivation rec {
done
'';
+ hardeningDisable = builtins.trace "ghc targetPlatform.isMusl = ${toString stdenv.targetPlatform.isMusl}" lib.optional stdenv.targetPlatform.isMusl "pie";
+
doInstallCheck = true;
installCheckPhase = ''
unset ${libEnvVar} With that, I found the bad commit: 5e2311d, a musl upgrade from PR #117375:
Bisection log: # git bisect log
git bisect start
# good: [6245758fd522c9dd14296a06f7a3ac25236e9222] Merge pull request #111257 from r-ryantm/auto-update/haproxy
git bisect good 6245758fd522c9dd14296a06f7a3ac25236e9222
# bad: [830ef6422f643d5c639fd79bca834c726787ec51] haskell-generic-builder: disable static PIE
git bisect bad 830ef6422f643d5c639fd79bca834c726787ec51
# bad: [1433dad051b601261d39de1bbb63dc030018efd7] Merge pull request #117797 from r-ryantm/auto-update/lazydocker
git bisect bad 1433dad051b601261d39de1bbb63dc030018efd7
# good: [c456a2512f7a7558cbe25328a423762033822cc0] Merge master into staging-next
git bisect good c456a2512f7a7558cbe25328a423762033822cc0
# good: [8ecf143cb0cfe93cb50337865f5dbceceeee0d0a] Merge pull request #113222 from Pacman99/fix-notification-center
git bisect good 8ecf143cb0cfe93cb50337865f5dbceceeee0d0a
# good: [8a945c941e0b04919edb0b1b2673d67390fdf566] Merge pull request #116994 from AndersonTorres/new-yabasic
git bisect good 8a945c941e0b04919edb0b1b2673d67390fdf566
# good: [70b387da701255c1f9a166ca7f97231cbcb087e0] Merge pull request #117340 from fabaff/bump-metasploit
git bisect good 70b387da701255c1f9a166ca7f97231cbcb087e0
# bad: [350f9bd822e1c5017482e6364dbafda36ff4157a] Merge pull request #117570 from FRidh/python2alias
git bisect bad 350f9bd822e1c5017482e6364dbafda36ff4157a
# bad: [c1cd574165cf254cc230d703802bafe7eb22d727] Merge pull request #117498 from rmcgibbo/cherrypy
git bisect bad c1cd574165cf254cc230d703802bafe7eb22d727
# bad: [070bfc96b7446e7d2653a1913b9bc4082d529638] python38Packages.xdis: 5.0.5 -> 5.0.8 (#117364)
git bisect bad 070bfc96b7446e7d2653a1913b9bc4082d529638
# bad: [d969cf2f42e3eb300a26d2bfe6bf4fb908230fd2] Merge pull request #117387 from AndersonTorres/new-zziplib
git bisect bad d969cf2f42e3eb300a26d2bfe6bf4fb908230fd2
# good: [5e5ae827f586175b2bb5954a531f84dc3e0856c0] Merge pull request #117367 from rmcgibbo/sklearn-deap
git bisect good 5e5ae827f586175b2bb5954a531f84dc3e0856c0
# bad: [4d709f381abaefa1cc5616164b1b72178c2d1a69] Merge pull request #117048 from AndersonTorres/new-mksh
git bisect bad 4d709f381abaefa1cc5616164b1b72178c2d1a69
# good: [7e87c10a9891f8454e8b2c5df54b52215e399135] notcurses: 2.2.2 -> 2.2.3
git bisect good 7e87c10a9891f8454e8b2c5df54b52215e399135
# bad: [dfd5d237d95782f6dbde223751ccc01439fd68aa] links2: 2.21 -> 2.22
git bisect bad dfd5d237d95782f6dbde223751ccc01439fd68aa
# bad: [77f3022296b33624fce6856901d83c55538b0e30] Merge pull request #117375 from TredwellGit/musl
git bisect bad 77f3022296b33624fce6856901d83c55538b0e30
# bad: [5e2311d2fb2e375a304a9d6d38b6fa445f158a75] musl: 1.2.1 -> 1.2.2
git bisect bad 5e2311d2fb2e375a304a9d6d38b6fa445f158a75
# first bad commit: [5e2311d2fb2e375a304a9d6d38b6fa445f158a75] musl: 1.2.1 -> 1.2.2 |
I guess, we should report this upstream with (probably) musl — looks like a regression on their part. Other possibility is that GHC has unfair expectations. |
I am now bisecting the commits between musl 1.2.1 and 1.2.2, so that we can ask a more informed question upstream. |
I have finished bisecting musl. It suggests that this is the commit that introduces the segfault: http://git.musl-libc.org/cgit/musl/commit/?id=57f6e85c9de417fef5eece2a5b00c1104321f543
As written in the bisection notes below, the problematic commit is sandwiched between a commit that introduces a GCC compile failure, and its fix. This made bisecting on the upstream git history impossible. So I reordered the upstream history to squash the GCC compile fix into the compile-breaking commit, in my branch With that, I did an automatic I still don't know why that commit would cause the segfault. My bisection notes
|
…compiler. This addresses the fact that `ghc865Binary` segfaults on musl (see NixOS#118731) because of the glibc+musl mix used in there. With the previous commits, `ghc8102Binary` was changed to use the musl-based bindist from GHC HQ instead, which works. With this change, all nix Haskell compilers builds on musl: NIX_PATH=nixpkgs=. nix-build --no-link --expr 'with import <nixpkgs> {}; { inherit (pkgsMusl.haskell.compiler) ghc884 ghc8104 ghc901 ghcHEAD; }'
PR at #129289. |
…OS#118731 NixOS#129247. This commit replaces the musl + glibc hackery in the GHC bindist compiler by using the new musl based bindist that GHC HQ provides (built on Alpine). We could alternatively also use a nix-built musl boostrap compiler, but it seems nicer to use the GHC HQ one for now. This fixes the compiler built by `pkgsMusl.haskell.compiler.ghc8102Binary` segfaulting (NixOS#118731) since the commit 5e2311d - musl: 1.2.1 -> 1.2.2 concretely, musl commit 01c7920f - remove redundant pthread struct members repeated for layout purposes which I suspect breaks some glibc/musl ABI compatibility that may have existed accidentally until then. The added lib.optional stdenv.targetPlatform.isMusl "pie"; also fixes that the packaged bindist compiler cannot create a binary in its `installCheck` phase (and overall); see detail explanation in NixOS#129247.
…compiler. This addresses the fact that `ghc865Binary` segfaults on musl (see NixOS#118731) because of the glibc+musl mix used in there. With the previous commits, `ghc8102Binary` was changed to use the musl-based bindist from GHC HQ instead, which works. With this change, all nix Haskell compilers builds on musl: NIX_PATH=nixpkgs=. nix-build --no-link --expr 'with import <nixpkgs> {}; { inherit (pkgsMusl.haskell.compiler) ghc884 ghc8104 ghc901 ghcHEAD; }'
…compiler. This addresses the fact that `ghc865Binary` segfaults on musl (see NixOS#118731) because of the glibc+musl mix used in there. With the previous commits, `ghc8102Binary` was changed to use the musl-based bindist from GHC HQ instead, which works. With this change, all nix Haskell compilers builds on musl: NIX_PATH=nixpkgs=. nix-build --no-link --expr 'with import <nixpkgs> {}; { inherit (pkgsMusl.haskell.compiler) ghc884 ghc8104 ghc901 ghcHEAD; }'
…OS#118731 NixOS#129247. This commit replaces the musl + glibc hackery in the GHC bindist compiler by using the new musl based bindist that GHC HQ provides (built on Alpine). We could alternatively also use a nix-built musl boostrap compiler, but it seems nicer to use the GHC HQ one for now. This fixes the compiler built by `pkgsMusl.haskell.compiler.ghc8102Binary` segfaulting (NixOS#118731) since the commit 5e2311d - musl: 1.2.1 -> 1.2.2 concretely, musl commit 01c7920f - remove redundant pthread struct members repeated for layout purposes which I suspect breaks some glibc/musl ABI compatibility that may have existed accidentally until then. The added lib.optional stdenv.targetPlatform.isMusl "pie"; also fixes that the packaged bindist compiler cannot create a binary in its `installCheck` phase (and overall); see detail explanation in NixOS#129247.
Trying nixpkgs post this commit, I get
GHC 8.10 uses Python as a library, which fails to build (libpython apparently is being built statically). More context here: srid/neuron#626 (comment) Not sure what I'm missing ... is there anything in particular to do here? |
This is known, but unrelated to our GHC derivation, see #131557. It fails while building One workaround could be to build with an overlay like this for now:
|
@sternenseemann Thanks; that workaround did it. |
Issue description
On todays
master
(229aff8), I observe this:This smelled a bit like the issue fixed in #103183, but, well, that fix is already included in
master
.The text was updated successfully, but these errors were encountered: