-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
glibc-2.30 libraries link to glibc-2.27 #84043
Comments
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/go-no-go-meeting-nixos-20-03-markhor/6495/12 |
Is it possible that this is related to the bootstrap-files? When I run |
Cannot reproduce on master (cab6b01). Trying with the following let
pkgs = import (fetchTarball {
url = "https://github.com/NixOS/nixpkgs/tarball/cab6b019b17881f42f618dcc9fce9341f1a6df81";
sha256 = "0gqh7yj9vlna6vrmrra75gwkwcbj5fshdp6jrw7y2s5l1aixn388";
}) { system = "x86_64-linux"; overlays = []; config = {}; };
in pkgs.runCommandNoCC "repro-84043" {} ''
${pkgs.glibc.bin}/bin/ldd ${pkgs.glibc}/lib/libpthread-2.30.so > $out
'' Then
|
Hmm.... I actually can't either (on NixOS 20.03). This may be related to the fact that @neilmayhew is on 19.09 (which actively uses glibc-2.27). @neilmayhew at which git-rev of nixpkgs did you run However, it's getting late... unless someone's faster, I can take a look at this tomorrow :) |
I was at However, I've just discovered something interesting. When I run the $ readlink -f $(which ldd)
/nix/store/hblpx8x5w88igmwa4ydnsnb65s363lji-glibc-2.27-bin/bin/ldd This is because $ nix-shell -p glibc
$$ which ldd
/nix/store/c2lx3lsqp0y5kwvwkqma8iihc7xjj1m8-glibc-2.30-bin/bin/ldd
$$ ldd /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libpthread-2.30.so
linux-vdso.so.1 (0x00007fffedbd8000)
libc.so.6 => /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libc.so.6 (0x00007f9344423000)
/nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/ld-linux-x86-64.so.2 => /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib64/ld-linux-x86-64.so.2 (0x00007f9344605000) Even so, I'm surprised that the path to libc6 isn't enforced by libpthread-2.30.so. In particular, patchelf --print-rpath /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libpthread-2.30.so
(empty output) So there is no rpath. This is confirmed by running |
So, this seems to be depending on the environment. I just built a NixOS 19.09 VM (which uses glibc-2.27) and I could reproduce the issue.
Right now, the issue is actually reproducible:
However, when I change the environment with
This raises the following questions for me:
|
Yeah, it happens if you mix 19.09 and 20.03. For example my GHC is coming from 19.09, while ghcide is built with 20.03 |
So what do you all think about there being no rpath in glibc's libraries? Surely having an rpath is an essential part of the way Nix works? All other libraries seem to have it, and I don't understand why libpthread etc. would be different. Letting something as fundamental as glibc be affected by context seems like a bad idea to me. |
Not sure yet since I'm wondering if that has been implemented that way for a reason. That's also why I asked if someone can explain why the |
It works because $ git checkout 318f05f
$ which ldd
/run/current-system/sw/bin/ldd
$ readlink -f $(which ldd)
/nix/store/hblpx8x5w88igmwa4ydnsnb65s363lji-glibc-2.27-bin/bin/ldd
$ nix-shell -I nixpkgs=`pwd` -p
$$ which ldd
/nix/store/c2lx3lsqp0y5kwvwkqma8iihc7xjj1m8-glibc-2.30-bin/bin/ldd
$$ echo $PATH | tr : \\n | grep glibc
/nix/store/c2lx3lsqp0y5kwvwkqma8iihc7xjj1m8-glibc-2.30-bin/bin
/nix/store/c2lx3lsqp0y5kwvwkqma8iihc7xjj1m8-glibc-2.30-bin/bin |
Also, note that this is purely due to $ /nix/store/c2lx3lsqp0y5kwvwkqma8iihc7xjj1m8-glibc-2.30-bin/bin/ldd $(nix-build --no-link -I nixpkgs=`pwd` -A glibc)/lib/libpthread.so
linux-vdso.so.1 (0x00007ffc41184000)
libc.so.6 => /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libc.so.6 (0x00007f4c67f73000)
/nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/ld-linux-x86-64.so.2 => /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib64/ld-linux-x86-64.so.2 (0x00007f4c68155000)
$ ldd $(nix-build --no-link -I nixpkgs=`pwd` -A glibc)/lib/libpthread.so
linux-vdso.so.1 (0x00007ffdcbf27000)
libc.so.6 => /nix/store/wx1vk75bpdr65g6xwxbj4rw0pk04v5j3-glibc-2.27/lib/libc.so.6 (0x00007f71789be000)
/nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/ld-linux-x86-64.so.2 => /nix/store/wx1vk75bpdr65g6xwxbj4rw0pk04v5j3-glibc-2.27/lib64/ld-linux-x86-64.so.2 (0x00007f7178b97000) |
Could you do an Note that |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/go-no-go-meeting-nixos-20-03-markhor/6495/16 |
With
Unfortunately So Could somebody please, please tell me why it doesn't have an rpath? |
(Add |
I have a one-word patch that fixes this(I think).
Wrong output similar to @neilmayhew, before the change.
After the change:
It also works with impure stuff.
|
I think the problem isn't just with I would much rather see glibc's .so's get an rpath. |
It looks to me like several fixup hooks aren't running in the build of glibc. I don't know yet what's clobbering them. |
OK, I see it now. |
Would it work to remove |
I can't see how adding the RPATH is expected to help things. At the point when you're loading a libpthread, you surely have some version of libc already loaded. I don't think you can that easily have two glibc versions loaded at once anyway (in one process). |
BTW, so far the most common impurity you get (on "desktop use", unless messing with things like |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/xorgserver-upgrade-and-startx/6834/6 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/xorgserver-upgrade-and-startx/6834/9 |
I'm actually getting the exact same error with Ubuntu 18.04 when using
Except instead of pointing to a
Sadly, running the This sadly means that it not only happens to people running 19.09, but also people running other Linux OSes. |
I suspect using Ubuntu's |
I marked this as stale due to inactivity. → More info |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-do-i-pin-a-specific-version-of-glibc-using-shell-nix/11755/3 |
This appears to be a problem with Nim-lang. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
I marked this as stale due to inactivity. → More info |
Still very much an issue - running into this when trying to pin |
I am having this issue. I have a shell.nix file where I am trying to pin nixpkgs. When I don't pin nixpkgs, I don't have this issue. |
Describe the bug
The libraries in glibc-2.30 link to the libc from glibc-2.27
To Reproduce
Expected behavior
Additional context
This seems to be the cause of a number of other problems, in particular symbols not being found when they should be, eg, when I try to run scripts in sublime3:
bash: relocation error: /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libpthread.so.0: symbol __write_nocancel version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference
The same error is reported in #79954. I think the fix for that (#80005) should be reverted because it seems like zoom-us still needs v4l. (My camera no longer works, for example.) However, I can't revert it locally because the glibc problem prevents v4l from pre-loading with zoom-us.
Metadata
"x86_64-linux"
Linux 4.19.107, NixOS, 19.09.2346.85d879e5133 (Loris)
yes
yes
nix-env (Nix) 2.3.3
"nixos-19.09.2346.85d879e5133"
"nixpkgs-20.09pre218717.05f0934825c"
/home/$USER/.nix-defexpr/channels/nixpkgs
Maintainer information:
The text was updated successfully, but these errors were encountered: