Lix client keeps onto eval-cache lock while building #608

Open
opened 2024-12-27 23:08:47 +00:00 by yu-re-ka · 5 comments
Member

Describe the bug

[yuka@yuyu:~/proj/nixpkgs]$ lsof /home/yuka/.cache/nix/eval-cache-v5/da35028cde15e478e43bd4a6095682652f83d3611a2fb1c4cb947e1547e708c1.sqlite
      Output information may be incomplete.                                                                 
COMMAND     PID USER FD   TYPE DEVICE SIZE/OFF      NODE NAME                                               
nix      451641 yuka 4u   REG  254,1    12288 269304390 /home/yuka/.cache/nix/eval-cache-v5/da35028cde15e478e43bd4a6095682652f83d3611a2fb1c4cb947e1547e708c1.sqlite
nix      616970 yuka 4u   REG  254,1    12288 269304390 /home/yuka/.cache/nix/eval-cache-v5/da35028cde15e478e43bd4a6095682652f83d3611a2fb1c4cb947e1547e708c1.sqlite
nix      837312 yuka 4u   REG  254,1    12288 269304390 /home/yuka/.cache/nix/eval-cache-v5/da35028cde15e478e43bd4a6095682652f83d3611a2fb1c4cb947e1547e708c1.sqlite
nix      942240 yuka 4u   REG  254,1    12288 269304390 /home/yuka/.cache/nix/eval-cache-v5/da35028cde15e478e43bd4a6095682652f83d3611a2fb1c4cb947e1547e708c1.sqlite
nix      993433 yuka 4u   REG  254,1    12288 269304390 /home/yuka/.cache/nix/eval-cache-v5/da35028cde15e478e43bd4a6095682652f83d3611a2fb1c4cb947e1547e708c1.sqlite
nix     3112563 yuka 4uw  REG  254,1    12288 269304390 /home/yuka/.cache/nix/eval-cache-v5/da35028cde15e478e43bd4a6095682652f83d3611a2fb1c4cb947e1547e708c1.sqlite
nix     3116532 yuka 4ur  REG  254,1    12288 269304390 /home/yuka/.cache/nix/eval-cache-v5/da35028cde15e478e43bd4a6095682652f83d3611a2fb1c4cb947e1547e708c1.sqlite

Process with id 3112563 is holding a write lock.
A stack trace from this process tells us that it is busy building something.

Steps To Reproduce

Start multiple builds of firefox from staging on the same machine
The second and following processes get stuck evaluating

Expected behavior

First process should drop the write lock as soon as it's done evaluating

nix --version output

nix (Lix, like Nix) 2.92.0-dev-pre20241211-92ed9fe

Additional context

Add any other context about the problem here.

## Describe the bug ``` [yuka@yuyu:~/proj/nixpkgs]$ lsof /home/yuka/.cache/nix/eval-cache-v5/da35028cde15e478e43bd4a6095682652f83d3611a2fb1c4cb947e1547e708c1.sqlite Output information may be incomplete. COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME nix 451641 yuka 4u REG 254,1 12288 269304390 /home/yuka/.cache/nix/eval-cache-v5/da35028cde15e478e43bd4a6095682652f83d3611a2fb1c4cb947e1547e708c1.sqlite nix 616970 yuka 4u REG 254,1 12288 269304390 /home/yuka/.cache/nix/eval-cache-v5/da35028cde15e478e43bd4a6095682652f83d3611a2fb1c4cb947e1547e708c1.sqlite nix 837312 yuka 4u REG 254,1 12288 269304390 /home/yuka/.cache/nix/eval-cache-v5/da35028cde15e478e43bd4a6095682652f83d3611a2fb1c4cb947e1547e708c1.sqlite nix 942240 yuka 4u REG 254,1 12288 269304390 /home/yuka/.cache/nix/eval-cache-v5/da35028cde15e478e43bd4a6095682652f83d3611a2fb1c4cb947e1547e708c1.sqlite nix 993433 yuka 4u REG 254,1 12288 269304390 /home/yuka/.cache/nix/eval-cache-v5/da35028cde15e478e43bd4a6095682652f83d3611a2fb1c4cb947e1547e708c1.sqlite nix 3112563 yuka 4uw REG 254,1 12288 269304390 /home/yuka/.cache/nix/eval-cache-v5/da35028cde15e478e43bd4a6095682652f83d3611a2fb1c4cb947e1547e708c1.sqlite nix 3116532 yuka 4ur REG 254,1 12288 269304390 /home/yuka/.cache/nix/eval-cache-v5/da35028cde15e478e43bd4a6095682652f83d3611a2fb1c4cb947e1547e708c1.sqlite ``` Process with id 3112563 is holding a write lock. A stack trace from this process tells us that it is busy building something. ## Steps To Reproduce Start multiple builds of firefox from staging on the same machine The second and following processes get stuck evaluating ## Expected behavior First process should drop the write lock as soon as it's done evaluating ## `nix --version` output nix (Lix, like Nix) 2.92.0-dev-pre20241211-92ed9fe ## Additional context Add any other context about the problem here.
jade self-assigned this 2025-01-10 19:34:07 +00:00
Owner

Investigating this by using rr to trace builds.
It looks like we actually regressed this in 2.91 over 2.90.
Previously, in 2.90, the eval cache was destroyed in toDerivedPaths from nix::Installable::build2.

Now it is destroyed with the Command instance, which is definitely broken.

2.90:

instantiated 'hello-2.12.1' -> '/nix/store/psh7pyx4vg2kfl2h8r0sqrp374l1hnd6-hello-2.12.1.drv'
performing daemon worker op: 1
evaluating uncached attribute 'packages.x86_64-linux.foo'
evaluating uncached attribute 'packages.x86_64-linux.foo'
evaluating uncached attribute 'packages.x86_64-linux.foo.meta'
evaluating uncached attribute 'packages.x86_64-linux.foo.meta'
evaluating uncached attribute 'packages.x86_64-linux.foo.meta.outputsToInstall'

