Skip to content

[Bug] Native UI verifier can lose fixture ownership before the ready handshake #8559

Open

Description

@morluto

Area

Native UI verifier cleanup

Observed behavior

At revision 245a581818ab13694fa438a06e39898ce03ab206, verify-native-ui.mjs records a fixture PID only after the window-ready output is parsed. If the handshake times out, cleanup signals and waits for the open launcher, then removes the fixture root without an identity for a separately launched fixture process. Launch and handshake; cleanup.

Reproduction and evidence

On macOS arm64, Node 24.22.1, a subprocess ran the actual verifier with injected compiler and open launcher, and an accelerated clock. The simulated launcher started a detached, source-owned Node fixture that never sent a ready record. After the verifier timed out and terminated its launcher, the fixture was still present as a sleeping process reparented to PID 1; it was then explicitly terminated by the test operator. An independent source review confirmed that this follows the verifier's missing-handshake cleanup path.

This simulates a separate fixture process. Actual macOS LaunchServices behavior, real GUI survival, and incidence are NOT_ENOUGH_INFO; no native compiler, GUI, or provider was run.

Expected behavior

Establish and retain ownership of the launched fixture through late or missing handshake and cleanup; do not delete the fixture root while an owned app may remain. Any fix should use process-ownership primitives and cover late handshake, startup failure, cleanup refusal and retry, without signaling a process from PID or path alone.

Activity

  1. kaoru0822-kitauji commented on Nov 2, 2026

    @kaoru0822-kitauji
    Collaborator

    Reproduced on 8250bf232 with real LaunchServices, on macOS 26.7.1 arm64 and Node 24.22.1. I ran the actual verifier with only the compiler injected, real /usr/bin/open, and a never-ready AppKit binary.

    It exited 1 after the 20-second budget with the fixture root deleted, and the app was still running from the deleted bundle (columns: PID, PPID, PGID):

    36941     1 36941 .../rea-ui-fixture-04TTpR/Fixture.app/Contents/MacOS/fixture
    

    Observed facts that the issue left as NOT_ENOUGH_INFO:

    • The launched app has PPID 1 and its own process group, and it survives SIGTERM to open.
    • open's environment reaches the app, so a run token set before launch is readable from the app. open's own token is withheld (platform_binary_environment_withheld).
    • Stopping open does not cancel a launch in flight. When open was killed 10 or 20 ms after spawn, the app appeared after an immediate process-table check in 6 of 6 rounds.

    The fix is in #8646.

  2. BeqaKs commented on Nov 3, 2026

    @BeqaKs
    Contributor

    Closing as addressed by merged verifier ownership work (#8573 / #8654). Stayed open after Refs rather than Fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions