Bug 78706 - SIGSEGV in weston during fullscreen close/exit animation
Summary: SIGSEGV in weston during fullscreen close/exit animation
Status: VERIFIED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: weston (show other bugs)
Version: unspecified
Hardware: Other All
: medium critical
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-14 19:28 UTC by Anu Reddy
Modified: 2014-09-05 17:59 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
gdb-backtrace (9.70 KB, text/plain)
2014-05-14 19:30 UTC, Anu Reddy
Details
Stop crash when starting a touch during a fullscreen fade (1.26 KB, patch)
2014-08-26 21:24 UTC, Derek Foreman
Details | Splinter Review

Description Anu Reddy 2014-05-14 19:28:44 UTC
Touch events during weston-calibrator shutdown causes weston crash with segmentation fault in wl_resource_get_client. See attached gdb-backtrace.

1. Launch weston
2. Execute weston-calibrator
3. Touch the screen  three times to obtain calibration values
3. Touch the screen while weston-calibrator close animation is executing.
4. Notice weston crash with segfault.




Software Stack

wayland (1.5) 1.4.93-0-g8511544
drm (master) libdrm-2.4.52-0-g46d451c
mesa (10.2) heads/10.2-0-g0b3126b
libva (master) libva-1.2.1-0-g88ed1eb
intel-driver (master) 1.2.2-0-g121e70d
cairo (1.12) heads/1.12-0-g59e2a93
libinput (master) heads/master-0-g97af5c3
weston (1.5) 1.4.93-0-g7098948
Comment 1 Anu Reddy 2014-05-14 19:30:03 UTC
Created attachment 99043 [details]
gdb-backtrace
Comment 2 Anu Reddy 2014-05-21 00:25:52 UTC
When weston client is in fullscreen mode,  touching the display while close/destroy animation is performing causes weston crash.   Touch events during fullscreened client close animation, leads to segmentation fault in wl_resource_get_client. 

Another way to reproduce this issue is:
1. Launch weston-terminal
2. Enter fullscreen via <f11>
3. Press <mod> + k 
4. Touch the display while close animation is performing. Observe weston crash.


This is an issue under below software stack as well.
wayland (HEAD) 1.5.0-0-g3ac62cd
drm (HEAD) libdrm-2.4.54-0-g5126fcb
mesa (HEAD) mesa-10.1.3-0-g0028eb1
libva (HEAD) libva-1.2.1-0-g88ed1eb
intel-driver (HEAD) 1.2.2-0-g121e70d
cairo (HEAD) 1.12.16-0-g8e11a42
weston (HEAD) 1.5.0-0-g8801936
Comment 3 Derek Foreman 2014-08-26 21:24:07 UTC
Created attachment 105304 [details] [review]
Stop crash when starting a touch during a fullscreen fade

This issue is still reproducible today - I think this patch fixes it, but is only partially tested because I don't have a touchscreen (I just mashed up libinput to pretend my mouse is one).

If you could test and confirm this works, that would be great.
Comment 4 Boyan Ding 2014-08-27 03:23:03 UTC
(In reply to comment #3)
> Created attachment 105304 [details] [review] [review]
> Stop crash when starting a touch during a fullscreen fade
> 
> This issue is still reproducible today - I think this patch fixes it, but is
> only partially tested because I don't have a touchscreen (I just mashed up
> libinput to pretend my mouse is one).
> 
> If you could test and confirm this works, that would be great.

Looks good, although I don't have a touchscreen to test either.

One little question here: can we use
if (find_resource_for_view(&seat->touch->resource_list, view)) instead of
if (view)
to avoid the problem just as weston_pointer_set_focus do it?

If that can be used, the code will be much cleaner.

I also suggest sending the patch to the mailing list for review.
Comment 5 Derek Foreman 2014-08-29 14:56:16 UTC
Will try that and send the resulting patch to the list later today,
thanks
Comment 6 Derek Foreman 2014-08-29 18:17:12 UTC
I've posted a slightly changed version of this patch to the list that also stops another segfault (mod-touch during the fadeout would still crash even though just touching didn't)

I don't think find_resource_for_view() helps, as it does a few additional checks.  A direct substitution prevents the icons at the top of the screen from working.
Comment 7 Anu Reddy 2014-09-04 23:53:58 UTC
I tested Derek’s patch from wayland-devel( http://lists.freedesktop.org/archives/wayland-devel/2014-August/016978.html) on touch screen with below s/s. This patch fixes Segfault in weston. So, it can be merged.

Software Stack
wayland (HEAD) remotes/origin/HEAD-0-g6d0f298 
drm (HEAD) heads/master-16-gd686160 
mesa (HEAD) remotes/origin/10.2-0-gd82ca4e 
libva (HEAD) libva-1.3.1-0-g053f70f 
intel-driver (HEAD) 1.3.1-0-ga720bc8 
cairo (HEAD) heads/1.12-0-g59e2a93 
libinput (HEAD) heads/master-163-gbb10ec8 
weston (HEAD) remotes/origin/master-0-g652c794
Comment 8 Pekka Paalanen 2014-09-05 08:17:32 UTC
Should be fixed by:

commit 362656bfa308b653ed6c40b3e788b481d92b7cc8
Author: Derek Foreman <derekf@osg.samsung.com>
Date:   Thu Sep 4 10:23:05 2014 -0500

    touch-input: Don't dereference NULL pointer during full screen fade


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.