NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.8k stars 1.52k forks source link

Assertion `hasSuffix(nameWithSuffix, extension)' failed. #4977

Closed bbigras closed 5 months ago

bbigras commented 3 years ago

Describe the bug

nix-daemon crash

❯ nix-env -vvv --quiet -j8 -iA cachix -f https://cachix.org/api/v1/install
downloading 'https://cachix.org/api/v1/install'...
evaluating file '/nix/store/j24029fbiy3nlrcssbq7rdl8ljjym54f-source'
evaluating file '/nix/store/lxr85hw1q3ash335r1sdmwamrg90ih0s-env-manifest.nix'
installing 'cachix-0.6.1'
error: unexpected end-of-file

originally posted in https://github.com/NixOS/nix/issues/4903#issuecomment-870906902

Steps To Reproduce

  1. run nix-env -vvv --quiet -j8 -iA cachix -f https://cachix.org/api/v1/install

Expected behavior

nix-env --version output

nix-env (Nix) 2.4pre20210601_5985b8b

Additional context

jui 02 10:37:33 desktop nix-daemon[1189]: accepted connection from pid 10981, user bbigras (trusted)
jui 02 10:37:33 desktop nix-daemon[10986]: nix-daemon: src/libstore/derivations.cc:630: static std::string_view nix::BasicDerivation::nameFromPath(const nix::StorePath&): Assertion `hasSuffix(nameWithSuffix, extension)' failed.
jui 02 10:37:33 desktop systemd-coredump[10993]: [🡕] Process 10986 (nix-daemon) of user 0 dumped core.
           PID: 10986 (nix-daemon)
           UID: 0 (root)
           GID: 0 (root)
        Signal: 6 (ABRT)
     Timestamp: Fri 2021-07-02 10:37:33 EDT (7min ago)
  Command Line: nix-daemon 10981
    Executable: /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/bin/nix
 Control Group: /system.slice/nix-daemon.service
          Unit: nix-daemon.service
         Slice: system.slice
       Boot ID: 382020cfad734d168738fea311ede70b
    Machine ID: 21f3effe4caa457ba8dc96924a35d1a2
      Hostname: desktop
       Storage: /var/lib/systemd/coredump/core.nix-daemon.0.382020cfad734d168738fea311ede70b.10986.1625236653000000.lz4
       Message: Process 10986 (nix-daemon) of user 0 dumped core.

GNU gdb (GDB) 10.2
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/bin/nix...
(No debugging symbols found in /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/bin/nix)

warning: Can't open file /nix/var/nix/db/db.sqlite-shm during file-backed mapping note processing

warning: Can't open file /run/nscd/dbPhbKFZ (deleted) during file-backed mapping note processing

