Open kjeremy opened 2 years ago
I have the same issue
- system: `"x86_64-linux"`
- host os: `Linux 5.17.3, NixOS, 22.05 (Quokka)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.7.0`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
I noticed this issue upgrading nixpkgs from rev 1d08ea2bd83abef174fb43cbfb8a856b8ef2ce26
to rev 30d3d79b7d3607d56546dd2a6b49e156ba0ec634
I was getting a libc error undefined symbol: __nptl_change_stack_perm
.
I started having the exact same issue with code depending on libX11.so.6
.
Initially I'll get GLIBC_2.34 no found (required by ...-libX11-1.7.2/lib/libX11.so.6
.
Then if I add pkgs.glibc
to the environment ( v2.34 ), I get a crash during resolution exactly like yours: undefined symbol: __nptl_change_stack_perm
. From what I could tell in the glibc
sources this is a system call, I only saw it mentioned in glibc
2.35, but I didn't dig to find out if it was "new in 2.35"; if that's the case symbol versioning in glibc
itself really dropped the ball.
Still, I'm not sure how libX11.so.6
would depend on glibc-2.35
since it's not available in nixpkgs
, and literally everything on my box was installed using nix
.
I'm wondering if we need to be explicit about glibc versions somewhere. I'm not sure how to solve this and it makes vscode unusable.
I'm pretty sure that this is a libc mismatch.
ldd --version
on my system reports: 2.34
Once in the nix develop
it reports 2.32
Have any of you figured out a workaround?
We now see this on 21.11
- system: `"x86_64-linux"`
- host os: `Linux 5.10.81, NixOS, 21.11 (Porcupine)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.5.0pre20211206_d1aaa7e`
- channels(root): `"nixos-21.11.337635.cbd40c72b26"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
I can add that if instead of specifying vscode-fhs in the environment system packages you specify vscode-with-extensions.override with the extensions explicitly listed, the terminal launches in vscode. I'm also able to run nix commands inside of the integrated terminal of other projects that were failing due to glibc errors previously so I'd say its a step in the right direction, though managing extensions like this is not the most pleasant.
Not entirely familiar with Nix so if you know of gotchas with this method please let me know. Obviously, this doesn't address the root issue (since many other related issues exist), but it at least seems to allow vscode to play nicer with Nix.
I'm unable to reproduce this and the terminal works fine with a recent nixpkgs unstable pin:
"x86_64-linux"
Linux 5.15.59, NixOS, 22.11 (Raccoon), 22.11.20220814.b02538b
In case this is helpful, I only see this issue when most of my packages are from one branch (e.g. 22.05) and my vscode-fhs is from unstable. When using vscode-fhs from 22.05 also, I don't see this issue.
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/vscode-c-cpptools-and-clangd-not-working/21902/6
In case this is helpful, I only see this issue when most of my packages are from one branch (e.g. 22.05) and my vscode-fhs is from unstable. When using vscode-fhs from 22.05 also, I don't see this issue.
I can very much confirm this is the case - I switched my project flake to use unstable and the default vscode.fhs environment worked correctly.
I'm going to thus suppose that vscode.fhs (running from my nixos-unstable system) is linked against a different glibc, or potentially built with a different gcc.
I personally can't think of any potential fix besides running vscode.fhs from the project-shell to get a matching version.
Is there potentially a roundabout way to fix this in which the binary is wrapped with its own libraries to avoid this issue? I have run many binaries inside of vscode-fhs
but only recently did I see one that didn't work. This of course at the cost of having multiple versions of the same library taking up space on the nix store
Describe the bug
vscode-fhs fails to launch the terminal process (and other extension issues) if launched from within a
nix develop
session.Steps To Reproduce
Steps to reproduce the behavior:
git clone https://github.com/breakds/flake-example-hello-repeater
nix develop
code .
Expected behavior
A Terminal window should pop up. Instead the bash process dies.
Screenshots
If applicable, add screenshots to help explain your problem.![image](https://user-images.githubusercontent.com/4325700/164291466-49254e81-42e4-499e-9fc9-95135acc6b91.png)
Additional context
This also impacts cmake from the CMake Tools extension. The same problem manifests in the Nix Env Selector extension as missing symbols from
nix-shell
.Notify maintainers
@eadwu @Synthetica9 @maxeaubrey @bobby285271
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.