GithubHelp home page GithubHelp logo

Comments (8)

SuperSandro2000 avatar SuperSandro2000 commented on August 17, 2024

You could use system.replaceRuntimeDependencies to only replace the final package.
Do you know the command that is being executed? Can you run strace on it?

from nix-ld.

Mic92 avatar Mic92 commented on August 17, 2024

You wouldn't override /lib64/ld-linux-x86-64.so.2 because this is not your libc. Instead, you would set NIX_LD to a glibc with debug symbols.

from nix-ld.

Mic92 avatar Mic92 commented on August 17, 2024

The crash also happens actually in glibc and not in nix-ld as you can see from the stacktrace.

from nix-ld.

Mic92 avatar Mic92 commented on August 17, 2024

I have not added yet support to make nix-ld an executable - it's only a library, so the way you are trying to start will not work yet. For now you have to manually replace /lib64/ld-linux-x86-64.so.2 in your script with the actual glibc link loader.

from nix-ld.

pschyska avatar pschyska commented on August 17, 2024

I have not added yet support to make nix-ld an executable - it's only a library, so the way you are trying to start will not work yet. For now you have to manually replace /lib64/ld-linux-x86-64.so.2 in your script with the actual glibc link loader.

Ah yes! This is it. I didn't realize the script 1 actually calls ld-linux-x86-64.so.2 --library-path … exe instead of LD_LIBRARY_PATH=… exe. I'll try to find out if that behaviour can be controlled somehow. I think I should be able to hack $PATH for this specific use-case to prefer glibc instead of nix-ld.

Would it be hard to make nix-ld executable standalone by putting the arguments into (NIX_?)LD_LIBRARY_PATH and calling into glibc? Or alternatively (as nix-ld's functionality is not required here) just forwarding to ${glibc}/…/ld-linux-x86-64.so.2?

Footnotes

  1. Which unfortunately isn't mine, but JetBrains'. AFAICS an attempt to be able to deploy IDEs to arbitary "linux" hosts over ssh without incurring remote dependencies by shipping some .so files with it — which faceplants on systems like NixOS. To add insult to injury it all happens in some temporary folders which disappear after the processes crash, but I'll try to preserve them somehow, or find the source of this script.

from nix-ld.

Mic92 avatar Mic92 commented on August 17, 2024

Not so hard, it would be another execve to $NIX_LD, if it detects that it is not called as a library.

from nix-ld.

Mic92 avatar Mic92 commented on August 17, 2024

so musl libc detect this by checking if aux[AT_BASE] is set:

https://git.musl-libc.org/cgit/musl/tree/ldso/dlstart.c?id=f47a8cdd250d9163fcfb39bf4e9d813957c0b187#n104

from nix-ld.

Mic92 avatar Mic92 commented on August 17, 2024

fixed in #47

from nix-ld.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.