Bug 80837

Summary: xwayland-wm: crash in weston_wm_window_handle_moveresize
Product: Wayland Reporter: Boyan Ding <stu_dby>
Component: westonAssignee: Wayland bug list <wayland-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Boyan Ding 2014-07-03 01:33:26 UTC
The following action will crash weston:
1. launch gnome-terminal under xwayland in weston
2. click on the right side of the menubar (right of "Help" menu)
weston will immediately crash when mouse button is released.

The reason is Xwayland will somehow send a client message type of moveresize when pointer is released, and weston_wm_window_handle_moveresize will call weston_wm_pick_seat_for_window, which will always turn NULL if there is no button pressed. Then weston_wm_pick_seat_for_window will immediately dereference the NULL pointer.

There are two possible ways if we want to solve the problem on weston side:
1. remove the seat->pointer->button_count > 0 condition in weston_wm_pick_pointer_for_window to let it return a possible seat
2. check in weston_wm_window_handle_moveresize whether the returned seat is NULL.

Which is the more appropriate approach?
Comment 1 Boyan Ding 2014-07-12 10:05:22 UTC
Proposed patch at: http://lists.freedesktop.org/archives/wayland-devel/2014-July/015886.html
Uses the second approach.
Comment 2 Pekka Paalanen 2014-08-19 13:54:38 UTC
Committed as c06a180dd574c24ca50766461c10d3a6bfa3ad2b.

FWIW, I couldn't reproduce the problem before or after the patch. Maybe it was fixed elsewhere.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.