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
hello: "`GLIBC_2.38' not found" when using LD_PRELOAD with the host system's libstdc++ (higher than nixpkgs') #287764
Comments
Sounds similar to: |
Unsetting the |
True, it should depend on a libstdc++ inside /nix/store. This is definitely a build issue, but the question is whether it originates from the makefiles in the nix repo or the build instructions in the Arch package repository. Could you try uninstalling nix with pacman and installing it again with the determinate installer? It allows you to uninstall very easily again, so if you do want to run the version packaged by Arch, you can still do that later. |
I tried both the official Nix installer and the one from Determinate Systems before trying to install the programs I mentioned, and both of them crashed during the installation. I am don't know the reason why they crashed but I didn't bother, as the one that Arch shipped was installed successfully. And I now I don't want to uninstall Nix, as it may delete or corrupt my pgadmin4 configurations. But I may try them again in a VM and comeback with the results. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Maybe we start un-setting the |
Wouldn't that just shift the failures to post-install? (after the installer has told the user they have a working install) |
Right, the nixpkgs software would still be broken. Then we need |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/new-install-nix-wants-glibc-2-38-debian-12-has-2-36/36109/3 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
this issue is not only important on Arch — it also affects old environments on NixOS (e.g if you develop on older haskell versions in direnv, and have your system on unstable) |
Is it fixed in version 23.11 stable yet, I tried to install it today and check by using command |
Hey, I appreciate everyone chiming in, but we should try to keep this relevant and "noise-free". Maybe we should close or lock this issue, and actually open one in Nixpkgs instead. First off, yes, there has been some work and exploration happening related to this issue, e.g. #248547 and the PRs referenced therein. The way (glibc's) dynamic loader handles This repo is concerned specifically with the development of Nix. Nixpkgs-specific issues (e.g. dynamic loading errors in Before posting any new reports in this issue, please test which libc and libstdc++ the Nix binary ends up loading: try running
FWIW, I tried running
Do report if you get similar errors when using the
@cab404 this shouldn't be an issue if you're not mixing different channels in your dev environment and not mixing the "system" and the dev environment's packages. The issue should only present itself when you try to load a library linked against a newer libc in a process that has already loaded the old libc. This might hypothetically happen with e.g. the impure userspace drivers deployed in If one needs help diagnosing, they should please reach out in the Nix/NixOS support room on matrix, or at https://discourse.nixos.org. Thanks! |
Has this issue been resolved? Because I still have problem launching applications in Nix Flakes on a Guix System. |
In which way exactly do applications from nix flakes fail to launch for you on that Guix system? |
@Brogolem35 could you elaborate, what were the contents of Could you confirm that you had an |
@SomeoneSerge it fails in multiple ways. Before I go explaining the issues, I'll describe what this flake does it has a bunch of build inputs, like Setzer, TexLive and PNPM. Ideally, I want to be able to use
$ setzer
(process:19847): Gtk-WARNING **: 19:41:50.257: Locale not supported by C library.
Using the fallback 'C' locale.
Fontconfig error: Cannot load default config file: No such file: (null)
** (.setzer-wrapped:19847): WARNING **: 19:41:51.014: Failed to load shared library '/nix/store/rkdck16zm3zpbpy2c8a1vm4bc935v6s8-webkitgtk-2.42.5+abi=6.0/lib/libwebkitgtk-6.0.so.4' referenced by the typelib: /gnu/store/6ncav55lbk5kqvwwflrzcr41hp5jbq0c-gcc-11.3.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /nix/store/rkdck16zm3zpbpy2c8a1vm4bc935v6s8-webkitgtk-2.42.5+abi=6.0/lib/libwebkitgtk-6.0.so.4)
** (.setzer-wrapped:19847): WARNING **: 19:41:51.016: Failed to load shared library '/nix/store/rkdck16zm3zpbpy2c8a1vm4bc935v6s8-webkitgtk-2.42.5+abi=6.0/lib/libjavascriptcoregtk-6.0.so.1' referenced by the typelib: /gnu/store/6ncav55lbk5kqvwwflrzcr41hp5jbq0c-gcc-11.3.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /nix/store/rkdck16zm3zpbpy2c8a1vm4bc935v6s8-webkitgtk-2.42.5+abi=6.0/lib/libjavascriptcoregtk-6.0.so.1)
/nix/store/dzf369ynm2k3mcpm2p1b8cijp5yr15s8-setzer-62/lib/python3.11/site-packages/setzer/workspace/help_panel/help_panel_viewgtk.py:92: Warning: cannot retrieve class for invalid (unclassed) type 'void'
self.content = WebKit.WebView()
Traceback (most recent call last):
File "/nix/store/dzf369ynm2k3mcpm2p1b8cijp5yr15s8-setzer-62/bin/..setzer-wrapped-wrapped", line 87, in do_activate
self.activate()
File "/nix/store/dzf369ynm2k3mcpm2p1b8cijp5yr15s8-setzer-62/lib/python3.11/site-packages/setzer/helpers/timer.py", line 25, in new_function
return_value = original_function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/dzf369ynm2k3mcpm2p1b8cijp5yr15s8-setzer-62/bin/..setzer-wrapped-wrapped", line 123, in activate
self.main_window.create_widgets()
File "/nix/store/dzf369ynm2k3mcpm2p1b8cijp5yr15s8-setzer-62/lib/python3.11/site-packages/setzer/workspace/workspace_viewgtk.py", line 66, in create_widgets
self.help_panel = help_panel_view.HelpPanelView()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/dzf369ynm2k3mcpm2p1b8cijp5yr15s8-setzer-62/lib/python3.11/site-packages/setzer/workspace/help_panel/help_panel_viewgtk.py", line 92, in __init__
self.content = WebKit.WebView()
^^^^^^^^^^^^^^^^
TypeError: could not get a reference to type class The program does not terminate - it just stops there.
$ setzer
(process:24081): Gtk-WARNING **: 19:47:49.743: Locale not supported by C library.
Using the fallback 'C' locale.
Fontconfig error: Cannot load default config file: No such file: (null)
Cannot get default EGL display: EGL_BAD_PARAMETER
** (.setzer-wrapped:24081): WARNING **: 19:47:50.811: Disabled hardware acceleration because GTK failed to initialize GL: Failed to create EGL display.
/nix/store/dzf369ynm2k3mcpm2p1b8cijp5yr15s8-setzer-62/bin/..setzer-wrapped-wrapped:134: DeprecationWarning: Gtk.Widget.show is deprecated
self.main_window.show()
Gsk-Message: 19:47:51.111: Failed to realize renderer of type 'GskGLRenderer' for surface 'GdkWaylandToplevel': Failed to create EGL display
(process:2): Gtk-WARNING **: 19:47:51.351: Locale not supported by C library.
Using the fallback 'C' locale.
Fontconfig error: Cannot load default config file: No such file: (null)
(process:2): Gdk-WARNING **: 19:47:51.371: Failed to read portal settings: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.portal.Desktop was not provided by any .service files
activate: 1.214327096939087 seconds
MESA-LOADER: failed to open iris: /run/opengl-driver/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /run/opengl-driver/lib/dri, suffix _dri)
MESA-LOADER: failed to open zink: /run/opengl-driver/lib/dri/zink_dri.so: cannot open shared object file: No such file or directory (search paths /run/opengl-driver/lib/dri, suffix _dri)
MESA-LOADER: failed to open kms_swrast: /run/opengl-driver/lib/dri/kms_swrast_dri.so: cannot open shared object file: No such file or directory (search paths /run/opengl-driver/lib/dri, suffix _dri)
MESA-LOADER: failed to open swrast: /run/opengl-driver/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /run/opengl-driver/lib/dri, suffix _dri)
Failed to create GBM device for render device: /dev/dri/renderD128: No such file or directory
PlatformDisplayLibWPE: could not create the EGL display: EGL_SUCCESS. Does the app launch now? Yes. Can it build any documents? No. |
You're using nixpkgs' webkitgtk but you've already loaded guix's libstdc++ into the failing process, which in this case is apparently older than nixpkgs'. Why, does Guix set any LD_* variables? |
@SomeoneSerge it doesn't look like that. Normal terminal environment: $ env | grep -E 'LD'
OLDPWD=/home/ashvith Nix flake devShell environment: $ env | grep -E "LD"
NIX_BUILD_CORES=4
shellHook=# alias setzer='LD_PRELOAD="/nix/store/giyri337jb6sa1qyff6qp771qfq10yhf-gcc-12.3.0-lib/lib/libstdc++.so.6" setzer'
LD=ld
NIX_BUILD_TOP=/tmp/nix-shell.91RlkY
DETERMINISTIC_BUILD=1
OLDPWD=
NIX_LDFLAGS=-rpath /home/ashvith/Desktop/resume/outputs/out/lib -L/nix/store/rac8pxbi1vapwrlqzbrkycbyg521djzw-python3-3.11.6/lib -L/nix/store/j0pi1a69r7zzwxl92c21w1l2syyfnchp-zlib-1.3/lib -L/nix/store/3c7ddcpwhr9ak086n40c9gixvrl6vc0y-bzip2-1.0.8/lib -L/nix/store/xkfhipbvirh4nx07qdl761g3j9fc4nrg-brotli-1.1.0-lib/lib -L/nix/store/dygwk5apknxmxdhwi0j8qz8b1sv6fi2b-libpng-apng-1.6.40/lib -L/nix/store/8v7vqzpnixawf7nsif333gk6dp4y4cyc-freetype-2.13.2/lib -L/nix/store/i5g0zjnqs48lvm5zkv40wbq08gb4qp3x-fontconfig-2.14.2-lib/lib -L/nix/store/ilqbj5n4svk8gc0rg1j9m8dqlbq0ms2p-pixman-0.42.2/lib -L/nix/store/lh04hfa48259q659vw58ayn7pm5nabx7-libXau-1.0.11/lib -L/nix/store/q9bb95bnivn9f596kwrd95vilrcyrr3g-libXext-1.3.5/lib -L/nix/store/fk1vd41g33xbr7s41gjsj1lw5vkqm6c9-libxcb-1.16/lib -L/nix/store/1z9fhkxbyc1nhir2wsini4ngyd9krqdy-libX11-1.8.7/lib -L/nix/store/65gwxgxkk9k86fhdhslazlm1qd8f2hi3-libXrender-0.9.11/lib -L/nix/store/w9x0w0van5d2qdxb5923dxd9d0bid5fp-libffi-3.4.4/lib -L/nix/store/k18y3f2xnzw0jzqwrhz8s3xwkk8w1p0i-gettext-0.21.1/lib -L/nix/store/a9i5isnbiz1nbxskjxmjgs9kdx2ijm5z-glib-2.78.3/lib -L/nix/store/b3f2inmyyc6dz7270mzn4iqxypgza10h-cairo-1.18.0/lib -L/nix/store/rac8pxbi1vapwrlqzbrkycbyg521djzw-python3-3.11.6/lib -L/nix/store/j0pi1a69r7zzwxl92c21w1l2syyfnchp-zlib-1.3/lib -L/nix/store/3c7ddcpwhr9ak086n40c9gixvrl6vc0y-bzip2-1.0.8/lib -L/nix/store/xkfhipbvirh4nx07qdl761g3j9fc4nrg-brotli-1.1.0-lib/lib -L/nix/store/dygwk5apknxmxdhwi0j8qz8b1sv6fi2b-libpng-apng-1.6.40/lib -L/nix/store/8v7vqzpnixawf7nsif333gk6dp4y4cyc-freetype-2.13.2/lib -L/nix/store/i5g0zjnqs48lvm5zkv40wbq08gb4qp3x-fontconfig-2.14.2-lib/lib -L/nix/store/ilqbj5n4svk8gc0rg1j9m8dqlbq0ms2p-pixman-0.42.2/lib -L/nix/store/lh04hfa48259q659vw58ayn7pm5nabx7-libXau-1.0.11/lib -L/nix/store/q9bb95bnivn9f596kwrd95vilrcyrr3g-libXext-1.3.5/lib -L/nix/store/fk1vd41g33xbr7s41gjsj1lw5vkqm6c9-libxcb-1.16/lib -L/nix/store/1z9fhkxbyc1nhir2wsini4ngyd9krqdy-libX11-1.8.7/lib -L/nix/store/65gwxgxkk9k86fhdhslazlm1qd8f2hi3-libXrender-0.9.11/lib -L/nix/store/w9x0w0van5d2qdxb5923dxd9d0bid5fp-libffi-3.4.4/lib -L/nix/store/k18y3f2xnzw0jzqwrhz8s3xwkk8w1p0i-gettext-0.21.1/lib -L/nix/store/a9i5isnbiz1nbxskjxmjgs9kdx2ijm5z-glib-2.78.3/lib -L/nix/store/b3f2inmyyc6dz7270mzn4iqxypgza10h-cairo-1.18.0/lib |
@Ashvith10 you'll need then to scan For future posters: please do go through these steps (adjusted to your environment) in advance and attach information on what configuration exactly leads to the failure:
Again, if you need help inferring those, please do reach out e.g. in the Nix/NixOS Support room on Matrix |
@SomeoneSerge I figured out a fix - well, it's not really a fix, but a workaround for anyone who's okay with using a dated version of Nix channel. I had to check which version of libc and libc++ I had on my device, so I did: $ strings /gnu/store/6ncav55lbk5kqvwwflrzcr41hp5jbq0c-gcc-11.3.0-lib/lib/libstdc++.so.6 | grep GLIBC
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBCXX_3.4.27
GLIBCXX_3.4.28
GLIBCXX_3.4.29
GLIBC_2.2.5
GLIBC_2.3
GLIBC_2.14
GLIBC_2.6
GLIBC_2.33
GLIBC_2.4
GLIBC_2.18
GLIBC_2.16
GLIBC_2.32
GLIBC_2.17
GLIBC_2.3.2
GLIBC_2.34
GLIBCXX_DEBUG_MESSAGE_LENGTH Not a proper deduction, but from this, I realized that apps in |
@Ashvith10 none of this should ever be required. You would help the community if you had managed to figure out why does the loader "incorrectly" choose the libstdc++ deployed by Guix. It shouldn't. |
@SomeoneSerge I wish I knew how to read trace from |
I think the issues probably starts from here? |
I don't see what's loading libgioenvironment and why it's a path in /run, but at least we see that /run/current-system is how we reach /gnu EDIT: My guess is that we don't see any look-up process for libgioenvironmentproxy because it must've been loaded by absolute path rather than by name. This very likely happens because of some of the global configuration deployed by Guix. I'm not familiar with GIO but I imagine it's something mildly cursed, maybe akin to nsswitch. You're observing an error because none of the nix-built programs loaded before libgio... depend on libstdc++ so they do not load it. The GIO "plugins" deployed by Guix do, and their libstdc++ is loaded first. The nix-built EDIT:
That's quite ok, that's why I suggested reaching out in the chat |
I used set it in .zshrc with The reason why I set it was that for some reason the matplotlib that was shipped by conda required it to work. |
@Brogolem35 so in your case, it isn't even able to detect system's shared object, let alone Nix, I presume? But then, since you're on Arch, your system's and Nix's shared object must have a small version gap? What you're doing is still not a fix - it's merely a workaround, just like my suggestion above, and most of the apps on older channels won't work, which can be quite a hindrance for anyone using it for production. |
Ok, so it wasn't a Nixpkgs issue, and it wasn't an Archlinux issue either. Thanks for expounding this! The resolution is that I think we can close this now.
The gaps don't matter, what matters is that one must load libstdc++ at least as new as the one used at build/link time
I'd say there's nothing to work around. |
@SomeoneSerge so my issue is different from @Brogolem35 's? At least from my perspective, it looks like I should open a new issue, as it is still not resolved. |
@Ashvith10 yes, your issue is different; it's not clear to me yet if there's anything to "fix" about it, but do consider opening an issue under the Nixpkgs repo regarding impure GIO libraries and libstdc++ mismatches Also consider notifying Guix maintainers |
@Brogolem35 I updated the title to reflect how I understood the problem from your later comments. As mentioned above, I think this is a "wontfix" case. Thank you for reporting this, however, because this will help map the space of edge-cases and navigate people who encounter related errors With that in mind, I'm closing the issue. Feel free to reopen if you think I misunderstood anything |
* seems to fix the post run hook. more details in: NixOS/nixpkgs#287764
if you dont't pin the packages you get version `GLIBC_2.38' not found when trying to run the VM maybe related to NixOS/nixpkgs#287764 ?
Describe the bug
I installed Nix native package, added the user to the group, and enabled the daemon, as it was stated in the Arch Wiki. For testing I installed the nixpkgs.hello. It was installed successfully but didn't work. The error: hello: /nix/store/whypqfa83z4bsn43n4byvmw80n4mg3r8-glibc-2.37-45/lib/libc.so.6: version GLIBC_2.38' not found (required by /usr/lib/libstdc++.so.6)".
I also tried to install pgadmin4, as it was the reason I installed the Nix. It was also installed successfully but didn't run. The error: "/nix/store/0rwyq0j954a7143p0wzd4rhycny8i967-bash-5.2-p15/bin/bash: /nix/store/whypqfa83z4bsn43n4byvmw80n4mg3r8-glibc-2.37-45/lib/libc.so.6: version `GLIBC_2.38' not found (required by /usr/lib/libstdc++.so.6)"
I also reported this issue on Arch Linux Forum as well, and it seems the problem is related to Nix, as Nix (in stable channel) uses glibc version 2.37-45, but the Arch uses 2.38-7.
Nix being dependent on the libstdc++ might be the root of the issue.
Steps To Reproduce
Expected behavior
Running the installed app without any errors.
nix-env --version
outputnix-env (Nix) 2.18.1
Additional context
I use Nix on Arch, btw.
Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: