Bug 275625

Summary: [WPE] WPE Platform: Do not assume that Wayland seats are bound before text input manager
Product: WebKit Reporter: Adrian Perez <aperez>
Component: WPE WebKitAssignee: Adrian Perez <aperez>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=265649
Bug Depends on:    
Bug Blocks: 265636    

Adrian Perez
Reported 2024-06-18 11:22:00 PDT
The Wayland registry listener in WPEDisplayWayland.cpp assumes a particular order in which the compositor will advertise the available global interfaces, and this bit: } else if (!std::strcmp(interface, "zwp_text_input_manager_v3")) { priv->textInputManagerV3 = static_cast<struct zwp_text_input_manager_v3*>(wl_registry_bind(registry, name, &zwp_text_input_manager_v3_interface, 1)); priv->textInputV3 = zwp_text_input_manager_v3_get_text_input(priv->textInputManagerV3, priv->wlSeat->seat()); } ...assumes that priv->wlSeat will be valid at the point when the input manager interface is advertised. But alas, there is no defined order in the Wayland protocol, and only the wl_registry global is guaranteed to be the first thing coming down the wire (for bootstrapping). Currently on my system using the labwc compositor (which is based on wlroots) the input manager interface is announced *before* the seat, resulting in a NULL pointer dereference with its corresponding SIGSEGV and crash.
Attachments
Adrian Perez
Comment 1 2024-06-18 15:31:01 PDT
EWS
Comment 2 2024-06-18 23:25:36 PDT
Committed 280164@main (73db3cb76418): <https://commits.webkit.org/280164@main> Reviewed commits have been landed. Closing PR #29951 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.