warning: Can't open file /run/nscd/dbLwfCp1 (deleted) during file-backed mapping note processing
[New LWP 10986]
[New LWP 10987]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/nix/store/adxc893j47gxx3xjw403zdf0liiddvw2-glibc-2.32-48/lib/libthread_db.so.1".
Core was generated by `nix-daemon 10981   '.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007fc47217033a in raise () from /nix/store/adxc893j47gxx3xjw403zdf0liiddvw2-glibc-2.32-48/lib/libc.so.6
[Current thread is 1 (Thread 0x7fc470f58a80 (LWP 10986))]
warning: File "/nix/store/j5v9qapwwbh27lp1mkqmcczm1yv1n9qa-hm_gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:/nix/store/d9mfvhvksvsx0ar8pmxwhgwd9my045rp-gcc-10.3.0-lib".
To enable execution of this file add
    add-auto-load-safe-path /nix/store/j5v9qapwwbh27lp1mkqmcczm1yv1n9qa-hm_gdbinit
line to your configuration file "/root/.gdbinit".
To completely disable this security protection add
    set auto-load safe-path /
line to your configuration file "/root/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
    info "(gdb)Auto-loading safe path"
[?2004h(gdb) bt full
[?2004l
#0  0x00007fc47217033a in raise () from /nix/store/adxc893j47gxx3xjw403zdf0liiddvw2-glibc-2.32-48/lib/libc.so.6
No symbol table info available.
#1  0x00007fc47215a523 in abort () from /nix/store/adxc893j47gxx3xjw403zdf0liiddvw2-glibc-2.32-48/lib/libc.so.6
No symbol table info available.
#2  0x00007fc47215a41f in __assert_fail_base.cold.0 () from /nix/store/adxc893j47gxx3xjw403zdf0liiddvw2-glibc-2.32-48/lib/libc.so.6
No symbol table info available.
#3  0x00007fc472168d92 in __assert_fail () from /nix/store/adxc893j47gxx3xjw403zdf0liiddvw2-glibc-2.32-48/lib/libc.so.6
No symbol table info available.
#4  0x00007fc4729c45d3 in nix::BasicDerivation::nameFromPath(nix::StorePath const&) () from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#5  0x00007fc472acea34 in nix::readDerivationCommon(nix::Store&, nix::StorePath const&, bool) () from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#6  0x00007fc472acec00 in nix::Store::readInvalidDerivation(nix::StorePath const&) () from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#7  0x00007fc472a3b3cd in nix::LocalStore::queryPartialDerivationOutputMap[abi:cxx11](nix::StorePath const&) () from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#8  0x00007fc472a56dcf in nix::Store::queryMissing(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath> > const&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, unsigned long&, unsigned long&)::{lambda(nix::DerivedPath const&)#3}::operator()(nix::DerivedPath const&) const::{lambda(nix::DerivedPathBuilt)#1}::operator()(nix::DerivedPathBuilt) const ()
   from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#9  0x00007fc472a57b02 in std::__detail::__variant::__gen_vtable_impl<std::__detail::__variant::_Multi_array<std::__detail::__variant::__deduce_visit_result<void> (*)(nix::overloaded<nix::Store::queryMissing(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath> > const&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, unsigned long&, unsigned long&)::{lambda(nix::DerivedPath const&)#3}::operator()(nix::DerivedPath const&) const::{lambda(nix::DerivedPathBuilt)#1}, nix::Store::queryMissing(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath> > const&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, unsigned long&, unsigned long&)::{lambda(nix::DerivedPath const&)#3}::operator()(nix::DerivedPath const&) const::{lambda(nix::DerivedPathOpaque)#2}>&&, std::variant<nix::DerivedPathOpaque, nix::DerivedPathBuilt> const&)>, std::integer_sequence<unsigned long, 1ul> >::__visit_invoke(nix::overloaded<nix::Store::queryMissing(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath> > const&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, unsigned long&, unsigned long&)::{lambda(nix::DerivedPath const&)#3}::operator()(nix::DerivedPath const&) const::{lambda(nix::DerivedPathBuilt)#1}, nix::Store::queryMissing(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath> > const&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, unsigned long&, unsigned long&)::{lambda(nix::DerivedPath const&)#3}::operator()(nix::DerivedPath const&) const::{lambda(nix::DerivedPathOpaque)#2}>&&, std::variant<nix::DerivedPathOpaque, nix::DerivedPathBuilt> const&) () from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#10 0x00007fc472a58e36 in std::_Function_handler<void (nix::DerivedPath), nix::Store::queryMissing(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath> > const&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, unsigned long&, unsigned long&)::{lambda(nix::DerivedPath const&)#3}>::_M_invoke(std::_Any_data const&, nix::DerivedPath&&) ()
   from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#11 0x00007fc472a5a2e7 in std::_Function_handler<void (), std::_Bind<std::function<void (nix::DerivedPath)> (nix::DerivedPath)> >::_M_invoke(std::_Any_data const&) ()
   from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#12 0x00007fc47277f91a in nix::ThreadPool::doWork(bool) () from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixutil.so
No symbol table info available.
#13 0x00007fc472781405 in nix::ThreadPool::process() () from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixutil.so
No symbol table info available.
#14 0x00007fc472a54f9d in nix::Store::queryMissing(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath> > const&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, unsigned long&, unsigned long&) ()
   from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#15 0x00007fc4729b82dd in nix::daemon::processConnection(nix::ref<nix::Store>, nix::FdSource&, nix::FdSink&, nix::daemon::TrustedFlag, nix::daemon::RecursiveFlag, std::function<void (nix::Store&)>) ()
   from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#16 0x000000000052593c in std::_Function_handler<void (), daemonLoop()::{lambda()#1}>::_M_invoke(std::_Any_data const&) ()
No symbol table info available.
#17 0x00007fc47279e00c in std::_Function_handler<void (), nix::startProcess(std::function<void ()>, nix::ProcessOptions const&)::{lambda()#1}>::_M_invoke(std::_Any_data const&) ()
   from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixutil.so
No symbol table info available.
#18 0x00007fc472799af9 in nix::doFork(bool, std::function<void ()>) () from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixutil.so
No symbol table info available.
#19 0x00007fc47279de99 in nix::startProcess(std::function<void ()>, nix::ProcessOptions const&) () from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixutil.so
No symbol table info available.
#20 0x0000000000526951 in runDaemon(bool) ()
No symbol table info available.
#21 0x0000000000527175 in main_nix_daemon(int, char**) ()
No symbol table info available.
#22 0x0000000000585b95 in nix::mainWrapped(int, char**) ()
No symbol table info available.
#23 0x00007fc472ca58b8 in nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void ()>) ()
   from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixmain.so
No symbol table info available.
#24 0x0000000000477b96 in main ()
No symbol table info available.
[?2004h(gdb) 
[?2004l
#0  0x00007fc47217033a in raise () from /nix/store/adxc893j47gxx3xjw403zdf0liiddvw2-glibc-2.32-48/lib/libc.so.6
No symbol table info available.
#1  0x00007fc47215a523 in abort () from /nix/store/adxc893j47gxx3xjw403zdf0liiddvw2-glibc-2.32-48/lib/libc.so.6
No symbol table info available.
#2  0x00007fc47215a41f in __assert_fail_base.cold.0 () from /nix/store/adxc893j47gxx3xjw403zdf0liiddvw2-glibc-2.32-48/lib/libc.so.6
No symbol table info available.
#3  0x00007fc472168d92 in __assert_fail () from /nix/store/adxc893j47gxx3xjw403zdf0liiddvw2-glibc-2.32-48/lib/libc.so.6
No symbol table info available.
#4  0x00007fc4729c45d3 in nix::BasicDerivation::nameFromPath(nix::StorePath const&) () from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#5  0x00007fc472acea34 in nix::readDerivationCommon(nix::Store&, nix::StorePath const&, bool) () from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#6  0x00007fc472acec00 in nix::Store::readInvalidDerivation(nix::StorePath const&) () from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#7  0x00007fc472a3b3cd in nix::LocalStore::queryPartialDerivationOutputMap[abi:cxx11](nix::StorePath const&) () from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#8  0x00007fc472a56dcf in nix::Store::queryMissing(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath> > const&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, unsigned long&, unsigned long&)::{lambda(nix::DerivedPath const&)#3}::operator()(nix::DerivedPath const&) const::{lambda(nix::DerivedPathBuilt)#1}::operator()(nix::DerivedPathBuilt) const ()
   from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#9  0x00007fc472a57b02 in std::__detail::__variant::__gen_vtable_impl<std::__detail::__variant::_Multi_array<std::__detail::__variant::__deduce_visit_result<void> (*)(nix::overloaded<nix::Store::queryMissing(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath> > const&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, unsigned long&, unsigned long&)::{lambda(nix::DerivedPath const&)#3}::operator()(nix::DerivedPath const&) const::{lambda(nix::DerivedPathBuilt)#1}, nix::Store::queryMissing(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath> > const&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, unsigned long&, unsigned long&)::{lambda(nix::DerivedPath const&)#3}::operator()(nix::DerivedPath const&) const::{lambda(nix::DerivedPathOpaque)#2}>&&, std::variant<nix::DerivedPathOpaque, nix::DerivedPathBuilt> const&)>, std::integer_sequence<unsigned long, 1ul> >::__visit_invoke(nix::overloaded<nix::Store::queryMissing(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath> > const&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, unsigned long&, unsigned long&)::{lambda(nix::DerivedPath const&)#3}::operator()(nix::DerivedPath const&) const::{lambda(nix::DerivedPathBuilt)#1}, nix::Store::queryMissing(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath> > const&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, unsigned long&, unsigned long&)::{lambda(nix::DerivedPath const&)#3}::operator()(nix::DerivedPath const&) const::{lambda(nix::DerivedPathOpaque)#2}>&&, std::variant<nix::DerivedPathOpaque, nix::DerivedPathBuilt> const&) () from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#10 0x00007fc472a58e36 in std::_Function_handler<void (nix::DerivedPath), nix::Store::queryMissing(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath> > const&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, unsigned long&, unsigned long&)::{lambda(nix::DerivedPath const&)#3}>::_M_invoke(std::_Any_data const&, nix::DerivedPath&&) ()
   from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#11 0x00007fc472a5a2e7 in std::_Function_handler<void (), std::_Bind<std::function<void (nix::DerivedPath)> (nix::DerivedPath)> >::_M_invoke(std::_Any_data const&) ()
   from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#12 0x00007fc47277f91a in nix::ThreadPool::doWork(bool) () from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixutil.so
No symbol table info available.
#13 0x00007fc472781405 in nix::ThreadPool::process() () from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixutil.so
No symbol table info available.
#14 0x00007fc472a54f9d in nix::Store::queryMissing(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath> > const&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, std::set<nix::StorePath, std::less<nix::StorePath>, std::allocator<nix::StorePath> >&, unsigned long&, unsigned long&) ()
   from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#15 0x00007fc4729b82dd in nix::daemon::processConnection(nix::ref<nix::Store>, nix::FdSource&, nix::FdSink&, nix::daemon::TrustedFlag, nix::daemon::RecursiveFlag, std::function<void (nix::Store&)>) ()
   from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixstore.so
No symbol table info available.
#16 0x000000000052593c in std::_Function_handler<void (), daemonLoop()::{lambda()#1}>::_M_invoke(std::_Any_data const&) ()
No symbol table info available.
#17 0x00007fc47279e00c in std::_Function_handler<void (), nix::startProcess(std::function<void ()>, nix::ProcessOptions const&)::{lambda()#1}>::_M_invoke(std::_Any_data const&) ()
   from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixutil.so
No symbol table info available.
#18 0x00007fc472799af9 in nix::doFork(bool, std::function<void ()>) () from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixutil.so
No symbol table info available.
#19 0x00007fc47279de99 in nix::startProcess(std::function<void ()>, nix::ProcessOptions const&) () from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixutil.so
No symbol table info available.
#20 0x0000000000526951 in runDaemon(bool) ()
No symbol table info available.
#21 0x0000000000527175 in main_nix_daemon(int, char**) ()
No symbol table info available.
#22 0x0000000000585b95 in nix::mainWrapped(int, char**) ()
No symbol table info available.
#23 0x00007fc472ca58b8 in nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void ()>) ()
   from /nix/store/xylpxd82bi25cp9xcmp5a8psx8qh6i4p-nix-2.4pre20210601_5985b8b/lib/libnixmain.so
No symbol table info available.
#24 0x0000000000477b96 in main ()
No symbol table info available.
[?2004h(gdb)  [?2004l
quit
domenkozar commented 3 years ago

@regnat this seems pretty bad?

thufschmitt commented 3 years ago

@regnat this seems pretty bad?

The fact that it causes the daemon to crash is bad, indeed. The fact that it’s not working seems pretty legit given that the installation script (purposely) creates a drvPath that’s not valid (both because it’s not pointing to an existing drv and because it doesn’t have the right shape for a drv path).

Did this use to work?

domenkozar commented 3 years ago

Yes, this used to work on 2.3

ncfavier commented 2 years ago

I think I just hit this, both locally and in GitHub actions.

domenkozar commented 2 years ago

@regnat is there a workaround?

ncfavier commented 2 years ago

My nix-daemon logs look like this:

Dec 21 17:20:23 no nix-daemon[77914]: accepted connection from pid 78026, user n (trusted)
Dec 21 17:20:52 no nix-daemon[77914]: accepted connection from pid 78327, user n (trusted)
Dec 21 17:21:07 no nix-daemon[78344]: nix-daemon: src/libstore/sqlite.cc:92: nix::SQLiteStmt::Use::Use(nix::SQLiteStmt&): Assertion `stmt.stmt' failed.
Dec 21 17:21:21 no systemd[1]: Stopping Nix Daemon...
Dec 21 17:21:21 no systemd[1]: nix-daemon.service: Deactivated successfully.
Dec 21 17:21:21 no systemd[1]: Stopped Nix Daemon.
Dec 21 17:21:21 no systemd[1]: nix-daemon.service: Consumed 5.313s CPU time, no IO, received 310B IP traffic, sent 206B IP traffic.
-- Boot caeef82e0b224a888aaccb9a711810da --
Dec 21 17:21:48 no systemd[1]: Started Nix Daemon.
Dec 21 17:21:48 no nix-daemon[1170]: accepted connection from pid 1093, user n (trusted)
Dec 21 17:21:49 no nix-daemon[1170]: accepted connection from pid 1681, user n (trusted)
Dec 21 17:22:08 no nix-daemon[1170]: accepted connection from pid 3117, user n (trusted)
Dec 21 17:22:08 no nix-daemon[3130]: nix-daemon: src/libstore/derivations.cc:630: static std::string_view nix::BasicDerivation::nameFromPath(const nix::StorePath&): Assertion `hasSuffix(nameWithSuffix, extension)' failed.
Dec 21 17:22:32 no nix-daemon[1170]: accepted connection from pid 4254, user n (trusted)
Dec 21 17:22:32 no nix-daemon[1170]: accepted connection from pid 4479, user n (trusted)
Dec 21 17:22:44 no nix-daemon[1170]: accepted connection from pid 4962, user n (trusted)
Dec 21 17:22:44 no nix-daemon[4975]: nix-daemon: src/libstore/derivations.cc:630: static std::string_view nix::BasicDerivation::nameFromPath(const nix::StorePath&): Assertion `hasSuffix(nameWithSuffix, extension)' failed.
Dec 21 17:36:02 no nix-daemon[1170]: accepted connection from pid 13458, user n (trusted)
Dec 21 17:36:13 no nix-daemon[1170]: accepted connection from pid 13594, user n (trusted)
Dec 21 17:36:13 no nix-daemon[13607]: nix-daemon: src/libstore/derivations.cc:630: static std::string_view nix::BasicDerivation::nameFromPath(const nix::StorePath&): Assertion `hasSuffix(nameWithSuffix, extension)' failed.
Dec 21 17:56:23 no nix-daemon[1170]: accepted connection from pid 23970, user n (trusted)
Dec 21 17:56:23 no nix-daemon[23985]: nix-daemon: src/libstore/derivations.cc:630: static std::string_view nix::BasicDerivation::nameFromPath(const nix::StorePath&): Assertion `hasSuffix(nameWithSuffix, extension)' failed.

