-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gc: skip the processes own pid FIXES manually deleting paths #6288
Conversation
fixes manually deleting paths nix store delete /nix/store/...-zlib-1.2.11-static error: Cannot delete path '/nix/store/...-zlib-1.2.11-static' since it is still alive. To find out why, use: nix-store --query --roots it failed due to the function finding itself using that path
My main worry is that the patch effectively skips everything that current process refers. My worry is that it could skip too much and garbage collect live Initially I though I understand path leak, but I don't. Do you have a simple reproducer perhaps? I'd like to explore it locally is it reproduces for me. Here is my failed attempt:
Deletion Just Works. Here are my thoughts why it might not work for you: There are 2 relevant processes
I think
I think |
i can't reproduce it right now. seems like it only happens sometimes |
Yes, this would especially be a problem if auto-GC is enabled, since then a process that builds something can also do a GC. |
I suspect it's an UI thing rather than unexpected GC root. Here is an example:
You would think it's an unreferenced tarball, but it's referenced from
Ideally |
Is there a workaround for this bug in the meantime while we wait for this PR to merge? I have a store path with no references that "Just use the sandbox" is not such an easy argument anymore with all of the userns-caused LPE exploits we've had in the past month or two. Counterintuitively, allowing sandboxing makes a system less secure. |
there's a |
Yeah Regarding
|
Ok, I guess the workaround is to:
|
I think #6354 might be related. |
@a-m-joseph Try |
fixes manually deleting paths
nix store delete /nix/store/...-zlib-1.2.11-static
error: Cannot delete path '/nix/store/...-zlib-1.2.11-static' since it is still alive. To find out why, use: nix-store --query --roots
it failed due to the function finding itself using that path
Closes #6141 #6135
tested with