Skip to content
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

System V IPC objects not cleaned up with Darwin Sandbox #12548

Open
2 tasks done
wolfgangwalther opened this issue Feb 21, 2025 · 0 comments
Open
2 tasks done

System V IPC objects not cleaned up with Darwin Sandbox #12548

wolfgangwalther opened this issue Feb 21, 2025 · 0 comments
Labels

Comments

@wolfgangwalther
Copy link

Describe the bug

The darwin sandbox does not clean up System V IPC objects.

Steps To Reproduce

On a darwin system:

  1. 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";
}'`
  1. Cancel the sleeping build.
  2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant