zed-industries/zed · error

Failed to initialize event loop handling of wake events: {er

Error message

Failed to initialize event loop handling of wake events: {err:?}

What it means

Raised in X11Client::new: calloop failed to register the wake channel that the async executor uses to wake the X11 event loop when new work is signalled. Without this source the loop can sleep indefinitely and never dispatch foreground tasks; the {err:?} is calloop's InsertError.

Source

Thrown at crates/gpui_linux/src/linux/x11/client.rs:348

                            let xcb_connection = client.0.borrow().xcb_connection.clone();
                            client.process_x11_events(&xcb_connection).log_err();
                        });
                    }
                }
            })
            .map_err(|err| {
                anyhow!("Failed to initialize event loop handling of foreground tasks: {err:?}")
            })?;

        handle
            .insert_source(wake_receiver, |event, _, client: &mut X11Client| {
                if let calloop::channel::Event::Msg(()) = event {
                    client.0.borrow_mut().common.handle_system_wake();
                }
            })
            .map_err(|err| {
                anyhow!("Failed to initialize event loop handling of wake events: {err:?}")
            })?;

        let (xcb_connection, x_root_index) = XCBConnection::connect(None)?;
        xcb_connection.prefetch_extension_information(xkb::X11_EXTENSION_NAME)?;
        xcb_connection.prefetch_extension_information(randr::X11_EXTENSION_NAME)?;
        xcb_connection.prefetch_extension_information(render::X11_EXTENSION_NAME)?;
        xcb_connection.prefetch_extension_information(xinput::X11_EXTENSION_NAME)?;

        // Announce to X server that XInput up to 2.4 is supported.
        // Version 2.4 is needed for gesture events (GesturePinchBegin/Update/End).
        // The server responds with the highest version it supports; if < 2.4,
        // we must not request gesture event masks in XISelectEvents.
        let xinput_version = get_reply(
            || "XInput XiQueryVersion failed",
            xcb_connection.xinput_xi_query_version(2, 4),
        )?;
        assert!(
            xinput_version.major_version >= 2,

View on GitHub (pinned to f4178619ac)

Solutions

  1. Check the calloop InsertError detail (registration/token allocation failure)
  2. Verify the wake_receiver channel is not already consumed or registered elsewhere
  3. Treat as fatal at startup and surface the error before entering the event loop
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/gpui_linux/src/linux/x11/client.rs:348 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/c60e000952eac299. Report an issue: GitHub.