Bug 473244 - kwin_wayland crashes when double clicking to close window
Summary: kwin_wayland crashes when double clicking to close window
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: decorations (other bugs)
Version First Reported In: master
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: drkonqi, qt6, wayland-only
Depends on:
Blocks:
 
Reported: 2023-08-10 14:50 UTC by Fushan Wen
Modified: 2023-08-30 09:35 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fushan Wen 2023-08-10 14:50:04 UTC
SUMMARY
kwin_wayland crashed when I double clicked the window icon quickly to close the window.


STEPS TO REPRODUCE
1. Open a window
2. Double click the icon in the window decoration

OBSERVED RESULT
Crash

EXPECTED RESULT
No crash

SOFTWARE/OS VERSIONS
kwin master at b0897a9aa5919178044123c22dad7e1daa10f07c

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2023-08-10 14:55:44 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4315
Comment 2 Fushan Wen 2023-08-10 15:04:39 UTC
(gdb) bt
#0  QSize::isEmpty() const (this=0x1a0) at /usr/include/qt6/QtCore/qsize.h:119
#1  KWaylandServer::XdgToplevelInterface::minimumSize() const (this=0x2d5c460)
    at /home/qydw/kde/src/kwin/src/wayland/xdgshell_interface.cpp:531
#2  0x00007fa59c9e37dc in KWin::XdgToplevelWindow::minSize() const (this=0x13cb700) at /home/qydw/kde/src/kwin/src/xdgshellwindow.cpp:502
#3  KWin::XdgToplevelWindow::isResizable() const (this=0x13cb700) at /home/qydw/kde/src/kwin/src/xdgshellwindow.cpp:556
#4  0x00007fa59c98aad8 in KWin::Window::updateCursor() (this=0x13cb700) at /home/qydw/kde/src/kwin/src/window.cpp:2381
#5  0x00007fa59c8749a4 in KWin::DecorationEventFilter::pointerEvent(KWin::MouseEvent*, unsigned int)
    (this=<optimized out>, event=0x7ffdec204190, nativeButton=<optimized out>)
    at /home/qydw/kde/src/kwin/src/decorations/decoratedclient.h:81
#6  0x00007fa59c8cad65 in std::__invoke_impl<bool, bool (KWin::InputEventFilter::*&)(KWin::MouseEvent*, unsigned int), KWin::InputEventFilter* const&, KWin::MouseEvent*&, unsigned int&>(std::__invoke_memfun_deref, bool (KWin::InputEventFilter::*&)(KWin::MouseEvent*, unsigned int), KWin::InputEventFilter* const&, KWin::MouseEvent*&, unsigned int&) (__f=<optimized out>, __t=@0x1ecd5f8: 0x1b48480)
    at /usr/include/c++/13/bits/invoke.h:71
#7  std::__invoke<bool (KWin::InputEventFilter::*&)(KWin::MouseEvent*, unsigned int), KWin::InputEventFilter* const&, KWin::MouseEvent*&, unsigned int&>(bool (KWin::InputEventFilter::*&)(KWin::MouseEvent*, unsigned int), KWin::InputEventFilter* const&, KWin::MouseEvent*&, unsigned int&) (__fn=<optimized out>) at /usr/include/c++/13/bits/invoke.h:96
#8  std::_Bind<bool (KWin::InputEventFilter::*(std::_Placeholder<1>, KWin::MouseEvent*, unsigned int))(KWin::MouseEvent*, unsigned int)>::__call<bool, KWin::InputEventFilter* const&, 0ul, 1ul, 2ul>(std::tuple<KWin::InputEventFilter* const&>&&, std::_Index_tuple<0ul, 1ul, 2ul>)
    (__args=<optimized out>, this=<optimized out>) at /usr/include/c++/13/functional:506
#9  std::_Bind<bool (KWin::InputEventFilter::*(std::_Placeholder<1>, KWin::MouseEvent*, unsigned int))(KWin::MouseEvent*, unsigned int)>::operator()<KWin::InputEventFilter* const&, bool>(KWin::InputEventFilter* const&) (this=<optimized out>) at /usr/include/c++/13/functional:591
#10 __gnu_cxx::__ops::_Iter_pred<std::_Bind<bool (KWin::InputEventFilter::*(std::_Placeholder<1>, KWin::MouseEvent*, unsigned int))(KWin::MouseEvent*, unsigned int)> >::operator()<QList<KWin::InputEventFilter*>::const_iterator>(QList<KWin::InputEventFilter*>::const_iterator)
    (__it=..., this=<optimized out>) at /usr/include/c++/13/bits/predefined_ops.h:318
