Skip to content

[PHP] test: verify AF_UNIX listener queues across fork and exec#745

Merged
brandonpayton merged 1 commit into
integration/kd-6nz-php-phpt-platform-fixesfrom
gascity/kd-6nz/split-pr717-unix-listener-exec
Jul 11, 2026
Merged

[PHP] test: verify AF_UNIX listener queues across fork and exec#745
brandonpayton merged 1 commit into
integration/kd-6nz-php-phpt-platform-fixesfrom
gascity/kd-6nz/split-pr717-unix-listener-exec

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Jun 20, 2026

Copy link
Copy Markdown
Member

Purpose

Add durable cross-host regression coverage for the POSIX listener behavior now
owned by Batch 2: an AF_UNIX listener inherited across fork() keeps one
accept queue, and exec() closes its FD_CLOEXEC alias without losing a
surviving alias or an already-queued connection.

The original #745 production patch is not replayed. Its socket-wire and accept
queue intent was superseded by the reviewed in-place implementation already in
the aggregate (e3c7ba3a9 and 9def16b2a).

Reviewed result

  • Adds one fork-instrumented guest fixture that:
    • creates a SOCK_CLOEXEC listener and a non-CLOEXEC dup();
    • forks and queues a connection before the child calls execve();
    • closes every parent listener alias, making the child the sole owner;
    • proves the CLOEXEC alias is EBADF after exec while the surviving alias
      remains a listening socket;
    • accepts pre-exec and post-exec connections from the same FIFO queue,
      exactly once, and exchanges data over both.
  • Runs the same guest through the centralized Node host and real Chromium host.
  • Makes the Chromium check fail on console errors, page errors, failed
    requests, or HTTP error responses as well as incorrect guest results.
  • Corrects stale SocketInfo comments to describe the existing shared listener
    queue and clone-reset behavior.
  • Drops every original change to exec serialization, socket syscalls, Wasm
    exports, and host poll logging.

This changes no runtime behavior, ABI surface, package artifact, or VFS image.

Review view

Accept into Batch 2 as regression coverage via rebase merge. The production
behavior is already supplied by the aggregate; this PR makes it durable across
the real guest, Node, and browser paths. It does not independently make #871
ready for main, and the aggregate ABI-17 and full ready-to-merge gates remain.

Validation

On the exact reviewed commit:

  • cargo test -p kandelo --target aarch64-apple-darwin --lib — 1076/1076
    passed.
  • cd host && npx vitest run test/unix-listener-exec.test.ts — 1/1 passed.
  • CI=true KANDELO_PLAYWRIGHT_PORT=5545 npx playwright test test/unix-listener-exec.spec.ts --project=chromium --workers=1 — real
    Chromium, 1/1 passed. Vite reported missing optional Node-demo artifacts
    during its dependency scan; the isolated test-runner route and guest ran
    successfully with no captured browser/runtime diagnostics.
  • bash scripts/check-abi-version.sh — passed; it reported only the
    aggregate's already-known backward-compatible additive exports.
  • Prettier on the three touched TypeScript files — passed.
  • git diff --check — clean.

Earlier on the same repaired behavior tree, scripts/build-musl.sh and
bash build.sh also completed. The full host, libc, POSIX, Sortix, PHPT,
canonical browser, and manual ./run.sh browser gates were not run for this
test-only constituent; they remain aggregate-only under the locked Batch 2
policy.

Exercise the existing shared-listener and in-place exec behavior with one fork-instrumented guest on Node and Chromium. Cover a connection queued before exec, a second connection after exec, the CLOEXEC/non-CLOEXEC alias split, FIFO acceptance, and exact queue consumption.

This replaces PR 745’s obsolete socket serialization approach with regression coverage only; it does not change runtime behavior or the ABI.
@brandonpayton brandonpayton force-pushed the gascity/kd-6nz/split-pr717-unix-listener-exec branch from 32bd40b to b49be60 Compare July 11, 2026 15:37
@brandonpayton brandonpayton changed the title [PHP] fix: preserve unix listener state across exec [PHP] test: verify AF_UNIX listener queues across fork and exec Jul 11, 2026
@brandonpayton brandonpayton changed the base branch from integration/kd-6nz-php-phpt-harness-only-base to integration/kd-6nz-php-phpt-platform-fixes July 11, 2026 15:38
@brandonpayton brandonpayton merged commit 437b689 into integration/kd-6nz-php-phpt-platform-fixes Jul 11, 2026
@brandonpayton brandonpayton deleted the gascity/kd-6nz/split-pr717-unix-listener-exec branch July 11, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant