Describe the bug
The darwin sandbox does not clean up System V IPC objects.
Steps To Reproduce
On a darwin system:
- Run:
nix-build --no-link -E 'with import <nixpkgs> {};
stdenv.mkDerivation {
name = "ipc";
dontUnpack = true;
doCheck = true;
nativeCheckInputs = [ postgresqlTestHook postgresql ];
checkPhase = "runHook preCheck; sleep 1000";
}'`
- Cancel the sleeping build.
- Run
ipcs -ma and see the left-over shared memory segment belonging to a build user.
(you can clean up with ipcrm -m <ID>)
Expected behavior
ipcs -ma should not return any left-over shared memory segments.
Metadata
nix-env (Nix) 2.24.12
Additional context
More details about my analysis:
The Linux sandbox mentions IPC cleanup explicitly:
|
- The IPC namespace prevents the builder from communicating |
|
with outside processes using SysV IPC mechanisms (shared |
|
memory, message queues, semaphores). It also ensures |
|
that all IPC objects are destroyed when the builder |
|
exits. |
Various tickets which are all caused by this:
Checklist
Add 👍 to issues you find important.
Describe the bug
The darwin sandbox does not clean up System V IPC objects.
Steps To Reproduce
On a darwin system:
ipcs -maand see the left-over shared memory segment belonging to a build user.(you can clean up with
ipcrm -m <ID>)Expected behavior
ipcs -mashould not return any left-over shared memory segments.Metadata
nix-env (Nix) 2.24.12
Additional context
More details about my analysis:
The Linux sandbox mentions IPC cleanup explicitly:
nix/src/libstore/unix/build/local-derivation-goal.cc
Lines 959 to 963 in d904921
Various tickets which are all caused by this:
Checklist
Add 👍 to issues you find important.