{"record":{"id":"3ce70fe0fb1ea0f2","repo":"zed-industries/zed","slug":"parse-error-in-x11-response","errorCode":null,"errorMessage":"Parse error in X11 response","messagePattern":"Parse error in X11 response","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_linux/src/linux/x11/window.rs","lineNumber":442,"sourceCode":"        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,\n        xcb: &Rc<XCBConnection>,\n        client_side_decorations_supported: bool,\n        x_main_screen_index: usize,","sourceCodeStart":424,"sourceCodeEnd":460,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/gpui_linux/src/linux/x11/window.rs#L424-L460","documentation":"Mapping arm in handle_connection_error: bytes read from the X server failed to parse as a valid reply/error/event (ConnectionError::ParseError), usually from protocol desync — a malformed request sequence, concurrent unsynchronized use of the connection, or a server bug.","triggerScenarios":"Thrown at crates/gpui_linux/src/linux/x11/window.rs:437 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Audit for concurrent writes to the same XCB connection that interleave request/reply sequences","Verify all custom protocol structs match the X11 wire format (padding, endianness)","Treat the connection as poisoned after a parse error: drop and reconnect rather than reuse it"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}