Sorry I can't provide precise information as to how I got there, I'm confused myself and I think there might be several bugs interacting.

The least I can tell is I'm using Nix 2.4 and messing around with flakes and ca-derivations.

ncfavier commented 2 years ago

Ah, the first error in those logs seems to be from https://github.com/NixOS/nix/issues/5017

thufschmitt commented 2 years ago

@regnat is there a workaround?

First thing that comes to my mind would be something like

with import <nixpkgs> {};                                                                           
buildEnv {                                                                                          
  name = "cachix-env";                                                                              
  paths = [ /nix/store/3lqc09mn31yd05mcy6gcd9nsbcwwphic-cachix-0.6.1 ];                             
}

(this relies on nixpkgs, but you can probably do something with builtin:buildenv instead).

Ideally nix-env should be able to take direct paths as input. Not sure why that’s not the case

edolstra commented 1 year ago

Does this issue still exist?

Ericson2314 commented 1 year ago

Yeah it seems like it wouldn't anymore.

kjeremy commented 7 months ago

I can reproduce this with nix 2.21.0.

I did the following nix profile install cachix -vvv --quiet -j8 -f https://cachix.org/api/v1/install and the daemon crashed:

linking '/nix/store/k86zg9jv1nbk4l46yynhllg8sf93cp6m-nix-2.16.2/lib/libboost_thread.so' to '/nix/store/.links/16cxvl4cg3xjbmrwhgwvrldvfp69qcadxvqg6m9sw8g929wah9qc'
linking '/nix/store/k86zg9jv1nbk4l46yynhllg8sf93cp6m-nix-2.16.2/lib/tmpfiles.d/nix-daemon.conf' to '/nix/store/.links/13glwg0wrn8z6l3bc2ml5wyhq4v9yhlh1yqlbs262yzkq8vsmwh0'
copying path '/nix/store/gw5pl0by3lqcznmgf4fykhbkz3x5shrl-cachix-1.7-bin' from 'https://cache.nixos.org'...
downloading 'https://cache.nixos.org/nar/15gv8sv61cd3361xv8bg686pc1c6bbx7p981khvvijnqmdxd069x.nar.xz'...
error: Nix daemon disconnected unexpectedly (maybe it crashed?)

