{"record":{"id":"6986ee40a4ccfe46","repo":"zed-industries/zed","slug":"x11-connection-file-descriptor-passing-failed","errorCode":null,"errorMessage":"X11 connection: File descriptor passing failed","messagePattern":"X11 connection: File descriptor passing failed","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/gpui_linux/src/linux/x11/window.rs","lineNumber":439,"sourceCode":"    hints.urgent = urgent;\n    check_reply(\n        || \"X11 ChangeProperty for WM_HINTS urgency failed.\",\n        hints.set(xcb, x_window),\n    )\n    .log_err();\n    xcb_flush(xcb);\n}\n\n/// Convert X11 connection errors to `anyhow::Error` and panic for unrecoverable errors.\npub(crate) fn handle_connection_error(err: ConnectionError) -> anyhow::Error {\n    match err {\n        ConnectionError::UnknownError => anyhow!(\"X11 connection: Unknown error\"),\n        ConnectionError::UnsupportedExtension => anyhow!(\"X11 connection: Unsupported extension\"),\n        ConnectionError::MaximumRequestLengthExceeded => {\n            anyhow!(\"X11 connection: Maximum request length exceeded\")\n        }\n        ConnectionError::FdPassingFailed => {\n            panic!(\"X11 connection: File descriptor passing failed\")\n        }\n        ConnectionError::ParseError(parse_error) => {\n            anyhow!(parse_error).context(\"Parse error in X11 response\")\n        }\n        ConnectionError::InsufficientMemory => panic!(\"X11 connection: Insufficient memory\"),\n        ConnectionError::IoError(err) => anyhow!(err).context(\"X11 connection: IOError\"),\n        _ => anyhow!(err),\n    }\n}\n\nimpl X11WindowState {\n    pub fn new(\n        handle: AnyWindowHandle,\n        client: X11ClientStatePtr,\n        executor: ForegroundExecutor,\n        gpu_context: gpui_wgpu::GpuContext,\n        compositor_gpu: Option<CompositorGpuHint>,\n        params: WindowParams,","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/gpui_linux/src/linux/x11/window.rs#L421-L457","documentation":"handle_connection_error maps XCB ConnectionErrors; most become anyhow errors, but FdPassingFailed is treated as unrecoverable and panics. Passing file descriptors over the X connection (SCM_RIGHTS on a Unix socket) is required for functionality Zed depends on (e.g. shared-memory buffers), so a connection that cannot pass fds is unusable.","triggerScenarios":"The X connection does not support file descriptor passing — typically X servers reached over TCP (DISPLAY=hostname:0) or through proxies/sandboxing that strip SCM_RIGHTS ancillary data (xrdp, some VNC setups, container/seccomp restrictions).","commonSituations":"Remote X over the network instead of a local socket; xrdp sessions; DISPLAY pointing at a remote host; hardened sandboxes blocking ancillary messages on the socket.","solutions":["Use a local Unix-socket X connection: set DISPLAY=:0 (or unix:0) instead of hostname:0","For remote usage, prefer a local session or a protocol that doesn't depend on X fd passing (Wayland remote, VNC-native)","Check that container/seccomp/sandbox policy permits SCM_RIGHTS on the X socket"],"exampleFix":"# before\nexport DISPLAY=192.168.1.10:0   # TCP -> fd passing unavailable -> panic\n\n# after\nexport DISPLAY=:0                # local unix socket","handlingStrategy":"fallback","validationCode":"# shell: ensure DISPLAY targets a local unix socket, not TCP\ncase \"${DISPLAY:-}\" in\n  :[0-9]*|unix:[0-9]*) ;;        # local: ok\n  *) echo \"DISPLAY=${DISPLAY:-} is remote/TCP; fd passing unavailable\" ;;\nesac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer DISPLAY=:0 / unix:0 over hostname:0 for local X servers","Avoid xrdp/TCP-proxied X for GPU-accelerated apps that need SHM fd passing","When remote access is required, prefer Wayland remote/VNC-native solutions"],"tags":["zed","gpui","linux","x11","xcb","fd-passing","panic"],"backgroundTag":"x11-fd-passing-failed","analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}