Bug 69777

Summary: [bug] Launching application on disconnected display will segfault Weston
Product: Wayland Reporter: Brian Lovin <brian.j.lovin>
Component: westonAssignee: Wayland bug list <wayland-bugs>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Backtrage for Weston when the segfault occours.

Description Brian Lovin 2013-09-24 22:38:56 UTC
Created attachment 86491 [details]
Backtrage for Weston when the segfault occours.

Software Stack:
Fedora 19
3.10.10-200.fc19.x86_64
wayland (HEAD) 1.2.91-0-g4125367
drm (HEAD) libdrm-2.4.46-0-gc6d73cf
mesa (9.2) heads/9.2-0-g2cda3f0
libva (HEAD) libva-1.2.1-0-g88ed1eb
intel-driver (HEAD) 1.2.0-0-g6898ab7
weston (HEAD) 1.2.91-0-g7799385

When the mouse cursor is on a display which is unplugged, the mouse cursor stays on that display. If an application is launched it attempts to display on the unplugged display. This causes Weston to segfault.

To reproduce:
* Move mouse to a second display with Weston running
* Unplug second display
* Quickly launch an application (tested with weston-terminal)
* Observe segfault
Comment 1 Kristian Høgsberg 2013-10-27 04:23:28 UTC
This crash is fixed on master:

commit 971165368d22b16f248e82b3d6f4f1f1eedb764e
Author: Xiong Zhang <xiong.y.zhang@intel.com>
Date:   Wed Oct 23 13:58:31 2013 +0800

    compositor: set surface->plane from destroyed plane to NULL
    
    In drm backend, the cursor_surface->plane point to
    drm_output->cursor_plane.when this output is removed,
    drm_output->cursor_plane is destroyed, butcursor_surface->plane
    still point to destroyed plane. So once mouse move to this
    cursor_surface and system will repaint this cursor_surface,
    segment fault will generate in weston_surface_damage_below() function.
    
    V2:
    -set surface->plane to NULL whose plane point to unplugged output,
     then change weston_surface_damage_below() to do nothing if
     surface->plane is NULL (Kristian)
    -set surface->plane to NULL in weston_surface_unmap(),
     so that all surfaces that have a non-NULL plane pointer wil be
     on compositor->surface_list (Kristian).
    
    bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69777
    
    Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>

and 1.3 as 98562c36c116c466a20d096413319632c75e603d.

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.