#11 std::__find_if<QList<KWin::InputEventFilter*>::const_iterator, __gnu_cxx::__ops::_Iter_pred<std::_Bind<bool (KWin::InputEventFilter::*(std::_Placeholder<1>, KWin::MouseEvent*, unsigned int))(KWin::MouseEvent*, unsigned int)> > >(QList<KWin::InputEventFilter*>::const_iterator, QList<KWin::InputEventFilter*>::const_iterator, __gnu_cxx::__ops::_Iter_pred<std::_Bind<bool (KWin::InputEventFilter::*(std::_Placeholder<1>, KWin::MouseEvent*, unsigned int))(KWin::MouseEvent*, unsigned int)> >, std::random_access_iterator_tag)
    (__pred=..., __last=..., __first=...) at /usr/include/c++/13/bits/stl_algobase.h:2084
#12 std::__find_if<QList<KWin::InputEventFilter*>::const_iterator, __gnu_cxx::__ops::_Iter_pred<std::_Bind<bool (KWin::InputEventFilter::*(std::_Placeholder<1>, KWin::MouseEvent*, unsigned int))(KWin::MouseEvent*, unsigned int)> > >(QList<KWin::InputEventFilter*>::const_iterator, QList<KWin::InputEventFilter*>::const_iterator, __gnu_cxx::__ops::_Iter_pred<std::_Bind<bool (KWin::InputEventFilter::*(std::_Placeholder<1>, KWin::MouseEvent*, unsigned int))(KWin::MouseEvent*, unsigned int)> >) (__pred=..., __last=..., __first=...)
    at /usr/include/c++/13/bits/stl_algobase.h:2117
#13 std::find_if<QList<KWin::InputEventFilter*>::const_iterator, std::_Bind<bool (KWin::InputEventFilter::*(std::_Placeholder<1>, KWin::MouseEvent*, unsigned int))(KWin::MouseEvent*, unsigned int)> >(QList<KWin::InputEventFilter*>::const_iterator, QList<KWin::InputEventFilter*>::const_iterator, std::_Bind<bool (KWin::InputEventFilter::*(std::_Placeholder<1>, KWin::MouseEvent*, unsigned int))(KWin::MouseEvent*, unsigned int)>) (__pred=..., __last=..., __first=...) at /usr/include/c++/13/bits/stl_algo.h:3923
#14 std::none_of<QList<KWin::InputEventFilter*>::const_iterator, std::_Bind<bool (KWin::InputEventFilter::*(std::_Placeholder<1>, KWin::MouseEvent*, unsigned int))(KWin::MouseEvent*, unsigned int)> >(QList<KWin::InputEventFilter*>::const_iterator, QList<KWin::InputEventFilter*>::const_iterator, std::_Bind<bool (KWin::InputEventFilter::*(std::_Placeholder<1>, KWin::MouseEvent*, unsigned int))(KWin::MouseEvent*, unsigned int)>) (__pred=..., __last=..., __first=...) at /usr/include/c++/13/bits/stl_algo.h:477
#15 std::any_of<QList<KWin::InputEventFilter*>::const_iterator, std::_Bind<bool (KWin::InputEventFilter::*(std::_Placeholder<1>, KWin::MouseEvent*, unsigned int))(KWin::MouseEvent*, unsigned int)> >(QList<KWin::InputEventFilter*>::const_iterator, QList<KWin::InputEventFilter*>::const_iterator, std::_Bind<bool (KWin::InputEventFilter::*(std::_Placeholder<1>, KWin::MouseEvent*, unsigned int))(KWin::MouseEvent*, unsigned int)>) (__pred=..., __last=..., __first=...) at /usr/include/c++/13/bits/stl_algo.h:496
#16 KWin::InputRedirection::processFilters<std::_Bind<bool (KWin::InputEventFilter::*(std::_Placeholder<1>, KWin::MouseEvent*, unsigned int))(KWin::MouseEvent*, unsigned int)> >(std::_Bind<bool (KWin::InputEventFilter::*(std::_Placeholder<1>, KWin::MouseEvent*, unsigned int))(KWin::MouseEvent*, unsigned int)>) (function=..., this=<optimized out>) at /home/qydw/kde/src/kwin/src/input.h:191
#17 KWin::PointerInputRedirection::processButton(unsigned int, KWin::InputRedirection::PointerButtonState, std::chrono::duration<long, std::ratio<1l, 1000000l> >, KWin::InputDevice*)
    (this=0x153c630, button=272, state=KWin::InputRedirection::PointerButtonReleased, time=std::chrono::duration = { <optimized out>us }, device=<optimized out>) at /home/qydw/kde/src/kwin/src/pointer_input.cpp:280