Thread 1 hit Breakpoint 3, nix::SQLiteTxn::commit (this=0x34df4f50) at src/libstore/sqlite.cc:229
warning: 229    src/libstore/sqlite.cc: No such file or directory
(rr) dir lix-src/
Source directories searched: /home/jade/lix/lix-mercury/lix-src:$cdir:$cwd
(rr) bt
#0  nix::SQLiteTxn::commit (this=0x34df4f50) at src/libstore/sqlite.cc:229
#1  0x00007ec66d73bac4 in nix::eval_cache::AttrDb::~AttrDb (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/unique_ptr.h:199
#2  std::destroy_at<nix::eval_cache::AttrDb> (__location=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:88
#3  std::_Destroy<nix::eval_cache::AttrDb> (__pointer=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:149
#4  std::allocator_traits<std::allocator<void> >::destroy<nix::eval_cache::AttrDb> (__p=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/alloc_traits.h:675
#5  std::_Sp_counted_ptr_inplace<nix::eval_cache::AttrDb, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x34e35d10)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:613
#6  0x00007ec66dd174d7 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x34e35d10)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:346
#7  std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x34e35d10) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:317
#8  0x00007ec66dd441d7 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071
#9  std::__shared_ptr<nix::eval_cache::AttrDb, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524
#10 std::shared_ptr<nix::eval_cache::AttrDb>::~shared_ptr (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr.h:175
#11 nix::eval_cache::EvalCache::~EvalCache (this=<optimized out>, this=<optimized out>) at src/libexpr/eval-cache.hh:16
#12 std::destroy_at<nix::eval_cache::EvalCache> (__location=0x34e34ff0) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:88
#13 std::_Destroy<nix::eval_cache::EvalCache> (__pointer=0x34e34ff0) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:149
#14 std::allocator_traits<std::allocator<void> >::destroy<nix::eval_cache::EvalCache> (__p=0x34e34ff0)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/alloc_traits.h:675
#15 std::_Sp_counted_ptr_inplace<nix::eval_cache::EvalCache, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x34e34fe0)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:613
#16 0x00007ec66d7274ba in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use (this=0x34e34fe0)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:175
#17 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use_cold (this=0x34e34fe0)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:199
#18 0x00007ec66d73df41 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071
#19 std::__shared_ptr<nix::eval_cache::EvalCache, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524
#20 std::shared_ptr<nix::eval_cache::EvalCache>::~shared_ptr (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr.h:175
#21 nix::ref<nix::eval_cache::EvalCache>::~ref (this=<optimized out>, this=<optimized out>) at src/libutil/ref.hh:16
#22 nix::eval_cache::AttrCursor::~AttrCursor (this=<optimized out>, this=<optimized out>) at src/libexpr/eval-cache.hh:71
#23 std::destroy_at<nix::eval_cache::AttrCursor> (__location=0x34e50160) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:88
#24 std::_Destroy<nix::eval_cache::AttrCursor> (__pointer=0x34e50160) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:149
#25 std::allocator_traits<std::allocator<void> >::destroy<nix::eval_cache::AttrCursor> (__p=0x34e50160)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/alloc_traits.h:675
#26 std::_Sp_counted_ptr_inplace<nix::eval_cache::AttrCursor, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x34e50150)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:613
#27 0x00007ec66dd1742a in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use (this=0x34e50150)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:175
#28 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use_cold (this=0x34e50150)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:199
#29 0x00007ec66dd42121 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071
#30 std::__shared_ptr<nix::eval_cache::AttrCursor, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524
#31 std::shared_ptr<nix::eval_cache::AttrCursor>::~shared_ptr (this=<optimized out>, this=<optimized out>)
--Type <RET> for more, q to quit, c to continue without paging--c
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr.h:175
#32 nix::ref<nix::eval_cache::AttrCursor>::~ref (this=<optimized out>, this=<optimized out>) at src/libutil/ref.hh:16
#33 nix::InstallableFlake::toDerivedPaths (this=<optimized out>) at src/libcmd/installable-flake.cc:165
#34 0x00007ec66dd52864 in nix::Installable::build2 (evalStore=..., store=..., mode=nix::Realise::Outputs, installables=..., bMode=nix::bmNormal) at src/libcmd/installables.cc:596
#35 0x00007ec66dd4bcb1 in nix::Installable::build (evalStore=..., store=..., mode=mode@entry=nix::Realise::Outputs, installables=std::vector of length 1, capacity 1 = {...},
    bMode=bMode@entry=nix::bmNormal) at src/libcmd/installables.cc:540
#36 0x0000000000482251 in CmdBuild::run (this=0x34d614d0, store=..., installables=...) at src/nix/build.cc:137
#37 0x00007ec66dd56705 in nix::InstallablesCommand::run (this=0x34d614d0, store=..., rawInstallables=...) at src/libcmd/installables.cc:825
#38 0x00007ec66dd4c956 in nix::RawInstallablesCommand::run (this=0x34d614d0, store=...) at src/libcmd/installables.cc:810
#39 0x00007ec66dd2eb57 in nix::StoreCommand::run (this=0x34d617e0) at src/libcmd/command.cc:55
#40 0x00000000004e5813 in nix::mainWrapped (argc=7, argv=0x7ffdd4d16e88) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1349
#41 0x00007ec66d5e8a97 in std::function<void()>::operator() (this=0x7ffdd4d16d10) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/std_function.h:591
#42 nix::handleExceptions (programName="result/bin/nix", fun=...) at src/libmain/shared.cc:323
#43 0x000000000046ad0c in main (argc=<optimized out>, argv=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/allocator.h:163
(rr) c
Continuing.

Thread 1 hit Breakpoint 2, nix::SQLiteTxn::~SQLiteTxn (this=<optimized out>, this=<optimized out>) at src/libstore/sqlite.cc:235
235     SQLiteTxn::~SQLiteTxn()

2.91: destroyed with the InstallablesCommand:

unreferenced input: '/nix/store/vqjygx23hkim1kpidik5xcs9whayf3sr-bzip2-1.0.8-bin'
unreferenced input: '/nix/store/w8pnfazxqwmrqmwkb5zrz1bifsd8abxl-findutils-4.10.0'
unreferenced input: '/nix/store/wfxkyxmg47bhj098im5rp60hmkagn96x-mpfr-4.2.1'
unreferenced input: '/nix/store/wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh'
referenced input: '/nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36'
unreferenced input: '/nix/store/x9as7x6f7cdgcskvvn3yp02m662krr7y-binutils-wrapper-2.43.1'
unreferenced input: '/nix/store/xxfkk4gqnaimiwzi6mmsmcs9bl2r8y7f-isl-0.20'
unreferenced input: '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh'
unreferenced input: '/nix/store/y11zr71f9i1zy1vrdy3kjx8j6slsb3l3-gmp-6.3.0'
unreferenced input: '/nix/store/ybjcla5bhj8g1y84998pn4a2drfxybkv-gcc-13.3.0-lib'
unreferenced input: '/nix/store/zhaypw0znkjnymg0rk1599zn21rr0l50-gnutar-1.35'
unreferenced input: '/nix/store/zw5haplzbwjgbp3yykhm6iprkpfppzxb-glibc-2.40-36-bin'
lock released on '/nix/store/3xffwsj1rghf1d6rrhindc5m0241whvi-hello-2.12.1.lock'
building of '/nix/store/psdv7hc5y2k9mjw26m16p6968sj1j7ip-hello-2.12.1.drv^out' from .drv file: done
building of '/nix/store/psdv7hc5y2k9mjw26m16p6968sj1j7ip-hello-2.12.1.drv^out' from .drv file: goal destroyed
performing daemon worker op: 11
performing daemon worker op: 12

