Skip to content

Commit 84a25dc

Browse files
edolstramergify[bot]
authored andcommitted
nix daemon: Don't open the store
This makes it behave the same as nix-daemon. Opening the store in the parent can cause a SIGBUS in libsqlite in the child: #0 0x00007f141cf6f789 in __memset_avx2_unaligned_erms () from /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/libc.so.6 #1 0x00007f141c322fe8 in walIndexAppend () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0 #2 0x00007f141c3711a2 in pagerWalFrames () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0 #3 0x00007f141c38317e in sqlite3PagerCommitPhaseOne.part.0 () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0 #4 0x00007f141c383555 in sqlite3BtreeCommitPhaseOne.part.0 () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0 #5 0x00007f141c384797 in sqlite3VdbeHalt () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0 #6 0x00007f141c3b8f60 in sqlite3VdbeExec () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0 #7 0x00007f141c3bbfef in sqlite3_step () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0 #8 0x00007f141c3bd0e5 in sqlite3_exec () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0 #9 0x00007f141da140e0 in nix::SQLiteTxn::commit() () from /nix/store/1m4r8s7s1v54zq9isncvjgia02bffxlz-determinate-nix-store-3.1.0/lib/libnixstore.so #10 0x00007f141d9ce69c in nix::LocalStore::registerValidPaths(std::map<nix::StorePath, nix::ValidPathInfo, std::less<nix::StorePath>, std::allocator<std::pair<nix::StorePath const, nix::ValidPathInfo> > > const&)::{lambda()#1}::operator()() const () from /nix/store/1m4r8s7s1v54zq9isncvjgia02bffxlz-determinate-nix-store-3.1.0/lib/libnixstore.so (cherry picked from commit 9590167)
1 parent d891f23 commit 84a25dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/nix/unix/daemon.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ static int main_nix_daemon(int argc, char * * argv)
546546

547547
static RegisterLegacyCommand r_nix_daemon("nix-daemon", main_nix_daemon);
548548

549-
struct CmdDaemon : StoreCommand
549+
struct CmdDaemon : Command
550550
{
551551
bool stdio = false;
552552
std::optional<TrustedFlag> isTrustedOpt = std::nullopt;
@@ -615,7 +615,7 @@ struct CmdDaemon : StoreCommand
615615
;
616616
}
617617

618-
void run(ref<Store> store) override
618+
void run() override
619619
{
620620
runDaemon(stdio, isTrustedOpt, processOps);
621621
}

0 commit comments

Comments
 (0)