#18 0x00007fa5997ba110 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffdec204360, r=0x153c630, this=<optimized out>)
    at /usr/src/debug/qtbase-everywhere-src-6.5.2/build/include/QtCore/../../../src/corelib/kernel/qobjectdefs_impl.h:363
#19 doActivate<false>(QObject*, int, void**) (sender=0x1358280, signal_index=4, argv=0x7ffdec204360)
    at /usr/src/debug/qtbase-everywhere-src-6.5.2/src/corelib/kernel/qobject.cpp:3992
#20 0x00007fa59c7e281f in KWin::InputDevice::pointerButtonChanged(unsigned int, KWin::InputRedirection::PointerButtonState, std::chrono::duration<long, std::ratio<1l, 1000000l> >, KWin::InputDevice*) (this=this@entry=0x1358280, _t1=<optimized out>, _t2=<optimized out>, 
    _t2@entry=KWin::InputRedirection::PointerButtonReleased, _t3=_t3@entry=std::chrono::duration = { 3838114694us }, _t4=<optimized out>, 
    _t4@entry=0x1358280) at /home/qydw/kde/build/kwin/src/kwin_autogen/include/moc_inputdevice.cpp:1035
#21 0x00007fa59ca4c68c in KWin::LibInput::Connection::processEvents() (this=<optimized out>)
    at /home/qydw/kde/src/kwin/src/backends/libinput/connection.cpp:352
#22 0x00007fa5997a4290 in QObject::event(QEvent*) (this=0x13cd330, e=0x7fa574006e50)
    at /usr/src/debug/qtbase-everywhere-src-6.5.2/src/corelib/kernel/qobject.cpp:1391
#23 0x00007fa59a7beb2e in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x13cd330, e=0x7fa574006e50)
    at /usr/src/debug/qtbase-everywhere-src-6.5.2/src/widgets/kernel/qapplication.cpp:3287
#24 0x00007fa599765d48 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x13cd330, event=0x7fa574006e50)
    at /usr/src/debug/qtbase-everywhere-src-6.5.2/src/corelib/kernel/qcoreapplication.cpp:1118
#25 0x00007fa599765d89 in QCoreApplication::sendEvent(QObject*, QEvent*) (receiver=<optimized out>, event=<optimized out>)
    at /usr/src/debug/qtbase-everywhere-src-6.5.2/src/corelib/kernel/qcoreapplication.cpp:1536
#26 0x00007fa599766087 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)
    (receiver=0x0, event_type=0, data=0x13519b0) at /usr/src/debug/qtbase-everywhere-src-6.5.2/src/corelib/kernel/qcoreapplication.cpp:1898
#27 0x00007fa59988dca7 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x13595d0, flags=flags@entry=...)
    at /usr/src/debug/qtbase-everywhere-src-6.5.2/src/corelib/kernel/qeventdispatcher_unix.cpp:432
#28 0x00007fa59a1f8fbd in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...)
    at /usr/src/debug/qtbase-everywhere-src-6.5.2/src/gui/platform/unix/qunixeventdispatcher.cpp:27
#29 0x00007fa59977016a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x7ffdec204850, flags=...)
    at /usr/src/debug/qtbase-everywhere-src-6.5.2/build/include/QtCore/../../../src/corelib/global/qflags.h:34
#30 0x00007fa599769cb6 in QCoreApplication::exec() ()
    at /usr/src/debug/qtbase-everywhere-src-6.5.2/build/include/QtCore/../../../src/corelib/global/qflags.h:74
#31 0x00007fa599de0fcc in QGuiApplication::exec() () at /usr/src/debug/qtbase-everywhere-src-6.5.2/src/gui/kernel/qguiapplication.cpp:1908
#32 0x00007fa59a7bbfd5 in QApplication::exec() () at /usr/src/debug/qtbase-everywhere-src-6.5.2/src/widgets/kernel/qapplication.cpp:2566
#33 0x00000000004335f8 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /home/qydw/kde/src/kwin/src/main_wayland.cpp:613
Comment 3 Bug Janitor Service 2023-08-24 14:13:21 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4363
Comment 4 Vlad Zahorodnii 2023-08-30 09:35:16 UTC
Git commit dee8a3b3a741ab13a3680a21304c2dc514e3d3ba by Vlad Zahorodnii.
Committed on 30/08/2023 at 11:28.
Pushed by vladz into branch 'master'.

Clear decoration focus when window closes

If the window closes, we need to reset the focused decoration object.

M  +62   -20   autotests/integration/decoration_input_test.cpp
M  +21   -15   src/pointer_input.cpp
M  +1    -0    src/pointer_input.h

https://invent.kde.org/plasma/kwin/-/commit/dee8a3b3a741ab13a3680a21304c2dc514e3d3ba