Thread 1 hit Breakpoint 4, nix::SQLiteTxn::commit (this=0xcece630) at src/libstore/sqlite.cc:239
239     {
(rr) bt
#0  nix::SQLiteTxn::commit (this=0xcece630) at src/libstore/sqlite.cc:239
#1  0x000075706e8cd46c in nix::eval_cache::AttrDb::~AttrDb (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/unique_ptr.h:199
#2  std::destroy_at<nix::eval_cache::AttrDb> (__location=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:88
#3  std::_Destroy<nix::eval_cache::AttrDb> (__pointer=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:149
#4  std::allocator_traits<std::allocator<void> >::destroy<nix::eval_cache::AttrDb> (__p=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/alloc_traits.h:675
#5  std::_Sp_counted_ptr_inplace<nix::eval_cache::AttrDb, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0xced3bd0)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:613
#6  0x000075706eed9e77 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0xced3bd0)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:346
#7  std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0xced3bd0) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:317
#8  0x000075706ef06df7 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071
#9  std::__shared_ptr<nix::eval_cache::AttrDb, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524
#10 std::shared_ptr<nix::eval_cache::AttrDb>::~shared_ptr (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr.h:175
#11 nix::eval_cache::EvalCache::~EvalCache (this=<optimized out>, this=<optimized out>) at src/libexpr/eval-cache.hh:16
#12 std::destroy_at<nix::eval_cache::EvalCache> (__location=0xced2420) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:88
#13 std::_Destroy<nix::eval_cache::EvalCache> (__pointer=0xced2420) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:149
#14 std::allocator_traits<std::allocator<void> >::destroy<nix::eval_cache::EvalCache> (__p=0xced2420)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/alloc_traits.h:675
#15 std::_Sp_counted_ptr_inplace<nix::eval_cache::EvalCache, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0xced2410)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:613
#16 0x000075706e8bbe7a in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use (this=0xced2410)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:175
#17 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use_cold (this=0xced2410) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:199
#18 0x000075706e8d8de5 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071
#19 std::__shared_ptr<nix::eval_cache::EvalCache, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524
#20 std::shared_ptr<nix::eval_cache::EvalCache>::~shared_ptr (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr.h:175
#21 nix::ref<nix::eval_cache::EvalCache>::~ref (this=<optimized out>, this=<optimized out>) at src/libutil/ref.hh:16
--Type <RET> for more, q to quit, c to continue without paging--c
#22 std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >::~pair (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_pair.h:187
#23 std::destroy_at<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > (__location=0xcecbc50)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:88
#24 std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > > >::destroy<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCac
he> > > (__p=0xcecbc50, __a=...) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/alloc_traits.h:560
#25 std::_Rb_tree<nix::Hash const, std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >, std::_Select1st<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > >, std::less<nix:
:Hash const>, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::_M_destroy_node (__p=0xcecbc30, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_tree.h:625
#26 std::_Rb_tree<nix::Hash const, std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >, std::_Select1st<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > >, std::less<nix:
:Hash const>, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::_M_drop_node (this=<optimized out>, __p=0xcecbc30)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_tree.h:633
#27 std::_Rb_tree<nix::Hash const, std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >, std::_Select1st<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > >, std::less<nix:
:Hash const>, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::_M_erase (this=0x757053a6cb00, __x=0xcecbc30)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_tree.h:1938
#28 std::_Rb_tree<nix::Hash const, std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >, std::_Select1st<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > >, std::less<nix:
:Hash const>, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::~_Rb_tree (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_tree.h:986
#29 std::map<nix::Hash const, nix::ref<nix::eval_cache::EvalCache>, std::less<nix::Hash const>, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::~map (
    this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_map.h:314
#30 nix::EvalState::~EvalState (this=<optimized out>, this=<optimized out>) at src/libexpr/eval.cc:314
#31 0x000075706eed9dca in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use (this=0x757053a6c800)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:175
#32 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use_cold (this=0x757053a6c800)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:199
#33 0x000075706eef710d in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071
#34 std::__shared_ptr<nix::EvalState, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524
#35 std::shared_ptr<nix::EvalState>::~shared_ptr (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr.h:175
#36 nix::EvalCommand::~EvalCommand (this=<optimized out>, __vtt_parm=<optimized out>, this=<optimized out>, __vtt_parm=<optimized out>) at src/libcmd/command.cc:102
#37 0x000000000047cf2d in nix::MixFlakeOptions::~MixFlakeOptions (__vtt_parm=<optimized out>, this=<optimized out>, this=<optimized out>, __vtt_parm=<optimized out>) at src/libcmd/command.hh:96
#38 0x000000000047d093 in nix::RawInstallablesCommand::~RawInstallablesCommand (__vtt_parm=<optimized out>, this=<optimized out>, this=<optimized out>, __vtt_parm=<optimized out>)
    at src/libcmd/command.hh:160
#39 nix::InstallablesCommand::~InstallablesCommand (__vtt_parm=<optimized out>, this=<optimized out>, this=<optimized out>, __vtt_parm=<optimized out>) at src/libcmd/command.hh:184
#40 CmdBuild::~CmdBuild (this=<optimized out>, this=<optimized out>) at src/nix/build.cc:67
#41 0x0000000000471e47 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0xce366d0)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:346
#42 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0xce366d0) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:317
#43 0x00000000004e0058 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071
#44 std::__shared_ptr<nix::Command, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524
#45 std::shared_ptr<nix::Command>::~shared_ptr (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr.h:175
#46 nix::ref<nix::Command>::~ref (this=<optimized out>, this=<optimized out>) at src/libutil/ref.hh:16
#47 std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> >::~pair (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_pair.h:187
#48 std::_Optional_payload_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> > >::_M_destroy (this=0x7ffda825d5a0)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/optional:287
#49 std::_Optional_payload_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> > >::_M_reset (this=0x7ffda825d5a0)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/optional:318
#50 std::_Optional_payload<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> >, false, false, false>::~_Optional_payload (
    this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/optional:441
#51 std::_Optional_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> >, false, false>::~_Optional_base (this=<optimized out>,
    this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/optional:512
#52 std::optional<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> > >::~optional (this=<optimized out>, this=<optimized out>)
    at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/optional:707
#53 nix::MultiCommand::~MultiCommand (__vtt_parm=<optimized out>, this=<optimized out>, this=<optimized out>, __vtt_parm=<optimized out>) at src/libutil/args.hh:344
#54 nix::NixArgs::~NixArgs (this=<optimized out>, this=<optimized out>) at src/nix/main.cc:80
#55 0x00000000004e85b1 in nix::mainWrapped (argc=<optimized out>, argv=<optimized out>) at src/nix/main.cc:422
#56 0x000075706e771df7 in std::function<void()>::operator() (this=0x7ffda825df50) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/std_function.h:591
#57 nix::handleExceptions (programName="result/bin/nix", fun=...) at src/libmain/shared.cc:326
#58 0x000000000046b1b4 in main (argc=<optimized out>, argv=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/allocator.h:163

main:

Thread 1 hit Breakpoint 2, nix::SQLiteTxn::commit (this=0x591821bd38b0) at lix/libstore/sqlite.cc:241
241         if (sqlite3_exec(db, "commit;", 0, 0, 0) != SQLITE_OK)
(rr) bt
#0  nix::SQLiteTxn::commit (this=0x591821bd38b0) at lix/libstore/sqlite.cc:241
#1  0x0000753fbec86160 in nix::eval_cache::AttrDb::~AttrDb (this=0x591821beb8a0) at lix/libexpr/eval-cache.cc:70
#2  0x0000753fbf5b29ba in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x591821beb890)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:346
#3  std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x591821beb928) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071
#4  std::__shared_ptr<nix::eval_cache::AttrDb, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x591821beb920)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524
#5  nix::eval_cache::EvalCache::~EvalCache (this=0x591821beb910) at lix/libexpr/eval-cache.hh:38
#6  0x00005917f21d36da in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use (this=0x591821bd38b0)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:175
#7  std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use_cold (this=0x591821bd38b0)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:199
#8  0x0000753fbf59737e in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x591821beb900)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:353
#9  std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x591821be9c78) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071
#10 std::__shared_ptr<nix::eval_cache::EvalCache, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x591821be9c70)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524
#11 nix::ref<nix::eval_cache::EvalCache>::~ref (this=0x591821be9c70) at lix/libutil/ref.hh:16
#12 std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >::~pair (this=0x591821be9c20) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_pair.h:187
#13 std::destroy_at<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > (__location=0x591821be9c20)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:88
#14 std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > > >::destroy<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCa
che> > > (__p=0x591821be9c20, __a=...) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/alloc_traits.h:560
#15 std::_Rb_tree<nix::Hash, std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >, std::_Select1st<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > >, std::less<nix::Hash
>, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::_M_destroy_node (this=0x753fa3ba6f50, __p=0x591821be9c00)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_tree.h:625
#16 std::_Rb_tree<nix::Hash, std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >, std::_Select1st<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > >, std::less<nix::Hash
>, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::_M_drop_node (this=0x753fa3ba6f50, __p=0x591821be9c00)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_tree.h:633
#17 std::_Rb_tree<nix::Hash, std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >, std::_Select1st<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > >, std::less<nix::Hash
>, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::_M_erase (this=0x753fa3ba6f50, __x=0x591821be9c00)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_tree.h:1938
#18 0x0000753fbf596ba7 in std::_Rb_tree<nix::Hash, std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >, std::_Select1st<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >
>, std::less<nix::Hash>, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::~_Rb_tree (this=0x591821bd38b0)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_tree.h:986
#19 std::map<nix::Hash, nix::ref<nix::eval_cache::EvalCache>, std::less<nix::Hash>, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::~map (this=0x591821bd38b0)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_map.h:314
#20 nix::eval_cache::CachingEvaluator::~CachingEvaluator (this=0x753fa3ba6a90) at lix/libexpr/eval-cache.hh:25
--Type <RET> for more, q to quit, c to continue without paging--c
#21 std::destroy_at<nix::eval_cache::CachingEvaluator> (__location=0x753fa3ba6a90) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:88
#22 std::_Destroy<nix::eval_cache::CachingEvaluator> (__pointer=0x753fa3ba6a90) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:149
#23 std::allocator_traits<traceable_allocator<nix::EvalState> >::_S_destroy<traceable_allocator<nix::EvalState>, nix::eval_cache::CachingEvaluator> (__p=0x753fa3ba6a90)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/alloc_traits.h:293
#24 std::allocator_traits<traceable_allocator<nix::EvalState> >::destroy<nix::eval_cache::CachingEvaluator> (__a=..., __p=0x753fa3ba6a90)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/alloc_traits.h:393
#25 std::_Sp_counted_ptr_inplace<nix::eval_cache::CachingEvaluator, traceable_allocator<nix::EvalState>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x753fa3ba6a80)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:613
#26 0x0000753fbf58e5fe in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x753fa3ba6a80)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:346
#27 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x591821b9cac8) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071
#28 std::__shared_ptr<nix::eval_cache::CachingEvaluator, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x591821b9cac0)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524
#29 nix::EvalCommand::~EvalCommand (this=0x591821b9ca30, vtt=0x5917f23cad68 <VTT for CmdBuild+40>) at lix/libcmd/command.cc:96
#30 0x00005917f21e0f68 in nix::InstallablesCommand::~InstallablesCommand (this=0x591821b9ca30, vtt=<optimized out>) at lix/libcmd/command.hh:182
#31 CmdBuild::~CmdBuild (this=0x591821b9ca30, vtt=<optimized out>) at lix/nix/build.cc:67
#32 CmdBuild::~CmdBuild (this=0x591821b9ca30) at lix/nix/build.cc:67
#33 0x00005917f220f469 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x591821b9ca20)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:346
#34 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x7ffe48406268) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071
#35 std::__shared_ptr<nix::Command, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x7ffe48406260)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524
#36 nix::ref<nix::Command>::~ref (this=0x7ffe48406260) at lix/libutil/ref.hh:16
#37 std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> >::~pair (this=0x7ffe48406240)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_iterator.h:2992
#38 std::_Optional_payload_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> > >::_M_destroy (this=0x7ffe48406240)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/optional:287
#39 std::_Optional_payload_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> > >::_M_reset (this=0x7ffe48406240)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/optional:318
#40 std::_Optional_payload<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> >, false, false, false>::~_Optional_payload (
    this=0x7ffe48406240) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/optional:441
#41 std::_Optional_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> >, false, false>::~_Optional_base (this=0x7ffe48406240)
    at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/optional:512
#42 nix::MultiCommand::~MultiCommand (this=this@entry=0x7ffe484061d8, vtt=0x0, vtt@entry=0x5917f23e3c90 <VTT for nix::NixArgs+40>) at lix/libutil/args.hh:346
#43 0x00005917f2282278 in nix::NixArgs::~NixArgs (this=this@entry=0x7ffe48406190) at lix/nix/main.cc:107
#44 0x00005917f2279417 in nix::mainWrapped (argc=<optimized out>, argv=<optimized out>) at lix/nix/main.cc:530
#45 0x0000753fbea987d1 in std::function<void()>::operator() (this=0x7ffe484067a0) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/std_function.h:591
#46 nix::handleExceptions (programName="nix", fun=...) at lix/libmain/shared.cc:311
#47 0x00005917f227c84b in main (argc=7, argv=0x7ffe48406928) at lix/nix/main.cc:545

Proximate cause

We observe that the eval caches are being held alive by the installables
themselves as of 2.91. In 2.92, this is in CachingEvaluator.

The problem is that CachingEvaluator is intentionally holding these references alive longer than they otherwise would live.
That being said, neither CachingEvaluator nor the evaluator itself should be living as long as to start a build, so we still have a way to fix this.

The reason that this happened is this optimization:

commit fb7d3154115cb5cf211c5ddbc124e17ee519bb64
Author:     Eelco Dolstra <edolstra@gmail.com>
AuthorDate: Fri Apr 26 15:48:46 2024 +0200
Commit:     Qyriad <qyriad@qyriad.me>
CommitDate: Wed Jun 19 18:39:11 2024 +0000

    Merge pull request #10570 from layus/shared_caches

    Share evaluation caches across installables

Which is indeed contained in 2.91 but not in 2.90. Cool!

Fixing it

We need to kill the evaluator object once the evaluation phase is done. That's my next step.

Investigating this by using rr to trace builds. It looks like we actually regressed this in 2.91 over 2.90. Previously, in 2.90, the eval cache was destroyed in `toDerivedPaths` from `nix::Installable::build2`. Now it is destroyed with the Command instance, which is definitely broken. 2.90: ``` instantiated 'hello-2.12.1' -> '/nix/store/psh7pyx4vg2kfl2h8r0sqrp374l1hnd6-hello-2.12.1.drv' performing daemon worker op: 1 evaluating uncached attribute 'packages.x86_64-linux.foo' evaluating uncached attribute 'packages.x86_64-linux.foo' evaluating uncached attribute 'packages.x86_64-linux.foo.meta' evaluating uncached attribute 'packages.x86_64-linux.foo.meta' evaluating uncached attribute 'packages.x86_64-linux.foo.meta.outputsToInstall' Thread 1 hit Breakpoint 3, nix::SQLiteTxn::commit (this=0x34df4f50) at src/libstore/sqlite.cc:229 warning: 229 src/libstore/sqlite.cc: No such file or directory (rr) dir lix-src/ Source directories searched: /home/jade/lix/lix-mercury/lix-src:$cdir:$cwd (rr) bt #0 nix::SQLiteTxn::commit (this=0x34df4f50) at src/libstore/sqlite.cc:229 #1 0x00007ec66d73bac4 in nix::eval_cache::AttrDb::~AttrDb (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/unique_ptr.h:199 #2 std::destroy_at<nix::eval_cache::AttrDb> (__location=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:88 #3 std::_Destroy<nix::eval_cache::AttrDb> (__pointer=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:149 #4 std::allocator_traits<std::allocator<void> >::destroy<nix::eval_cache::AttrDb> (__p=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/alloc_traits.h:675 #5 std::_Sp_counted_ptr_inplace<nix::eval_cache::AttrDb, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x34e35d10) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:613 #6 0x00007ec66dd174d7 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x34e35d10) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:346 #7 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x34e35d10) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:317 #8 0x00007ec66dd441d7 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071 #9 std::__shared_ptr<nix::eval_cache::AttrDb, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524 #10 std::shared_ptr<nix::eval_cache::AttrDb>::~shared_ptr (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr.h:175 #11 nix::eval_cache::EvalCache::~EvalCache (this=<optimized out>, this=<optimized out>) at src/libexpr/eval-cache.hh:16 #12 std::destroy_at<nix::eval_cache::EvalCache> (__location=0x34e34ff0) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:88 #13 std::_Destroy<nix::eval_cache::EvalCache> (__pointer=0x34e34ff0) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:149 #14 std::allocator_traits<std::allocator<void> >::destroy<nix::eval_cache::EvalCache> (__p=0x34e34ff0) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/alloc_traits.h:675 #15 std::_Sp_counted_ptr_inplace<nix::eval_cache::EvalCache, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x34e34fe0) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:613 #16 0x00007ec66d7274ba in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use (this=0x34e34fe0) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:175 #17 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use_cold (this=0x34e34fe0) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:199 #18 0x00007ec66d73df41 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071 #19 std::__shared_ptr<nix::eval_cache::EvalCache, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524 #20 std::shared_ptr<nix::eval_cache::EvalCache>::~shared_ptr (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr.h:175 #21 nix::ref<nix::eval_cache::EvalCache>::~ref (this=<optimized out>, this=<optimized out>) at src/libutil/ref.hh:16 #22 nix::eval_cache::AttrCursor::~AttrCursor (this=<optimized out>, this=<optimized out>) at src/libexpr/eval-cache.hh:71 #23 std::destroy_at<nix::eval_cache::AttrCursor> (__location=0x34e50160) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:88 #24 std::_Destroy<nix::eval_cache::AttrCursor> (__pointer=0x34e50160) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:149 #25 std::allocator_traits<std::allocator<void> >::destroy<nix::eval_cache::AttrCursor> (__p=0x34e50160) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/alloc_traits.h:675 #26 std::_Sp_counted_ptr_inplace<nix::eval_cache::AttrCursor, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x34e50150) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:613 #27 0x00007ec66dd1742a in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use (this=0x34e50150) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:175 #28 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use_cold (this=0x34e50150) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:199 #29 0x00007ec66dd42121 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071 #30 std::__shared_ptr<nix::eval_cache::AttrCursor, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524 #31 std::shared_ptr<nix::eval_cache::AttrCursor>::~shared_ptr (this=<optimized out>, this=<optimized out>) --Type <RET> for more, q to quit, c to continue without paging--c at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr.h:175 #32 nix::ref<nix::eval_cache::AttrCursor>::~ref (this=<optimized out>, this=<optimized out>) at src/libutil/ref.hh:16 #33 nix::InstallableFlake::toDerivedPaths (this=<optimized out>) at src/libcmd/installable-flake.cc:165 #34 0x00007ec66dd52864 in nix::Installable::build2 (evalStore=..., store=..., mode=nix::Realise::Outputs, installables=..., bMode=nix::bmNormal) at src/libcmd/installables.cc:596 #35 0x00007ec66dd4bcb1 in nix::Installable::build (evalStore=..., store=..., mode=mode@entry=nix::Realise::Outputs, installables=std::vector of length 1, capacity 1 = {...}, bMode=bMode@entry=nix::bmNormal) at src/libcmd/installables.cc:540 #36 0x0000000000482251 in CmdBuild::run (this=0x34d614d0, store=..., installables=...) at src/nix/build.cc:137 #37 0x00007ec66dd56705 in nix::InstallablesCommand::run (this=0x34d614d0, store=..., rawInstallables=...) at src/libcmd/installables.cc:825 #38 0x00007ec66dd4c956 in nix::RawInstallablesCommand::run (this=0x34d614d0, store=...) at src/libcmd/installables.cc:810 #39 0x00007ec66dd2eb57 in nix::StoreCommand::run (this=0x34d617e0) at src/libcmd/command.cc:55 #40 0x00000000004e5813 in nix::mainWrapped (argc=7, argv=0x7ffdd4d16e88) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1349 #41 0x00007ec66d5e8a97 in std::function<void()>::operator() (this=0x7ffdd4d16d10) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/std_function.h:591 #42 nix::handleExceptions (programName="result/bin/nix", fun=...) at src/libmain/shared.cc:323 #43 0x000000000046ad0c in main (argc=<optimized out>, argv=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/allocator.h:163 (rr) c Continuing. Thread 1 hit Breakpoint 2, nix::SQLiteTxn::~SQLiteTxn (this=<optimized out>, this=<optimized out>) at src/libstore/sqlite.cc:235 235 SQLiteTxn::~SQLiteTxn() ``` 2.91: destroyed with the InstallablesCommand: ``` unreferenced input: '/nix/store/vqjygx23hkim1kpidik5xcs9whayf3sr-bzip2-1.0.8-bin' unreferenced input: '/nix/store/w8pnfazxqwmrqmwkb5zrz1bifsd8abxl-findutils-4.10.0' unreferenced input: '/nix/store/wfxkyxmg47bhj098im5rp60hmkagn96x-mpfr-4.2.1' unreferenced input: '/nix/store/wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh' referenced input: '/nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36' unreferenced input: '/nix/store/x9as7x6f7cdgcskvvn3yp02m662krr7y-binutils-wrapper-2.43.1' unreferenced input: '/nix/store/xxfkk4gqnaimiwzi6mmsmcs9bl2r8y7f-isl-0.20' unreferenced input: '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh' unreferenced input: '/nix/store/y11zr71f9i1zy1vrdy3kjx8j6slsb3l3-gmp-6.3.0' unreferenced input: '/nix/store/ybjcla5bhj8g1y84998pn4a2drfxybkv-gcc-13.3.0-lib' unreferenced input: '/nix/store/zhaypw0znkjnymg0rk1599zn21rr0l50-gnutar-1.35' unreferenced input: '/nix/store/zw5haplzbwjgbp3yykhm6iprkpfppzxb-glibc-2.40-36-bin' lock released on '/nix/store/3xffwsj1rghf1d6rrhindc5m0241whvi-hello-2.12.1.lock' building of '/nix/store/psdv7hc5y2k9mjw26m16p6968sj1j7ip-hello-2.12.1.drv^out' from .drv file: done building of '/nix/store/psdv7hc5y2k9mjw26m16p6968sj1j7ip-hello-2.12.1.drv^out' from .drv file: goal destroyed performing daemon worker op: 11 performing daemon worker op: 12 Thread 1 hit Breakpoint 4, nix::SQLiteTxn::commit (this=0xcece630) at src/libstore/sqlite.cc:239 239 { (rr) bt #0 nix::SQLiteTxn::commit (this=0xcece630) at src/libstore/sqlite.cc:239 #1 0x000075706e8cd46c in nix::eval_cache::AttrDb::~AttrDb (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/unique_ptr.h:199 #2 std::destroy_at<nix::eval_cache::AttrDb> (__location=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:88 #3 std::_Destroy<nix::eval_cache::AttrDb> (__pointer=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:149 #4 std::allocator_traits<std::allocator<void> >::destroy<nix::eval_cache::AttrDb> (__p=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/alloc_traits.h:675 #5 std::_Sp_counted_ptr_inplace<nix::eval_cache::AttrDb, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0xced3bd0) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:613 #6 0x000075706eed9e77 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0xced3bd0) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:346 #7 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0xced3bd0) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:317 #8 0x000075706ef06df7 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071 #9 std::__shared_ptr<nix::eval_cache::AttrDb, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524 #10 std::shared_ptr<nix::eval_cache::AttrDb>::~shared_ptr (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr.h:175 #11 nix::eval_cache::EvalCache::~EvalCache (this=<optimized out>, this=<optimized out>) at src/libexpr/eval-cache.hh:16 #12 std::destroy_at<nix::eval_cache::EvalCache> (__location=0xced2420) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:88 #13 std::_Destroy<nix::eval_cache::EvalCache> (__pointer=0xced2420) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:149 #14 std::allocator_traits<std::allocator<void> >::destroy<nix::eval_cache::EvalCache> (__p=0xced2420) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/alloc_traits.h:675 #15 std::_Sp_counted_ptr_inplace<nix::eval_cache::EvalCache, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0xced2410) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:613 #16 0x000075706e8bbe7a in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use (this=0xced2410) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:175 #17 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use_cold (this=0xced2410) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:199 #18 0x000075706e8d8de5 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071 #19 std::__shared_ptr<nix::eval_cache::EvalCache, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524 #20 std::shared_ptr<nix::eval_cache::EvalCache>::~shared_ptr (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr.h:175 #21 nix::ref<nix::eval_cache::EvalCache>::~ref (this=<optimized out>, this=<optimized out>) at src/libutil/ref.hh:16 --Type <RET> for more, q to quit, c to continue without paging--c #22 std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >::~pair (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_pair.h:187 #23 std::destroy_at<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > (__location=0xcecbc50) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:88 #24 std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > > >::destroy<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCac he> > > (__p=0xcecbc50, __a=...) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/alloc_traits.h:560 #25 std::_Rb_tree<nix::Hash const, std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >, std::_Select1st<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > >, std::less<nix: :Hash const>, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::_M_destroy_node (__p=0xcecbc30, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_tree.h:625 #26 std::_Rb_tree<nix::Hash const, std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >, std::_Select1st<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > >, std::less<nix: :Hash const>, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::_M_drop_node (this=<optimized out>, __p=0xcecbc30) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_tree.h:633 #27 std::_Rb_tree<nix::Hash const, std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >, std::_Select1st<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > >, std::less<nix: :Hash const>, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::_M_erase (this=0x757053a6cb00, __x=0xcecbc30) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_tree.h:1938 #28 std::_Rb_tree<nix::Hash const, std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >, std::_Select1st<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > >, std::less<nix: :Hash const>, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::~_Rb_tree (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_tree.h:986 #29 std::map<nix::Hash const, nix::ref<nix::eval_cache::EvalCache>, std::less<nix::Hash const>, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::~map ( this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_map.h:314 #30 nix::EvalState::~EvalState (this=<optimized out>, this=<optimized out>) at src/libexpr/eval.cc:314 #31 0x000075706eed9dca in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use (this=0x757053a6c800) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:175 #32 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use_cold (this=0x757053a6c800) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:199 #33 0x000075706eef710d in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071 #34 std::__shared_ptr<nix::EvalState, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524 #35 std::shared_ptr<nix::EvalState>::~shared_ptr (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr.h:175 #36 nix::EvalCommand::~EvalCommand (this=<optimized out>, __vtt_parm=<optimized out>, this=<optimized out>, __vtt_parm=<optimized out>) at src/libcmd/command.cc:102 #37 0x000000000047cf2d in nix::MixFlakeOptions::~MixFlakeOptions (__vtt_parm=<optimized out>, this=<optimized out>, this=<optimized out>, __vtt_parm=<optimized out>) at src/libcmd/command.hh:96 #38 0x000000000047d093 in nix::RawInstallablesCommand::~RawInstallablesCommand (__vtt_parm=<optimized out>, this=<optimized out>, this=<optimized out>, __vtt_parm=<optimized out>) at src/libcmd/command.hh:160 #39 nix::InstallablesCommand::~InstallablesCommand (__vtt_parm=<optimized out>, this=<optimized out>, this=<optimized out>, __vtt_parm=<optimized out>) at src/libcmd/command.hh:184 #40 CmdBuild::~CmdBuild (this=<optimized out>, this=<optimized out>) at src/nix/build.cc:67 #41 0x0000000000471e47 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0xce366d0) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:346 #42 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0xce366d0) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:317 #43 0x00000000004e0058 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071 #44 std::__shared_ptr<nix::Command, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524 #45 std::shared_ptr<nix::Command>::~shared_ptr (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr.h:175 #46 nix::ref<nix::Command>::~ref (this=<optimized out>, this=<optimized out>) at src/libutil/ref.hh:16 #47 std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> >::~pair (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/stl_pair.h:187 #48 std::_Optional_payload_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> > >::_M_destroy (this=0x7ffda825d5a0) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/optional:287 #49 std::_Optional_payload_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> > >::_M_reset (this=0x7ffda825d5a0) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/optional:318 #50 std::_Optional_payload<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> >, false, false, false>::~_Optional_payload ( this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/optional:441 #51 std::_Optional_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> >, false, false>::~_Optional_base (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/optional:512 #52 std::optional<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> > >::~optional (this=<optimized out>, this=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/optional:707 #53 nix::MultiCommand::~MultiCommand (__vtt_parm=<optimized out>, this=<optimized out>, this=<optimized out>, __vtt_parm=<optimized out>) at src/libutil/args.hh:344 #54 nix::NixArgs::~NixArgs (this=<optimized out>, this=<optimized out>) at src/nix/main.cc:80 #55 0x00000000004e85b1 in nix::mainWrapped (argc=<optimized out>, argv=<optimized out>) at src/nix/main.cc:422 #56 0x000075706e771df7 in std::function<void()>::operator() (this=0x7ffda825df50) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/std_function.h:591 #57 nix::handleExceptions (programName="result/bin/nix", fun=...) at src/libmain/shared.cc:326 #58 0x000000000046b1b4 in main (argc=<optimized out>, argv=<optimized out>) at /nix/store/xzfmarrq8x8s4ivpya24rrndqsq2ndiz-gcc-13.3.0/include/c++/13.3.0/bits/allocator.h:163 ``` `main`: ``` Thread 1 hit Breakpoint 2, nix::SQLiteTxn::commit (this=0x591821bd38b0) at lix/libstore/sqlite.cc:241 241 if (sqlite3_exec(db, "commit;", 0, 0, 0) != SQLITE_OK) (rr) bt #0 nix::SQLiteTxn::commit (this=0x591821bd38b0) at lix/libstore/sqlite.cc:241 #1 0x0000753fbec86160 in nix::eval_cache::AttrDb::~AttrDb (this=0x591821beb8a0) at lix/libexpr/eval-cache.cc:70 #2 0x0000753fbf5b29ba in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x591821beb890) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:346 #3 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x591821beb928) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071 #4 std::__shared_ptr<nix::eval_cache::AttrDb, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x591821beb920) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524 #5 nix::eval_cache::EvalCache::~EvalCache (this=0x591821beb910) at lix/libexpr/eval-cache.hh:38 #6 0x00005917f21d36da in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use (this=0x591821bd38b0) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:175 #7 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use_cold (this=0x591821bd38b0) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:199 #8 0x0000753fbf59737e in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x591821beb900) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:353 #9 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x591821be9c78) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071 #10 std::__shared_ptr<nix::eval_cache::EvalCache, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x591821be9c70) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524 #11 nix::ref<nix::eval_cache::EvalCache>::~ref (this=0x591821be9c70) at lix/libutil/ref.hh:16 #12 std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >::~pair (this=0x591821be9c20) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_pair.h:187 #13 std::destroy_at<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > (__location=0x591821be9c20) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:88 #14 std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > > >::destroy<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCa che> > > (__p=0x591821be9c20, __a=...) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/alloc_traits.h:560 #15 std::_Rb_tree<nix::Hash, std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >, std::_Select1st<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > >, std::less<nix::Hash >, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::_M_destroy_node (this=0x753fa3ba6f50, __p=0x591821be9c00) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_tree.h:625 #16 std::_Rb_tree<nix::Hash, std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >, std::_Select1st<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > >, std::less<nix::Hash >, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::_M_drop_node (this=0x753fa3ba6f50, __p=0x591821be9c00) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_tree.h:633 #17 std::_Rb_tree<nix::Hash, std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >, std::_Select1st<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > >, std::less<nix::Hash >, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::_M_erase (this=0x753fa3ba6f50, __x=0x591821be9c00) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_tree.h:1938 #18 0x0000753fbf596ba7 in std::_Rb_tree<nix::Hash, std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> >, std::_Select1st<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > >, std::less<nix::Hash>, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::~_Rb_tree (this=0x591821bd38b0) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_tree.h:986 #19 std::map<nix::Hash, nix::ref<nix::eval_cache::EvalCache>, std::less<nix::Hash>, std::allocator<std::pair<nix::Hash const, nix::ref<nix::eval_cache::EvalCache> > > >::~map (this=0x591821bd38b0) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_map.h:314 #20 nix::eval_cache::CachingEvaluator::~CachingEvaluator (this=0x753fa3ba6a90) at lix/libexpr/eval-cache.hh:25 --Type <RET> for more, q to quit, c to continue without paging--c #21 std::destroy_at<nix::eval_cache::CachingEvaluator> (__location=0x753fa3ba6a90) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:88 #22 std::_Destroy<nix::eval_cache::CachingEvaluator> (__pointer=0x753fa3ba6a90) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_construct.h:149 #23 std::allocator_traits<traceable_allocator<nix::EvalState> >::_S_destroy<traceable_allocator<nix::EvalState>, nix::eval_cache::CachingEvaluator> (__p=0x753fa3ba6a90) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/alloc_traits.h:293 #24 std::allocator_traits<traceable_allocator<nix::EvalState> >::destroy<nix::eval_cache::CachingEvaluator> (__a=..., __p=0x753fa3ba6a90) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/alloc_traits.h:393 #25 std::_Sp_counted_ptr_inplace<nix::eval_cache::CachingEvaluator, traceable_allocator<nix::EvalState>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x753fa3ba6a80) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:613 #26 0x0000753fbf58e5fe in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x753fa3ba6a80) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:346 #27 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x591821b9cac8) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071 #28 std::__shared_ptr<nix::eval_cache::CachingEvaluator, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x591821b9cac0) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524 #29 nix::EvalCommand::~EvalCommand (this=0x591821b9ca30, vtt=0x5917f23cad68 <VTT for CmdBuild+40>) at lix/libcmd/command.cc:96 #30 0x00005917f21e0f68 in nix::InstallablesCommand::~InstallablesCommand (this=0x591821b9ca30, vtt=<optimized out>) at lix/libcmd/command.hh:182 #31 CmdBuild::~CmdBuild (this=0x591821b9ca30, vtt=<optimized out>) at lix/nix/build.cc:67 #32 CmdBuild::~CmdBuild (this=0x591821b9ca30) at lix/nix/build.cc:67 #33 0x00005917f220f469 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x591821b9ca20) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:346 #34 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x7ffe48406268) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1071 #35 std::__shared_ptr<nix::Command, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x7ffe48406260) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/shared_ptr_base.h:1524 #36 nix::ref<nix::Command>::~ref (this=0x7ffe48406260) at lix/libutil/ref.hh:16 #37 std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> >::~pair (this=0x7ffe48406240) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/stl_iterator.h:2992 #38 std::_Optional_payload_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> > >::_M_destroy (this=0x7ffe48406240) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/optional:287 #39 std::_Optional_payload_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> > >::_M_reset (this=0x7ffe48406240) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/optional:318 #40 std::_Optional_payload<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> >, false, false, false>::~_Optional_payload ( this=0x7ffe48406240) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/optional:441 #41 std::_Optional_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, nix::ref<nix::Command> >, false, false>::~_Optional_base (this=0x7ffe48406240) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/optional:512 #42 nix::MultiCommand::~MultiCommand (this=this@entry=0x7ffe484061d8, vtt=0x0, vtt@entry=0x5917f23e3c90 <VTT for nix::NixArgs+40>) at lix/libutil/args.hh:346 #43 0x00005917f2282278 in nix::NixArgs::~NixArgs (this=this@entry=0x7ffe48406190) at lix/nix/main.cc:107 #44 0x00005917f2279417 in nix::mainWrapped (argc=<optimized out>, argv=<optimized out>) at lix/nix/main.cc:530 #45 0x0000753fbea987d1 in std::function<void()>::operator() (this=0x7ffe484067a0) at /nix/store/4krab2h0hd4wvxxmscxrw21pl77j4i7j-gcc-13.3.0/include/c++/13.3.0/bits/std_function.h:591 #46 nix::handleExceptions (programName="nix", fun=...) at lix/libmain/shared.cc:311 #47 0x00005917f227c84b in main (argc=7, argv=0x7ffe48406928) at lix/nix/main.cc:545 ``` ## Proximate cause We observe that the eval caches are being held alive by the installables themselves as of 2.91. In 2.92, this is in CachingEvaluator. The problem is that CachingEvaluator is *intentionally* holding these references alive longer than they otherwise would live. That being said, neither CachingEvaluator nor the evaluator itself should be living as long as to start a build, so we still have a way to fix this. The reason that this happened is this optimization: ``` commit fb7d3154115cb5cf211c5ddbc124e17ee519bb64 Author: Eelco Dolstra <edolstra@gmail.com> AuthorDate: Fri Apr 26 15:48:46 2024 +0200 Commit: Qyriad <qyriad@qyriad.me> CommitDate: Wed Jun 19 18:39:11 2024 +0000 Merge pull request #10570 from layus/shared_caches Share evaluation caches across installables ``` Which is indeed contained in 2.91 but not in 2.90. Cool! ## Fixing it We need to kill the evaluator object once the evaluation phase is done. That's my next step.
Owner

Implementation plan: obliterate getEvaluator() from the entire CLI, so that it has an explicit lifetime. Unfortunately this is a couple of days of work by itself, and it might be better to just remove the optimization. But also, even if we do remove this, I am not sure to what extent the evaluator is getting torn down in a meaningful way when it really should be.

cc #313, which is the bug that the optimization causing this problem fixes.

edit: hm, maybe I can actually move the state out of CachingEvaluator and pass it explicitly, since it seems quite sparsely used.

Implementation plan: obliterate `getEvaluator()` from the entire CLI, so that it has an explicit lifetime. Unfortunately this is a couple of days of work by itself, and it might be better to just remove the optimization. But also, even if we do remove this, I am not sure to what extent the evaluator is getting torn down in a meaningful way when it *really* should be. cc #313, which is the bug that the optimization causing this problem fixes. edit: hm, maybe I can actually move the state out of CachingEvaluator and pass it explicitly, since it seems quite sparsely used.
Owner

Another possible way to fix this is to make the EvalCache discard its State when not actively in use. This might result in excess sqlite connect/disconnect cycles, but it would solve this bug without having to massively refactor the entire CLI.

Another possible way to fix this is to make the EvalCache discard its State when not actively in use. This might result in excess sqlite connect/disconnect cycles, but it would solve this bug without having to massively refactor the entire CLI.
Owner

All of this said, I no longer believe this should be a release blocker after discussion with @raito:

  • We already shipped this bug in 2.91 and it wasn't noticed to date
  • It would take at least a couple of days of focused work to fix
  • It will not affect large unattended CI installations where it would be truly obnoxious, since any reasonable CI installation is using nix-eval-jobs or similar and building separately from evaluation
  • It is not a deadlock: though it results in the evaluator taking a long vacation in certain (somewhat unknown, I couldn't repro it) conditions, it will resolve itself when the build terminates.

For these reasons, I don't think it's worth further delaying the release on this bug. It should still be fixed, but doing so is quite hard since flakes/new-cli are a hot mess of overbroad-scoped state.

All of this said, I no longer believe this should be a release blocker after discussion with @raito: - We already shipped this bug in 2.91 and it wasn't noticed to date - It would take at least a couple of days of focused work to fix - It will not affect large unattended CI installations where it would be truly obnoxious, since any reasonable CI installation is using nix-eval-jobs or similar and building separately from evaluation - It is not a deadlock: though it results in the evaluator taking a long vacation in certain (somewhat unknown, I couldn't repro it) conditions, it *will* resolve itself when the build terminates. For these reasons, I don't think it's worth further delaying the release on this bug. It should still be fixed, but doing so is quite hard since flakes/new-cli are a hot mess of overbroad-scoped state.
Author
Member

The annoying thing is: the second process does not respond properly to Ctrl-C

The annoying thing is: the second process does not respond properly to Ctrl-C
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#608
No description provided.