D13887: [wayland] Use the new plasma virtual desktop protocol

Martin Flöser <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
graesslin added a comment.


  This caused a regression in the auto tests:
  
  14353==ERROR: AddressSanitizer: heap-use-after-free on address 0x6070000ec588 at pc 0x7f82083b22f3 bp 0x7ffc5f33e060 sp 0x7ffc5f33e058
  --------------------------------------------------------------------------------------------------------------------------------------
  
  READ of size 8 at 0x6070000ec588 thread T0
  
    #0 0x7f82083b22f2 in QString::QString(QString const&) /usr/include/qt5/QtCore/qstring.h:952
    #1 0x7f82084dc781 in KWayland::Server::PlasmaVirtualDesktopInterface::id() const /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.11/kwayland/src/server/plasmavirtualdesktop_interface.cpp:350
    #2 0x7f82084deafd in KWayland::Server::PlasmaVirtualDesktopManagementInterface::Private::findDesktop(QString const&)::{lambda(KWayland::Server::PlasmaVirtualDesktopInterface const*)#1}::operator()(KWayland::Server::PlasmaVirtualDesktopInterface const*) const /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.11/kwayland/src/server/plasmavirtualdesktop_interface.cpp:115
    #3 0x7f82084e9688 in bool __gnu_cxx::__ops::_Iter_pred<KWayland::Server::PlasmaVirtualDesktopManagementInterface::Private::findDesktop(QString const&)::{lambda(KWayland::Server::PlasmaVirtualDesktopInterface const*)#1}>::operator()<QList<KWayland::Server::PlasmaVirtualDesktopInterface*>::iterator>(QList<KWayland::Server::PlasmaVirtualDesktopInterface*>::iterator) (/home/jenkins/install-prefix/lib64/libKF5WaylandServer.so.5+0x529688)
    #4 0x7f82084e7d4d in QList<KWayland::Server::PlasmaVirtualDesktopInterface*>::iterator std::__find_if<QList<KWayland::Server::PlasmaVirtualDesktopInterface*>::iterator, __gnu_cxx::__ops::_Iter_pred<KWayland::Server::PlasmaVirtualDesktopManagementInterface::Private::findDesktop(QString const&)::{lambda(KWayland::Server::PlasmaVirtualDesktopInterface const*)#1}> >(__gnu_cxx::__ops::_Iter_pred<KWayland::Server::PlasmaVirtualDesktopManagementInterface::Private::findDesktop(QString const&)::{lambda(KWayland::Server::PlasmaVirtualDesktopInterface const*)#1}>, __gnu_cxx::__ops::_Iter_pred<KWayland::Server::PlasmaVirtualDesktopManagementInterface::Private::findDesktop(QString const&)::{lambda(KWayland::Server::PlasmaVirtualDesktopInterface const*)#1}>, __gnu_cxx::__ops::_Iter_pred<KWayland::Server::PlasmaVirtualDesktopManagementInterface::Private::findDesktop(QString const&)::{lambda(KWayland::Server::PlasmaVirtualDesktopInterface const*)#1}>, std::random_access_iterator_tag) /usr/include/c++/8/bits/stl_algo.h:144
    #5 0x7f82084e38fe in QList<KWayland::Server::PlasmaVirtualDesktopInterface*>::iterator std::__find_if<QList<KWayland::Server::PlasmaVirtualDesktopInterface*>::iterator, __gnu_cxx::__ops::_Iter_pred<KWayland::Server::PlasmaVirtualDesktopManagementInterface::Private::findDesktop(QString const&)::{lambda(KWayland::Server::PlasmaVirtualDesktopInterface const*)#1}> >(__gnu_cxx::__ops::_Iter_pred<KWayland::Server::PlasmaVirtualDesktopManagementInterface::Private::findDesktop(QString const&)::{lambda(KWayland::Server::PlasmaVirtualDesktopInterface const*)#1}>, __gnu_cxx::__ops::_Iter_pred<KWayland::Server::PlasmaVirtualDesktopManagementInterface::Private::findDesktop(QString const&)::{lambda(KWayland::Server::PlasmaVirtualDesktopInterface const*)#1}>, __gnu_cxx::__ops::_Iter_pred<KWayland::Server::PlasmaVirtualDesktopManagementInterface::Private::findDesktop(QString const&)::{lambda(KWayland::Server::PlasmaVirtualDesktopInterface const*)#1}>) /usr/include/c++/8/bits/stl_algo.h:162
    #6 0x7f82084df96a in QList<KWayland::Server::PlasmaVirtualDesktopInterface*>::iterator std::find_if<QList<KWayland::Server::PlasmaVirtualDesktopInterface*>::iterator, KWayland::Server::PlasmaVirtualDesktopManagementInterface::Private::findDesktop(QString const&)::{lambda(KWayland::Server::PlasmaVirtualDesktopInterface const*)#1}>(KWayland::Server::PlasmaVirtualDesktopManagementInterface::Private::findDesktop(QString const&)::{lambda(KWayland::Server::PlasmaVirtualDesktopInterface const*)#1}, KWayland::Server::PlasmaVirtualDesktopManagementInterface::Private::findDesktop(QString const&)::{lambda(KWayland::Server::PlasmaVirtualDesktopInterface const*)#1}, KWayland::Server::PlasmaVirtualDesktopManagementInterface::Private::findDesktop(QString const&)::{lambda(KWayland::Server::PlasmaVirtualDesktopInterface const*)#1}) (/home/jenkins/install-prefix/lib64/libKF5WaylandServer.so.5+0x51f96a)
    #7 0x7f82084dee63 in KWayland::Server::PlasmaVirtualDesktopManagementInterface::Private::findDesktop(QString const&) /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.11/kwayland/src/server/plasmavirtualdesktop_interface.cpp:115
    #8 0x7f82084d8a27 in operator() /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.11/kwayland/src/server/plasmavirtualdesktop_interface.cpp:226
    #9 0x7f82084de278 in call /usr/include/qt5/QtCore/qobjectdefs_impl.h:128
    #10 0x7f82084de19f in call<QtPrivate::List<>, void> /usr/include/qt5/QtCore/qobjectdefs_impl.h:238
    #11 0x7f82084de14b in impl /usr/include/qt5/QtCore/qobjectdefs_impl.h:421
    #12 0x7f8205bc719f in QMetaObject::activate(QObject*, int, int, void**) (/usr/lib64/libQt5Core.so.5+0x2a019f)
    #13 0x7f8205bc770e in QObject::destroyed(QObject*) (/usr/lib64/libQt5Core.so.5+0x2a070e)
    #14 0x7f8205bcdfde in QObject::~QObject() (/usr/lib64/libQt5Core.so.5+0x2a6fde)
    #15 0x7f82084dc6b6 in KWayland::Server::PlasmaVirtualDesktopInterface::~PlasmaVirtualDesktopInterface() /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.11/kwayland/src/server/plasmavirtualdesktop_interface.cpp:345
    #16 0x7f82084dc6f5 in KWayland::Server::PlasmaVirtualDesktopInterface::~PlasmaVirtualDesktopInterface() /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.11/kwayland/src/server/plasmavirtualdesktop_interface.cpp:346
    #17 0x7f8205bc791f in QObject::event(QEvent*) (/usr/lib64/libQt5Core.so.5+0x2a091f)
    #18 0x7f82068644a0 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/usr/lib64/libQt5Widgets.so.5+0x1774a0)
    #19 0x7f820686baef in QApplication::notify(QObject*, QEvent*) (/usr/lib64/libQt5Widgets.so.5+0x17eaef)
    #20 0x7f8205b9de08 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/usr/lib64/libQt5Core.so.5+0x276e08)
    #21 0x7f8205ba0dfa in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (/usr/lib64/libQt5Core.so.5+0x279dfa)
    #22 0x7f8205becdaa in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/usr/lib64/libQt5Core.so.5+0x2c5daa)
    #23 0x7f81f7a1725c in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) /home/abuild/rpmbuild/BUILD/qtbase-everywhere-src-5.11.2/src/platformsupport/eventdispatchers/qunixeventdispatcher.cpp:68
    #24 0x7f8205b9cada in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (/usr/lib64/libQt5Core.so.5+0x275ada)
    #25 0x484d72 in QTestEventLoop::enterLoopMSecs(int) (/home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.11/build/bin/testKeyboardLayout+0x484d72)
    #26 0x48592e in QSignalSpy::wait(int) (/home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.11/build/bin/testKeyboardLayout+0x48592e)
    #27 0x4c2700 in KWin::Test::destroyWaylandConnection() /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.11/autotests/integration/test_helpers.cpp:265
    #28 0x41ac8e in KeyboardLayoutTest::cleanup() /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.11/autotests/integration/keyboard_layout_test.cpp:101
    #29 0x47e6c4 in KeyboardLayoutTest::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.11/build/autotests/integration/testKeyboardLayout_autogen/include/keyboard_layout_test.moc:107
    #30 0x7f8205bac6a4 in QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (/usr/lib64/libQt5Core.so.5+0x2856a4)
    #31 0x7f82136a775c  (/usr/lib64/libQt5Test.so.5+0x1975c)
    #32 0x7f82136a825a  (/usr/lib64/libQt5Test.so.5+0x1a25a)
    #33 0x7f82136a8820  (/usr/lib64/libQt5Test.so.5+0x1a820)
    #34 0x7f82136a8c2a in QTest::qRun() (/usr/lib64/libQt5Test.so.5+0x1ac2a)
    #35 0x7f82136a8e3a in QTest::qExec(QObject*, int, char**) (/usr/lib64/libQt5Test.so.5+0x1ae3a)
    #36 0x47e3fd in main /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.11/autotests/integration/keyboard_layout_test.cpp:503
    #37 0x7f8205050fea in __libc_start_main (/lib64/libc.so.6+0x22fea)
    #38 0x40f9d9 in _start (/home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.11/build/bin/testKeyboardLayout+0x40f9d9)
  
  0x6070000ec588 is located 24 bytes inside of 72-byte region [0x6070000ec570,0x6070000ec5b8)
  freed by thread T0 here:
  
    #0 0x7f8212808670 in operator delete(void*) (/usr/lib64/libasan.so.5+0xee670)
    #1 0x7f82084e676a in QScopedPointerDeleter<KWayland::Server::PlasmaVirtualDesktopInterface::Private>::cleanup(KWayland::Server::PlasmaVirtualDesktopInterface::Private*) /usr/include/qt5/QtCore/qscopedpointer.h:60
    #2 0x7f82084e2dd5 in QScopedPointer<KWayland::Server::PlasmaVirtualDesktopInterface::Private, QScopedPointerDeleter<KWayland::Server::PlasmaVirtualDesktopInterface::Private> >::~QScopedPointer() (/home/jenkins/install-prefix/lib64/libKF5WaylandServer.so.5+0x522dd5)
    #3 0x7f82084dc698 in KWayland::Server::PlasmaVirtualDesktopInterface::~PlasmaVirtualDesktopInterface() /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.11/kwayland/src/server/plasmavirtualdesktop_interface.cpp:345
    #4 0x7f82084dc6f5 in KWayland::Server::PlasmaVirtualDesktopInterface::~PlasmaVirtualDesktopInterface() /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.11/kwayland/src/server/plasmavirtualdesktop_interface.cpp:346
    #5 0x7f8205bc791f in QObject::event(QEvent*) (/usr/lib64/libQt5Core.so.5+0x2a091f)
    #6 0x7f82068644a0 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/usr/lib64/libQt5Widgets.so.5+0x1774a0)
  
  previously allocated by thread T0 here:
  
    #0 0x7f8212807900 in operator new(unsigned long) (/usr/lib64/libasan.so.5+0xed900)
    #1 0x7f82084dc5d6 in KWayland::Server::PlasmaVirtualDesktopInterface::PlasmaVirtualDesktopInterface(KWayland::Server::PlasmaVirtualDesktopManagementInterface*) /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.11/kwayland/src/server/plasmavirtualdesktop_interface.cpp:341
    #2 0x7f82084d96f6 in KWayland::Server::PlasmaVirtualDesktopManagementInterface::createDesktop(QString const&, unsigned int) /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.11/kwayland/src/server/plasmavirtualdesktop_interface.cpp:210
    #3 0x7f8210cb2d71 in KWin::VirtualDesktopManager::setVirtualDesktopManagement(KWayland::Server::PlasmaVirtualDesktopManagementInterface*) /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.11/virtualdesktops.cpp:98
    #4 0x7f8210eb246c in KWin::WaylandServer::initWorkspace() /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.11/wayland_server.cpp:400
    #5 0x41a909 in KeyboardLayoutTest::initTestCase() /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.11/autotests/integration/keyboard_layout_test.cpp:91
    #6 0x47e65a in KeyboardLayoutTest::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.11/build/autotests/integration/testKeyboardLayout_autogen/include/keyboard_layout_test.moc:105
    #7 0x7f8205bac6a4 in QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (/usr/lib64/libQt5Core.so.5+0x2856a4)
    #8 0x7f82136a8740  (/usr/lib64/libQt5Test.so.5+0x1a740)
    #9 0x7f82136a8c2a in QTest::qRun() (/usr/lib64/libQt5Test.so.5+0x1ac2a)
    #10 0x7f8205050fea in __libc_start_main (/lib64/libc.so.6+0x22fea)
  
  SUMMARY: AddressSanitizer: heap-use-after-free /usr/include/qt5/QtCore/qstring.h:952 in QString::QString(QString const&)
  Shadow bytes around the buggy address:
  
    0x0c0e80015860: 00 00 00 00 fa fa fa fa 00 00 00 00 00 00 00 00
    0x0c0e80015870: 00 fa fa fa fa fa 00 00 00 00 00 00 00 00 00 fa
    0x0c0e80015880: fa fa fa fa 00 00 00 00 00 00 00 00 00 fa fa fa
    0x0c0e80015890: fa fa 00 00 00 00 00 00 00 00 00 fa fa fa fa fa
    0x0c0e800158a0: 00 00 00 00 00 00 00 00 00 fa fa fa fa fa fd fd
  
  >0x0c0e800158b0: fd[fd]fd fd fd fd fd fa fa fa fa fa 00 00 00 00
  ================================================================
  
    0x0c0e800158c0: 00 00 00 00 00 fa fa fa fa fa 00 00 00 00 00 00
    0x0c0e800158d0: 00 00 00 fa fa fa fa fa 00 00 00 00 00 00 00 00
    0x0c0e800158e0: 00 fa fa fa fa fa 00 00 00 00 00 00 00 00 00 fa
    0x0c0e800158f0: fa fa fa fa 00 00 00 00 00 00 00 00 01 fa fa fa
    0x0c0e80015900: fa fa 00 00 00 00 00 00 00 00 00 07 fa fa fa fa
  
  Shadow byte legend (one shadow byte represents 8 application bytes):
  
    Addressable:           00
    Partially addressable: 01 02 03 04 05 06 07 
    Heap left redzone:       fa
    Freed heap region:       fd
    Stack left redzone:      f1
    Stack mid redzone:       f2
    Stack right redzone:     f3
    Stack after return:      f5
    Stack use after scope:   f8
    Global redzone:          f9
    Global init order:       f6
    Poisoned by user:        f7
    Container overflow:      fc
    Array cookie:            ac
    Intra object redzone:    bb
    ASan internal:           fe
    Left alloca redzone:     ca
    Right alloca redzone:    cb
  
  14353==ABORTING
  ---------------

REPOSITORY
  R108 KWin

REVISION DETAIL
  https://phabricator.kde.org/D13887

To: mart, #plasma, #kwin, graesslin, davidedmundson
Cc: hein, zzag, davidedmundson, kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, ngraham, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.