Skip to content
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

fetchGit with git ssh url causes SEGV #6616

Closed
tomsiewert opened this issue Jun 4, 2022 · 5 comments
Closed

fetchGit with git ssh url causes SEGV #6616

tomsiewert opened this issue Jun 4, 2022 · 5 comments
Labels

Comments

@tomsiewert
Copy link
Member

Describe the bug

I tried to build a go module from a private gitlab repository via ssh but building it with nix build --impure --expr 'with import (builtins.getFlake "nixpkgs") {}; pkgs.callPackage ./mypackage.nix {}' fails with a segmentation violation.

Steps To Reproduce

  1. Create a git repository
  2. Use this config and maybe adapt it:
{ buildGoModule, lib }:

buildGoModule rec {
  pname = "niceclitool";
  version = "0.1.3";

  src = builtins.fetchGit {
    url = "git@git.asdf.xxx/tom/niceclitool.git";
    rev = "6a71025d39c1e42b7be2ae1a82c88f30f9a8ad79";
  };

  vendorSha256 = null;

  meta = with lib; {
    description = "I am a nice tool.";
    homepage = "https://git.asdf.xxx/tom/niceclitool";
    platforms = platforms.linux;
  };
}
  1. Build it with the mentioned command
  2. Get your SEGV.

Expected behavior

nix build not seg faulting.

nix-env --version output

nix-env (Nix) 2.9.0pre20220530_af23d38

Additional context

Backtrace from coredump:

(gdb) bt
#0  0x00007f6c8f46745a in free () from /nix/store/lyl6nysc3i3aqhj6shizjgj0ibnf1pvg-glibc-2.34-210/lib/libc.so.6
#1  0x00007f6c903a5b0f in std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned long, nix::Explicit<bool> > >::~pair() () from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixexpr.so
#2  0x00007f6c8ff46cf2 in nix::fetchers::GitInputScheme::fetch(nix::ref<nix::Store>, nix::fetchers::Input const&) ()
   from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixfetchers.so
#3  0x00007f6c8ff30864 in nix::fetchers::Input::fetch(nix::ref<nix::Store>) const () from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixfetchers.so
#4  0x00007f6c90446d27 in nix::fetchTree(nix::EvalState&, nix::PosIdx, nix::Value**, nix::Value&, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, nix::FetchTreeParams const&) () from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixexpr.so
#5  0x00007f6c90448222 in nix::prim_fetchGit(nix::EvalState&, nix::PosIdx, nix::Value**, nix::Value&) () from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixexpr.so
#6  0x00007f6c9037037c in nix::EvalState::callFunction(nix::Value&, unsigned long, nix::Value**, nix::Value&, nix::PosIdx) ()
   from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixexpr.so
#7  0x00007f6c9037151b in nix::ExprCall::eval(nix::EvalState&, nix::Env&, nix::Value&) () from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixexpr.so
#8  0x00005634dfc7e83d in void nix::EvalState::forceValue<nix::EvalState::forceValue(nix::Value&, nix::PosIdx)::{lambda()#1}>(nix::Value&, nix::EvalState::forceValue(nix::Value&, nix::PosIdx)::{lambda()#1}) ()
#9  0x00007f6c9042563f in nix::prim_derivationStrict(nix::EvalState&, nix::PosIdx, nix::Value**, nix::Value&) () from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixexpr.so
#10 0x00007f6c9037037c in nix::EvalState::callFunction(nix::Value&, unsigned long, nix::Value**, nix::Value&, nix::PosIdx) ()
   from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixexpr.so
#11 0x00007f6c9037151b in nix::ExprCall::eval(nix::EvalState&, nix::Env&, nix::Value&) () from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixexpr.so
#12 0x00007f6c90377469 in nix::ExprVar::eval(nix::EvalState&, nix::Env&, nix::Value&) () from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixexpr.so
#13 0x00007f6c903756ef in nix::ExprSelect::eval(nix::EvalState&, nix::Env&, nix::Value&) () from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixexpr.so
#14 0x00005634dfc7e83d in void nix::EvalState::forceValue<nix::EvalState::forceValue(nix::Value&, nix::PosIdx)::{lambda()#1}>(nix::Value&, nix::EvalState::forceValue(nix::Value&, nix::PosIdx)::{lambda()#1}) ()
#15 0x00007f6c90375afd in nix::ExprSelect::eval(nix::EvalState&, nix::Env&, nix::Value&) () from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixexpr.so
#16 0x00005634dfc7e83d in void nix::EvalState::forceValue<nix::EvalState::forceValue(nix::Value&, nix::PosIdx)::{lambda()#1}>(nix::Value&, nix::EvalState::forceValue(nix::Value&, nix::PosIdx)::{lambda()#1}) ()
#17 0x00007f6c90373c97 in nix::EvalState::coerceToString(nix::PosIdx, nix::Value&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, bool, bool, bool) ()
   from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixexpr.so
#18 0x00007f6c90377d54 in nix::EvalState::coerceToStorePath(nix::PosIdx, nix::Value&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&) ()
   from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixexpr.so
#19 0x00007f6c903d9999 in nix::DrvInfo::queryDrvPath() const () from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixexpr.so
#20 0x00007f6c8f9421b6 in nix::InstallableAttrPath::toDerivations() () from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixcmd.so
#21 0x00007f6c8f93b758 in nix::InstallableValue::toDerivedPaths() () from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixcmd.so
#22 0x00007f6c8f942883 in nix::Installable::build2(nix::ref<nix::Store>, nix::ref<nix::Store>, nix::Realise, std::vector<std::shared_ptr<nix::Installable>, std::allocator<std::shared_ptr<nix::Installable> > > const&, nix::BuildMode) () from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixcmd.so
#23 0x00007f6c8f943431 in nix::Installable::build(nix::ref<nix::Store>, nix::ref<nix::Store>, nix::Realise, std::vector<std::shared_ptr<nix::Installable>, std::allocator<std::shared_ptr<nix::Installable> > > const&, nix::BuildMode) () from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixcmd.so
#24 0x00005634dfc1d40f in CmdBuild::run(nix::ref<nix::Store>) ()
#25 0x00007f6c8f91c800 in nix::StoreCommand::run() () from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixcmd.so
#26 0x00005634dfcb1fda in nix::mainWrapped(int, char**) ()
#27 0x00007f6c8fff3e89 in nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void ()>) ()
   from /nix/store/322gf8pz20drxdzx8kmglsdc3nqhg3xy-nix-2.8pre20220530_af23d38/lib/libnixmain.so
#28 0x00005634dfb78c36 in main ()
@tomsiewert tomsiewert added the bug label Jun 4, 2022
@tomsiewert tomsiewert changed the title Building a custom go module fails with segmentation violation fetchGit with git ssh url causes SEGV Jun 4, 2022
@tomsiewert
Copy link
Member Author

I changed the title to the proper issue. I just saw that other people are also reporting this issue with fetchGit however, it seems that the issue is not solved with 2.9.0pre20220530.

@Kha
Copy link
Contributor

Kha commented Jun 4, 2022

The other reported issue was closed by 078c80f, i.e. later than that.

@thufschmitt
Copy link
Member

Yeah, that looks very much like #6554 (and the other related issues). Can you try with 2.9.1? it should have the fix

@tomsiewert
Copy link
Member Author

With 2.9.1 I can use fetchGit again.

@thufschmitt
Copy link
Member

Awesome 🎊

Let's close this then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants