Repository navigation
Description
Pickforge test and QA work broke the host X display twice. The host runs Hyprland. Its Xwayland serves :0 through the path socket /tmp/.X11-unix/X0 and has no abstract socket. After the breaks, new X11 clients on the host failed with "Unable to open X11 display" (Steam, a GTK app). Running clients kept working, so nobody noticed at first.
The first break happened on 2026-09-26 at 22:20 local, during the GNOME verification rerun for PR #214. The rerun started gnome-shell --devkit in Docker with -v /tmp/.X11-unix:/tmp/.X11-unix. The container has its own /tmp, so mutter could not see the host /tmp/.X0-lock. Its log says "Using public X11 display :0, (using unix:/tmp/.X11-unix/X1 for managed services)". Mutter replaced the host X0 socket file, and the file was gone after the container exited.
The second break happened on 2026-10-03 between 13:12 and 15:07 local, during the #207 work. A QA probe and early versions of packages/desktop-linux/test/viewer-cursor.test.ts started Xvfb -displayfd 3 with no display number. In that mode Xvfb probes from display 0. Because the host has no abstract :0 socket, Xvfb unlinks /tmp/.X11-unix/X0 and binds its own socket. The test then kills Xvfb with SIGKILL, which leaves a dead X0 socket. The test evidence from that run records "display":":0". The version now on PR #225 passes an explicit display and does not touch :0.
I reproduced the mechanism in a private mount and network namespace. A path-only listener stood in for Xwayland, with a live /tmp/.X0-lock. Xvfb -displayfd 3 chose display 0 and replaced the listener's socket file. Xvfb :1234 -displayfd 3 left it alone. Arch xvfb-run -d uses the same unsafe bare form; xvfb-run -a does not.
Pickforge product code is not affected. startXvfb always passes an explicit display from 90 upward and respects live locks. Running the main test suites while watching /tmp/.X11-unix showed no X0 events.
Acceptance criteria: a security test fails on any bare -displayfd or xvfb-run -d in repo tests and scripts, and passes on the explicit form. A local test run fails if the host display socket named by DISPLAY is replaced or removed, and does nothing when DISPLAY is unset, as in CI. AGENTS.md states the rule.
- Add a check under
test/securitythat fails on-displayfdwithout an explicit display, and onxvfb-run -d, in tests and scripts. - Hand the
viewer-cursor.test.tscleanup to PR feat(watch): passive picture-in-picture viewer with bundled noVNC #225, which owns that file: useallocateDisplayand stop Xvfb with SIGTERM (feat(watch): passive picture-in-picture viewer with bundled noVNC #225 (comment)). - Add an AGENTS.md rule: never mount the host
/tmp/.X11-unixinto a container that runs its own X server or compositor, and never start an X server without an explicit free display. - Add a test-suite guard that records the inode of the host display socket before the run and fails if it changes.
Host recovery without a logout: Hyprland's Xwayland still listens on /tmp/.X11-unix/X0_. Pointing X0 at it with a symlink restores new X11 clients.
Activity