Bug 382063 - Crash in useraction menu due to Breeze Shadow
Summary: Crash in useraction menu due to Breeze Shadow
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL: https://phabricator.kde.org/D6533
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-06 15:41 UTC by Martin Flöser
Modified: 2017-07-06 19:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In: 5.10.4
Sentry Crash Report:
mgraesslin: Wayland+
mgraesslin: X11-
mgraesslin: ReviewRequest+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Flöser 2017-07-06 15:41:00 UTC
Thread 1 "kwin_wayland" received signal SIGSEGV, Segmentation fault.
0x00007f264183ecd0 in KWayland::Client::Surface::operator wl_surface*() () at /workspace/build/src/client/surface.cpp:309
309     /workspace/build/src/client/surface.cpp: No such file or directory.
(gdb) bt
#0  0x00007f264183ecd0 in KWayland::Client::Surface::operator wl_surface*() () at /workspace/build/src/client/surface.cpp:309
#1  0x00007f263098b13a in KWin::QPA::NativeInterface::nativeResourceForWindow (this=0x65ae20, resource=..., window=0x2a6ed20) at /workspace/build/plugins/qpa/nativeinterface.cpp:76
#2  0x00007f264183f05a in KWayland::Client::Surface::fromWindow (window=0x2a6ed20) at /workspace/build/src/client/surface.cpp:99
#3  0x00007f262f16bb60 in Breeze::ShadowHelper::installWaylandShadows (this=0x691ef0, widget=0x2dba3c0) at /workspace/build/kstyle/breezeshadowhelper.cpp:476
#4  0x00007f262f16cc1b in Breeze::ShadowHelper::eventFilter (this=0x691ef0, object=0x2dba3c0, event=0x7fff0770cb70) at /workspace/build/kstyle/breezeshadowhelper.cpp:186
#5  0x00007f2645622e92 in QCoreApplicationPrivate::sendThroughObjectEventFilters (receiver=receiver@entry=0x2dba3c0, event=event@entry=0x7fff0770cb70) at kernel/qcoreapplication.cpp:1129
#6  0x00007f2645a413d5 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x2dba3c0, e=0x7fff0770cb70) at kernel/qapplication.cpp:3713
#7  0x00007f2645a48e07 in QApplication::notify (this=0x7fff0770e0a0, receiver=0x2dba3c0, e=0x7fff0770cb70) at kernel/qapplication.cpp:3476
#8  0x00007f2645623128 in QCoreApplication::notifyInternal2 (receiver=receiver@entry=0x2dba3c0, event=event@entry=0x7fff0770cb70) at kernel/qcoreapplication.cpp:1018
#9  0x00007f2645a7b6ca in QCoreApplication::sendSpontaneousEvent (event=0x7fff0770cb70, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#10 QWidgetPrivate::sendPaintEvent (this=this@entry=0x2db4b80, toBePainted=...) at kernel/qwidget.cpp:5705
#11 0x00007f2645a7bd11 in QWidgetPrivate::drawWidget (this=0x2db4b80, pdev=0x2a6eb68, rgn=..., offset=..., flags=flags@entry=5, sharedPainter=sharedPainter@entry=0x0, backingStore=0x2982440) at kernel/qwidget.cpp:5645
#12 0x00007f2645a51320 in QWidgetBackingStore::doSync (this=this@entry=0x2982440) at kernel/qwidgetbackingstore.cpp:1377
#13 0x00007f2645a51a75 in QWidgetBackingStore::sync (this=0x2982440, exposedWidget=0x2dba3c0, exposedRegion=...) at kernel/qwidgetbackingstore.cpp:1132
#14 0x00007f2645a6abcf in QWidgetPrivate::syncBackingStore (this=this@entry=0x2db4b80, region=...) at kernel/qwidget.cpp:1978
#15 0x00007f2645a9e3dc in QWidgetWindow::handleExposeEvent (this=this@entry=0x2a6ed20, event=event@entry=0x7fff0770d330) at kernel/qwidgetwindow.cpp:922
#16 0x00007f2645a9ee93 in QWidgetWindow::event (this=0x2a6ed20, event=0x7fff0770d330) at kernel/qwidgetwindow.cpp:284
#17 0x00007f2645a413fc in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x2a6ed20, e=0x7fff0770d330) at kernel/qapplication.cpp:3717
#18 0x00007f2645a48e07 in QApplication::notify (this=0x7fff0770e0a0, receiver=0x2a6ed20, e=0x7fff0770d330) at kernel/qapplication.cpp:3476
#19 0x00007f2645623128 in QCoreApplication::notifyInternal2 (receiver=receiver@entry=0x2a6ed20, event=event@entry=0x7fff0770d330) at kernel/qcoreapplication.cpp:1018
#20 0x00007f263f4ae95d in QCoreApplication::sendSpontaneousEvent (event=0x7fff0770d330, receiver=0x2a6ed20) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#21 QGuiApplicationPrivate::processExposeEvent (e=0x988640) at kernel/qguiapplication.cpp:2848
#22 0x00007f263f4af58d in QGuiApplicationPrivate::processWindowSystemEvent (e=e@entry=0x988640) at kernel/qguiapplication.cpp:1782
#23 0x00007f263f489ceb in QWindowSystemInterface::sendWindowSystemEvents (flags=..., flags@entry=...) at kernel/qwindowsysteminterface.cpp:938
#24 0x00007f263f489f50 in QWindowSystemInterface::flushWindowSystemEvents (flags=flags@entry=...) at kernel/qwindowsysteminterface.cpp:907
#25 0x00007f263f49c888 in QPlatformWindow::setVisible (this=0x2a6f6f0, visible=<optimized out>) at kernel/qplatformwindow.cpp:160
#26 0x00007f263f4b7629 in QWindow::setVisible (this=this@entry=0x2a6ed20, visible=visible@entry=true) at kernel/qwindow.cpp:587
#27 0x00007f2645a7605c in QWidgetPrivate::show_sys (this=this@entry=0x2db4b80) at kernel/qwidget.cpp:8013
#28 0x00007f2645a7f4ab in QWidgetPrivate::show_helper (this=this@entry=0x2db4b80) at kernel/qwidget.cpp:7936
#29 0x00007f2645a821cd in QWidget::setVisible (this=0x2dba3c0, visible=<optimized out>) at kernel/qwidget.cpp:8230
#30 0x00007f2645ba11b6 in QMenu::popup (this=0x2dba3c0, p=..., atAction=atAction@entry=0x0) at widgets/qmenu.cpp:2529
#31 0x00007f2645ba2b04 in QMenu::internalDelayedPopup (this=0x2ed7700) at widgets/qmenu.cpp:3612
#32 0x00007f26456500c3 in QObject::event (this=this@entry=0x2ed7700, e=e@entry=0x7fff0770dba0) at kernel/qobject.cpp:1268
#33 0x00007f2645a82d03 in QWidget::event (this=this@entry=0x2ed7700, event=event@entry=0x7fff0770dba0) at kernel/qwidget.cpp:9242
#34 0x00007f2645ba7d03 in QMenu::event (this=0x2ed7700, e=0x7fff0770dba0) at widgets/qmenu.cpp:2994
#35 0x00007f2645a413fc in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x2ed7700, e=0x7fff0770dba0) at kernel/qapplication.cpp:3717
#36 0x00007f2645a48e07 in QApplication::notify (this=0x7fff0770e0a0, receiver=0x2ed7700, e=0x7fff0770dba0) at kernel/qapplication.cpp:3476
#37 0x00007f2645623128 in QCoreApplication::notifyInternal2 (receiver=0x2ed7700, event=event@entry=0x7fff0770dba0) at kernel/qcoreapplication.cpp:1018
#38 0x00007f26456766fe in QCoreApplication::sendEvent (event=0x7fff0770dba0, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:233
#39 QTimerInfoList::activateTimers (this=this@entry=0x679970) at kernel/qtimerinfo_unix.cpp:643
#40 0x00007f264567349c in QEventDispatcherUNIXPrivate::activateTimers (this=this@entry=0x6798d0) at kernel/qeventdispatcher_unix.cpp:249
#41 0x00007f2645674692 in QEventDispatcherUNIX::processEvents (this=<optimized out>, flags=...) at kernel/qeventdispatcher_unix.cpp:514
---Type <return> to continue, or q <return> to quit---
#42 0x00007f26309c3f5d in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/KWinQpaPlugin.so
#43 0x00007f264562130a in QEventLoop::exec (this=this@entry=0x7fff0770dd70, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#44 0x00007f2645629db4 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1291
#45 0x00007f263f4a52cc in QGuiApplication::exec () at kernel/qguiapplication.cpp:1666
#46 0x00007f2645a41355 in QApplication::exec () at kernel/qapplication.cpp:2905
#47 0x0000000000408908 in main (argc=4, argv=<optimized out>) at /workspace/build/main_wayland.cpp:763
Comment 1 Martin Flöser 2017-07-06 19:18:00 UTC
Git commit 962a2e39ee7a476e416f067dd31f10e3a4a63784 by Martin Flöser.
Committed on 06/07/2017 at 17:14.
Pushed by graesslin into branch 'Plasma/5.10'.

[qpa] Prevent crash due to Surface getting null

Summary:
This is a regression due to changes in Breeze to support Qt 5.8+ behavior
change. KWin's own QPA operates like < Qt 5.7 and breeze was programmed
against that. Due to that it can happen now that Breeze hits code paths
in which KWin does not have a surface.

To trigger one only needed to open the user actions menu twice.

This change adds a test case which simulates the problem and fixes all
crashes happening in the code path.

Most likely shadows are now broken for KWin's own windows, this change is
only to prevent the crash and thus is for 5.10 branch, while shadow
fixing will go to master branch.
FIXED-IN: 5.10.4

Test Plan: New test case

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6533

M  +1    -0    autotests/integration/CMakeLists.txt
A  +114  -0    autotests/integration/dont_crash_useractions_menu.cpp     [License: GPL (v2)]
M  +3    -0    plugins/qpa/backingstore.cpp
M  +3    -1    plugins/qpa/nativeinterface.cpp

https://commits.kde.org/kwin/962a2e39ee7a476e416f067dd31f10e3a4a63784