| 1 Apr 2026 |
dramforever | so if i have multiple nix processes on the same --store that each may build stuff and/or run gc, are these supposed to be synchronized? | 15:17:05 |
dramforever | i've been playing around with gc races and i'm getting all sorts of exciting errors by doing this, even with https://github.com/NixOS/nix/pull/15469 applied | 15:17:36 |
dramforever | the recipe:
- run two of
while nix -vvv --min-free 512T --no-auto-optimise-store --store teststore/ build --no-link nixpkgs#pkgsCross.riscv64.hello ; do : ; done
- run one of
while nix -vvv --min-free 512T --no-auto-optimise-store --store teststore/ store gc; do : ; done put them each in a tmux pane and watch the chaos unfold
| 15:21:30 |
dramforever | * the recipe:
- run two of
while nix -vvv --min-free 512T --no-auto-optimise-store --store teststore/ build --no-link nixpkgs#pkgsCross.riscv64.hello ; do : ; done
- run one of
while nix -vvv --min-free 512T --no-auto-optimise-store --store teststore/ store gc; do : ; done
put them each in a tmux pane and watch the chaos unfold
| 15:21:37 |
Sergei Zimmerman (xokdvium) | In reply to @dramforever:matrix.org so if i have multiple nix processes on the same --store that each may build stuff and/or run gc, are these supposed to be synchronized? Yeah that’s the idea. What’s exactly breaking? | 15:30:53 |
Sergei Zimmerman (xokdvium) | Pathlocks being messed up? | 15:31:48 |
dramforever | so firstly if the autogc thread is still running when the main thread exits the logger crashes. i've hacked this https://fars.ee/b2go to make it less likely to crash | 15:35:31 |
dramforever | and secondly... uh, readdir is not thread safe | 15:35:41 |
Sergei Zimmerman (xokdvium) | Hm where are we doing readdir on the same fd? | 15:36:08 |
Sergei Zimmerman (xokdvium) | * Hm where are we doing readdir on the same fd from different threads? | 15:36:18 |
dramforever | oh, it's not thread safe in posix (yet) | 15:36:36 |
dramforever | but should be fine on glibc, so scratch that | 15:36:43 |
Sergei Zimmerman (xokdvium) | Hm I did see a crash in runtime roots scanning | 15:39:11 |
dramforever | secondly i'm getting a sigsegv on this boost::regex_match https://github.com/NixOS/nix/blob/b8b3e37b38d2bcc4a4633bf2c7d67e60603308a6/src/libstore/local-gc.cc#L74 | 15:39:41 |
dramforever | i don't know why | 15:39:43 |
Sergei Zimmerman (xokdvium) | Yeah that’s what I got too. It’s strange. Since it’s const surely there’s no way it’s not thread-safe right? | 15:40:26 |
Sergei Zimmerman (xokdvium) | Right???? | 15:40:33 |
dramforever | oh, i can't tell if the first hunk here is necessary | 15:40:53 |
dramforever | anyway i made that if (procDir && false) | 15:42:06 |
dramforever | it shouldn't matter, right? builder should do their own temproots | 15:42:14 |
dramforever | and now the real fun begins | 15:42:18 |
dramforever | these things probably have the same cause, i think - the build can have paths gc'd from under them
> checking for riscv64-unknown-linux-gnu-gcc... riscv64-unknown-linux-gnu-gcc
> checking whether the C compiler works... no
> configure: error: in '/build/hello-2.12.3':
> configure: error: C compiler cannot create executables
> See 'config.log' for more details
terminating due to unexpected unrecoverable internal error: Assertion 'false' failed in nix::DerivationTrampolineGoal::init()::<lambda()> at ../src/libstore/build/derivation-trampoline-goal.cc:125
| 15:44:25 |
Sergei Zimmerman (xokdvium) | Hm, that is on master right? | 15:44:52 |
dramforever | b8b3e37b38d2bcc4a4633bf2c7d67e60603308a6 with #15469 merged in | 15:45:40 |
dramforever | but i think i managed to get similar things on 2.34.4 | 15:45:52 |
dramforever | this one is probably the fetcher thing?
… while calling the 'import' builtin
at /home/dram/code/config/flake.nix:53:24:
52| flake-utils.lib.eachDefaultSystem (system: {
53| legacyPackages = import nixpkgs {
| ^
54| inherit system;
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: path '/nix/store/yxn9vm8hjp9j9vkn1979bh9rzg2gga94-source' is not valid
| 15:47:19 |
Sergei Zimmerman (xokdvium) | Hm fetcher cache is busted in that regard yes | 15:47:45 |
dramforever | yxn9v... is indeed supposed to be nixpkgs | 15:48:13 |
dramforever | actually wait that's my flake | 15:48:27 |
dramforever | * actually wait that's importing my flake | 15:48:41 |