journalctl reports:

Apr 05 15:38:56 nixos nix-daemon[303110]: nix-daemon: src/libstore/derivations.cc:935: static std::string_view nix::BasicDerivation::nameFromPath(const nix::StorePath&): Assertion `hasSuffix(nameWithSuffix, extension)' failed.
Apr 05 15:38:56 nixos systemd[1]: Created slice Slice /system/systemd-coredump.
Apr 05 15:38:56 nixos systemd[1]: Started Process Core Dump (PID 303190/UID 0).
Apr 05 15:38:56 nixos systemd-timesyncd[755]: Network configuration changed, trying to establish connection.
Apr 05 15:38:56 nixos systemd-timesyncd[755]: Network configuration changed, trying to establish connection.
Apr 05 15:38:56 nixos systemd-timesyncd[755]: Network configuration changed, trying to establish connection.
Apr 05 15:39:03 nixos systemd-coredump[303191]: [🡕] Process 303110 (nix-daemon) of user 0 dumped core.

                                                Module libkeyutils.so.1 without build-id.
                                                Module libkrb5support.so.0 without build-id.
                                                Module libcom_err.so.3 without build-id.
                                                Module libk5crypto.so.3 without build-id.
                                                Module libkrb5.so.3 without build-id.
                                                Module libunistring.so.5 without build-id.
                                                Module libattr.so.1 without build-id.
                                                Module libbrotlicommon.so.1 without build-id.
                                                Module libaws-c-common.so.1 without build-id.
                                                Module libaws-checksums.so.1.0.0 without build-id.
                                                Module libaws-c-sdkutils.so.1.0.0 without build-id.
                                                Module libaws-c-cal.so.1.0.0 without build-id.
                                                Module libaws-c-compression.so.1.0.0 without build-id.
                                                Module libs2n.so.1 without build-id.
                                                Module libaws-c-io.so.1.0.0 without build-id.
                                                Module libaws-c-http.so.1.0.0 without build-id.
                                                Module libaws-c-auth.so.1.0.0 without build-id.
                                                Module libaws-c-s3.so.0unstable without build-id.
                                                Module libaws-c-event-stream.so.1.0.0 without build-id.
                                                Module libaws-c-mqtt.so.1.0.0 without build-id.
                                                Module libgssapi_krb5.so.2 without build-id.
                                                Module libpsl.so.5 without build-id.
                                                Module libidn2.so.0 without build-id.
                                                Module libnghttp2.so.14 without build-id.
                                                Module libxml2.so.2 without build-id.
                                                Module libbz2.so.1 without build-id.
                                                Module libzstd.so.1 without build-id.
                                                Module liblzma.so.5 without build-id.
                                                Module libacl.so.1 without build-id.
                                                Module libz.so.1 without build-id.
                                                Module libssh2.so.1 without build-id.
                                                Module libpcre.so.1 without build-id.
                                                Module libhttp_parser.so.2.9 without build-id.
                                                Module libcpuid.so.16 without build-id.
                                                Module libbrotlidec.so.1 without build-id.
                                                Module libbrotlienc.so.1 without build-id.
                                                Module libseccomp.so.2 without build-id.
                                                Module libaws-crt-cpp.so without build-id.
                                                Module libaws-cpp-sdk-core.so without build-id.
                                                Module libaws-cpp-sdk-s3.so without build-id.
                                                Module libaws-cpp-sdk-transfer.so without build-id.
                                                Module libarchive.so.13 without build-id.
                                                Module libgit2.so.1.7 without build-id.
                                                Module libboost_context.so.1.81.0 without build-id.
                                                Module libgcc_s.so.1 without build-id.
                                                Module libstdc++.so.6 without build-id.
                                                Module liblowdown.so.1 without build-id.
                                                Module libeditline.so.1 without build-id.
                                                Stack trace of thread 303110:
                                                #0  0x00007fb2611c207c __pthread_kill_implementation (libc.so.6 + 0x8d07c)
                                                #1  0x00007fb261172e06 raise (libc.so.6 + 0x3de06)
                                                #2  0x00007fb26115b8f5 abort (libc.so.6 + 0x268f5)
                                                #3  0x00007fb26115b819 __assert_fail_base.cold (libc.so.6 + 0x26819)
                                                #4  0x00007fb26116b686 __assert_fail (libc.so.6 + 0x36686)
                                                #5  0x00007fb261957ead _ZN3nix15BasicDerivation12nameFromPathERKNS_9StorePathE (libnixstore.so + 0x157ead)
                                                #6  0x00007fb261a19427 _ZN3nixL20readDerivationCommonERNS_5StoreERKNS_9StorePathEb (libnixstore.so + 0x219427)
                                                #7  0x00007fb261a19572 _ZN3nix5Store14readDerivationERKNS_9StorePathE (libnixstore.so + 0x219572)
                                                #8  0x00007fb2619054f9 _ZN3nix14DerivationGoal14loadDerivationEv (libnixstore.so + 0x1054f9)
                                                #9  0x00007fb261949f1a _ZN3nix6Worker3runERKSt3setISt10shared_ptrINS_4GoalEENS_15CompareGoalPtrsESaIS4_EE (libnixstore.so + 0x149f1a)
                                                #10 0x00007fb2619192ba _ZN3nix5Store21buildPathsWithResultsERKSt6vectorINS_11DerivedPathESaIS2_EENS_9BuildModeESt10shared_ptrIS0_E (libnixstore.so + 0x1192ba)
                                                #11 0x00007fb261952c88 _ZN3nix6daemonL9performOpEPNS0_12TunnelLoggerENS_3refINS_5StoreEEENS_11TrustedFlagENS0_13RecursiveFlagEjRNS_6SourceERNS_12BufferedSinkENS_11WorkerProto2OpE (libnixstore.so + 0x152c88)
                                                #12 0x00007fb2619570a8 _ZN3nix6daemon17processConnectionENS_3refINS_5StoreEEERNS_8FdSourceERNS_6FdSinkENS_11TrustedFlagENS0_13RecursiveFlagE (libnixstore.so + 0x1570a8)
                                                #13 0x00005608942b503d _ZNSt17_Function_handlerIFvvEZL10daemonLoopSt8optionalIN3nix11TrustedFlagEEEUlvE_E9_M_invokeERKSt9_Any_data (nix + 0x10d03d)
                                                #14 0x00007fb261798a1d _ZNSt17_Function_handlerIFvvEZN3nix12startProcessESt8functionIS0_ERKNS1_14ProcessOptionsEEUlvE_E9_M_invokeERKSt9_Any_data.lto_priv.0 (libnixutil.so + 0xc2a1d)
                                                #15 0x00007fb2617afda9 _ZN3nixL6doForkEbRSt8functionIFvvEE.constprop.0 (libnixutil.so + 0xd9da9)
                                                #16 0x00007fb26179895f _ZN3nix12startProcessESt8functionIFvvEERKNS_14ProcessOptionsE (libnixutil.so + 0xc295f)
                                                #17 0x00005608942b5815 _ZL10daemonLoopSt8optionalIN3nix11TrustedFlagEE (nix + 0x10d815)
                                                #18 0x00005608942b6a0a _ZL15main_nix_daemoniPPc.lto_priv.0 (nix + 0x10ea0a)
                                                #19 0x00005608942fbc6f _ZN3nix11mainWrappedEiPPc (nix + 0x153c6f)
                                                #20 0x00007fb262063985 _ZN3nix16handleExceptionsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt8functionIFvvEE (libnixmain.so + 0x24985)
                                                #21 0x000056089424884c main (nix + 0xa084c)
                                                #22 0x00007fb26115d0ce __libc_start_call_main (libc.so.6 + 0x280ce)
                                                #23 0x00007fb26115d189 __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x28189)
                                                #24 0x000056089424d1d5 _start (nix + 0xa51d5)

                                                Stack trace of thread 303113:
                                                #0  0x00007fb26123589f __poll (libc.so.6 + 0x10089f)
                                                #1  0x00007fb2608348e0 Curl_poll (libcurl.so.4 + 0x618e0)
                                                #2  0x00007fb26082ac5a multi_wait.part.0 (libcurl.so.4 + 0x57c5a)
                                                #3  0x00007fb26082ae67 curl_multi_wait (libcurl.so.4 + 0x57e67)
                                                #4  0x00007fb2619793b7 _ZN3nix16curlFileTransfer16workerThreadMainEv (libnixstore.so + 0x1793b7)
                                                #5  0x00007fb26197ad60 _ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJZN3nix16curlFileTransferC4EvEUlvE_EEEEE6_M_runEv (libnixstore.so + 0x17ad60)
                                                #6  0x00007fb2614e8683 execute_native_thread_routine (libstdc++.so.6 + 0xe8683)
                                                #7  0x00007fb2611c0383 start_thread (libc.so.6 + 0x8b383)
                                                #8  0x00007fb26124300c __clone3 (libc.so.6 + 0x10e00c)

                                                Stack trace of thread 303111:
                                                #0  0x00007fb26123589f __poll (libc.so.6 + 0x10089f)
                                                #1  0x00007fb26194fd8f _ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJZN3nix12MonitorFdHupC4EiEUlvE_EEEEE6_M_runEv (libnixstore.so + 0x14fd8f)
                                                #2  0x00007fb2614e8683 execute_native_thread_routine (libstdc++.so.6 + 0xe8683)
                                                #3  0x00007fb2611c0383 start_thread (libc.so.6 + 0x8b383)
                                                #4  0x00007fb26124300c __clone3 (libc.so.6 + 0x10e00c)
                                                ELF object binary architecture: AMD x86-64
MidAutumnMoon commented 5 months ago

Still be able to reproduce on nix 2.21.2 using nix profile.

Command:

sudo nix profile install --profile ./p -f https://cachix.org/api/v1/install cachix

Output:

nix: src/libstore/derivations.cc:935: static std::string_view nix::BasicDerivation::nameFromPath(const nix::StorePath&): Assertion `hasSuffix(nameWithSuffix, extension)' failed.
Ericson2314 commented 5 months ago

minimized:

let
  package = {
    name = "cachix-1.7.3";
    type = "derivation";
    system = "x86_64-linux";
    outputs = [ "out" ];
    # TODO: we lie here so that Nix won't build it
    drvPath = "/nix/store/8qlfcic10lw5304gqm8q45nr7g7jl62b-cachix-1.7.3-bin";
    outputName = "out";
    outPath = "/nix/store/8qlfcic10lw5304gqm8q45nr7g7jl62b-cachix-1.7.3-bin";
    out = package;
  };
in
package

building this with the daemon will cause the daemon to crash.