Bug 383055 - crash when dragging a gtk3 window with touchscreen
Summary: crash when dragging a gtk3 window with touchscreen
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:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-02 16:50 UTC by Marco Martin
Modified: 2017-10-15 19:26 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Martin 2017-08-02 16:50:17 UTC
version: xdgv6 branch, but tracking here to not forget
if a gtk3 window is dragged from its CSD with mouse or touchpad, it works correctly, if it's dragged with the touchscreen, kwin crashes with the following backtrace:

#0  0x00007ff8863f8fc3 in __dynamic_cast () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x00007ff8886b179e in KWin::Workspace::workspaceEvent (this=0x211f080, e=0x24df340) at /home/diau/git/kf5/kde/workspace/kwin/events.cpp:364
#2  0x00007ff8886a58ea in KWin::XcbEventFilter::nativeEventFilter (this=0x1686d20, eventType=..., message=0x24df340, result=0x7fff0800c9e8)
    at /home/diau/git/kf5/kde/workspace/kwin/main.cpp:420
#3  0x00007ff886b9390f in QAbstractEventDispatcher::filterNativeEvent (this=<optimized out>, eventType=..., message=0x24df340, result=0x7fff0800c9e8)
    at kernel/qabstracteventdispatcher.cpp:467
#4  0x0000000000408349 in KWin::ApplicationWayland::<lambda()>::operator()(void) const (__closure=0x2146870)
    at /home/diau/git/kf5/kde/workspace/kwin/main_wayland.cpp:176
#5  0x000000000040e8eb in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, KWin::ApplicationWayland::continueStartupWithX()::<lambda()> >::call(KWin::ApplicationWayland::<lambda()> &, void **) (f=..., arg=0x7fff0800cb60) at /opt/kde5/include/QtCore/qobjectdefs_impl.h:130
#6  0x000000000040e66e in QtPrivate::Functor<KWin::ApplicationWayland::continueStartupWithX()::<lambda()>, 0>::call<QtPrivate::List<>, void>(KWin::ApplicationWayland::<lambda()> &, void *, void **) (f=..., arg=0x7fff0800cb60) at /opt/kde5/include/QtCore/qobjectdefs_impl.h:240
#7  0x000000000040e0a1 in QtPrivate::QFunctorSlotObject<KWin::ApplicationWayland::continueStartupWithX()::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=1, this_=0x2146860, r=0x7fff0800d000, a=0x7fff0800cb60, ret=0x0) at /opt/kde5/include/QtCore/qobject_impl.h:168
#8  0x00007ff886bc6d11 in QtPrivate::QSlotObjectBase::call (a=<optimized out>, r=0x7fff0800d000, this=<optimized out>)
    at ../../include/QtCore/../../src/corelib/kernel/qobject_impl.h:101
#9  QMetaObject::activate (sender=sender@entry=0x164b470, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0)
    at kernel/qobject.cpp:3749
#10 0x00007ff886bc71d7 in QMetaObject::activate (sender=sender@entry=0x164b470, m=m@entry=0x7ff886e71240 <QAbstractEventDispatcher::staticMetaObject>,
    local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0) at kernel/qobject.cpp:3628
#11 0x00007ff886b932fc in QAbstractEventDispatcher::aboutToBlock (this=this@entry=0x164b470) at .moc/moc_qabstracteventdispatcher.cpp:139
#12 0x00007ff886bee18b in QEventDispatcherUNIX::processEvents (this=0x164b470, flags=..., flags@entry=...) at kernel/qeventdispatcher_unix.cpp:477
#13 0x00007ff871f58e3b in QUnixEventDispatcherQPA::processEvents (this=<optimized out>, flags=...) at qunixeventdispatcher.cpp:68
#14 0x00007ff886b949db in QEventLoop::processEvents (this=this@entry=0x7fff0800cd30, flags=..., flags@entry=...) at kernel/qeventloop.cpp:134
#15 0x00007ff886b94e54 in QEventLoop::exec (this=this@entry=0x7fff0800cd30, flags=flags@entry=...) at kernel/qeventloop.cpp:212
#16 0x00007ff886b9e8a0 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1291
#17 0x00007ff880588e24 in QGuiApplication::exec () at kernel/qguiapplication.cpp:1679
#18 0x00007ff886feb917 in QApplication::exec () at kernel/qapplication.cpp:2905

    #19 0x000000000040d576 in main (argc=4, argv=0x7fff0800d268) at /home/diau/git/kf5/kde/workspace/kwin/main_wayland.cpp:763
Comment 1 Martin Flöser 2017-08-02 19:20:15 UTC
crashing code section:
if (Client *c = dynamic_cast<Client*>(movingClient)) {

This doesn't make sense. It shouldn't crash.
Comment 2 Martin Flöser 2017-08-02 19:21:09 UTC
To explain: movingClient is the window you are moving and it's an AbstractClient. The cast to Client should be possible and return null, but not crash.
Comment 3 Marco Martin 2017-08-03 16:01:46 UTC
but still it crashes.. perhaps for some reason movingClient is not correctly update to the window it's moving, but is still something old?
Comment 4 Martin Flöser 2017-10-15 19:26:28 UTC
The crash should be fixed. The relevant code was split out into a dedicated X11EventFilter and is only loaded by Workspace if operation mode is X11 only. This means the code that crashed is not executed any more.