Bug 73066 - Segmentation fault in click_to_activate_binding (shell.c, line 4481 for weston 1.3.1)
Summary: Segmentation fault in click_to_activate_binding (shell.c, line 4481 for westo...
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: weston (show other bugs)
Version: 1.3.0
Hardware: x86 (IA32) Linux (All)
: low minor
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-27 13:25 UTC by Florian
Modified: 2014-01-02 00:29 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Florian 2013-12-27 13:25:12 UTC
When I click into the black screen of the compositor, it fails with a segmentation fault in line 4481 in shell.c:

activate_binding(seat, data, seat->pointer->focus->surface);

In my scenario, focus is null. I understand, that this is propably caused by an improperly (and self-written) desktop shell. However, a good practice would be
a) either to guarantee, that focus is non-null, whenever this function is called, or
b) to check focus on null and logging an expressive error message instead of seg-faulting.

Regards, Florian.
Comment 1 Kristian Høgsberg 2014-01-02 00:29:45 UTC
commit 7c4f6cc145daf66cd9624f1e70dd5278241f5858
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Wed Jan 1 16:28:32 2014 -0800

    shell: Only assign focus on click if there is a pointer focus surface
    
    If we don't have a background image from the desktop-shell client or the
    pointer for some other reason doesn't have a focus we trigger a
    segfault as we try to deref the seat->pointer->focus NULL pointer.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=73066


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.