Skip to content

Prevent crash, don't call null surfaces

Aleix Pol Gonzalez requested to merge work/fix_startup_crash into master

Here's the crash I was seeing:

(gdb) where
#0  QScopedPointer<KWaylandServer::SurfaceInterfacePrivate, QScopedPointerDeleter<KWaylandServer::SurfaceInterfacePrivate> >::operator->() const (this=0x10) at /home/apol/devel/kde5/include/QtCore/qscopedpointer.h:118
#1  0x00007fe01590ac16 in KWaylandServer::SurfaceInterface::client() const (this=0x0) at /home/apol/devel/frameworks/kwayland-server/src/server/surface_interface.cpp:407
#2  0x00007fe017aacfa0 in KWin::WaylandClient::isLockScreen() const (this=0x55f8eaf95980) at /home/apol/devel/frameworks/kwin/waylandclient.cpp:110
#3  0x00007fe017835d8d in KWin::AbstractClient::belongsToLayer() const (this=0x55f8eaf95980) at /home/apol/devel/frameworks/kwin/abstract_client.cpp:278
#4  0x00007fe017835fc9 in KWin::AbstractClient::updateLayer() (this=0x55f8eaf95980) at /home/apol/devel/frameworks/kwin/abstract_client.cpp:247
#5  0x00007fe01796fed4 in KWin::Workspace::updateClientLayer(KWin::AbstractClient*) (this=0x55f8e90ca6d0, c=0x55f8eaf95980) at /home/apol/devel/frameworks/kwin/layers.cpp:111
#6  0x00007fe017835996 in KWin::AbstractClient::setActive(bool) (this=0x55f8eaf95980, act=false) at /home/apol/devel/frameworks/kwin/abstract_client.cpp:221
#7  0x00007fe017860e01 in KWin::Workspace::setActiveClient(KWin::AbstractClient*) (this=0x55f8e90ca6d0, c=0x0) at /home/apol/devel/frameworks/kwin/activation.cpp:244
#8  0x00007fe017861932 in KWin::Workspace::activateNextClient(KWin::AbstractClient*) (this=0x55f8e90ca6d0, c=0x55f8eaf95980) at /home/apol/devel/frameworks/kwin/activation.cpp:451
#9  0x00007fe017861871 in KWin::Workspace::clientHidden(KWin::AbstractClient*) (this=0x55f8e90ca6d0, c=0x55f8eaf95980) at /home/apol/devel/frameworks/kwin/activation.cpp:415
#10 0x00007fe017ab40e2 in KWin::Workspace::removeShellClient(KWin::AbstractClient*) (this=0x55f8e90ca6d0, client=0x55f8eaf95980) at /home/apol/devel/frameworks/kwin/workspace.cpp:776
#11 0x00007fe017ad146c in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<KWin::AbstractClient*>, void, void (KWin::Workspace::*)(KWin::AbstractClient*)>::call(void (KWin::Workspace::*)(KWin::AbstractClient*), KWin::Workspace*, void**) (f=
    (void (KWin::Workspace::*)(KWin::Workspace * const, KWin::AbstractClient *)) 0x7fe017ab3fe0 <KWin::Workspace::addShellClient(KWin::AbstractClient*)+912>, o=0x55f8e90ca6d0, arg=0x7fff4be4e540) at /home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:152
#12 0x00007fe017ad13c8 in QtPrivate::FunctionPointer<void (KWin::Workspace::*)(KWin::AbstractClient*)>::call<QtPrivate::List<KWin::AbstractClient*>, void>(void (KWin::Workspace::*)(KWin::AbstractClient*), KWin::Workspace*, void**) (f=
    (void (KWin::Workspace::*)(KWin::Workspace * const, KWin::AbstractClient *)) 0x7fe017ab3fe0 <KWin::Workspace::addShellClient(KWin::AbstractClient*)+912>, o=0x55f8e90ca6d0, arg=0x7fff4be4e540) at /home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:185
#13 0x00007fe017ad12f5 in QtPrivate::QSlotObject<void (KWin::Workspace::*)(KWin::AbstractClient*), QtPrivate::List<KWin::AbstractClient*>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)
    (which=1, this_=0x55f8e99edd90, r=0x55f8e90ca6d0, a=0x7fff4be4e540, ret=0x0) at /home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:418
#14 0x00007fe014417f06 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7fff4be4e540, r=0x55f8e90ca6d0, this=0x55f8e99edd90) at ../../include/QtCore/../../../../../devel/frameworks/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:398
#15 doActivate<false>(QObject*, int, void**) (sender=0x55f8e8d00a10, signal_index=4, argv=0x7fff4be4e540) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qobject.cpp:3886
#16 0x00007fe01781e446 in KWin::WaylandServer::shellClientRemoved(KWin::AbstractClient*) (this=0x55f8e8d00a10, _t1=0x55f8eaf95980) at kwin_autogen/EWIEGA46WW/moc_wayland_server.cpp:190
#17 0x00007fe017a9f0fb in KWin::WaylandServer::removeClient(KWin::AbstractClient*) (this=0x55f8e8d00a10, c=0x55f8eaf95980) at /home/apol/devel/frameworks/kwin/wayland_server.cpp:699
#18 0x00007fe017b0a568 in KWin::XdgSurfaceClient::destroyClient() (this=0x55f8eaf95980) at /home/apol/devel/frameworks/kwin/xdgshellclient.cpp:585
#19 0x00007fe017b18aa1 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (KWin::XdgSurfaceClient::*)()>::call(void (KWin::XdgSurfaceClient::*)(), KWin::XdgSurfaceClient*, void**)
    (f=&virtual table offset 880, o=0x55f8eaf95980, arg=0x7fff4be4e810) at /home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:152
#20 0x00007fe017b18a08 in QtPrivate::FunctionPointer<void (KWin::XdgSurfaceClient::*)()>::call<QtPrivate::List<>, void>(void (KWin::XdgSurfaceClient::*)(), KWin::XdgSurfaceClient*, void**) (f=&virtual table offset 880, o=0x55f8eaf95980, arg=0x7fff4be4e810)
    at /home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:185
#21 0x00007fe017b18935 in QtPrivate::QSlotObject<void (KWin::XdgSurfaceClient::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x55f8eaf953d0, r=0x55f8eaf95980, a=0x7fff4be4e810, ret=0x0)
    at /home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:418
#22 0x00007fe014417f06 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7fff4be4e810, r=0x55f8eaf95980, this=0x55f8eaf953d0) at ../../include/QtCore/../../../../../devel/frameworks/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:398
#23 doActivate<false>(QObject*, int, void**) (sender=0x55f8ea9a7870, signal_index=0, argv=argv@entry=0x7fff4be4e810) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qobject.cpp:3886
#24 0x00007fe014411260 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x55f8ea9a7870, m=m@entry=0x7fe0146a7ac0 <QObject::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fff4be4e810)
    at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qobject.cpp:3946
#25 0x00007fe01441130f in QObject::destroyed(QObject*) (this=this@entry=0x55f8ea9a7870, _t1=<optimized out>, _t1@entry=0x55f8ea9a7870) at .moc/moc_qobject.cpp:219
#26 0x00007fe01441628d in QObject::~QObject() (this=<optimized out>, __in_chrg=<optimized out>) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qobject.cpp:992
#27 0x00007fe01590ab51 in KWaylandServer::SurfaceInterface::~SurfaceInterface() (this=0x55f8ea9a7870) at /home/apol/devel/frameworks/kwayland-server/src/server/surface_interface.cpp:398
#28 0x00007fe01590ab7c in KWaylandServer::SurfaceInterface::~SurfaceInterface() (this=0x55f8ea9a7870) at /home/apol/devel/frameworks/kwayland-server/src/server/surface_interface.cpp:397
#29 0x00007fe01590a0f4 in KWaylandServer::SurfaceInterfacePrivate::surface_destroy_resource(QtWaylandServer::wl_surface::Resource*) (this=0x55f8ead72410) at /home/apol/devel/frameworks/kwayland-server/src/server/surface_interface.cpp:288
#30 0x00007fe015943a8a in QtWaylandServer::wl_surface::destroy_func(wl_resource*) (client_resource=0x55f8eaf88640) at src/server/qwayland-server-wayland.cpp:2720
#31 0x00007fe012fb7e90 in  () at /usr/lib/libwayland-server.so.0
#32 0x00007fe012fbc851 in  () at /usr/lib/libwayland-server.so.0
#33 0x00007fe012fbcd50 in  () at /usr/lib/libwayland-server.so.0
#34 0x00007fe012fb8020 in wl_client_destroy () at /usr/lib/libwayland-server.so.0
#35 0x00007fe01586607f in KWaylandServer::ClientConnection::destroy() (this=0x55f8eaf0bd60) at /home/apol/devel/frameworks/kwayland-server/src/server/clientconnection.cpp:98
#36 0x00007fe017aa3e96 in KWin::WaylandServer::initScreenLocker()::$_15::operator()() const (this=0x55f8e99f8bb0) at /home/apol/devel/frameworks/kwin/wayland_server.cpp:562
#37 0x00007fe017aa3e16 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, KWin::WaylandServer::initScreenLocker()::$_15>::call(KWin::WaylandServer::initScreenLocker()::$_15&, void**) (f=..., arg=0x7fff4be4ec30)
    at /home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:146
#38 0x00007fe017aa3de1 in QtPrivate::Functor<KWin::WaylandServer::initScreenLocker()::$_15, 0>::call<QtPrivate::List<>, void>(KWin::WaylandServer::initScreenLocker()::$_15&, void*, void**) (f=..., arg=0x7fff4be4ec30)
    at /home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:256
#39 0x00007fe017aa3d8c in QtPrivate::QFunctorSlotObject<KWin::WaylandServer::initScreenLocker()::$_15, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)
    (which=1, this_=0x55f8e99f8ba0, r=0x55f8e8d00a10, a=0x7fff4be4ec30, ret=0x0) at /home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:443
#40 0x00007fe014417f06 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7fff4be4ec30, r=0x55f8e8d00a10, this=0x55f8e99f8ba0) at ../../include/QtCore/../../../../../devel/frameworks/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:398
#41 doActivate<false>(QObject*, int, void**) (sender=0x55f8e9a02420, signal_index=5, argv=0x7fff4be4ec30) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qobject.cpp:3886
#42 0x00007fe0164a5c0f in ScreenLocker::KSldApp::unlocked() (this=0x55f8e9a02420) at KScreenLocker_autogen/EWIEGA46WW/moc_ksldapp.cpp:218
#43 0x00007fe0164ab0e6 in ScreenLocker::KSldApp::doUnlock() (this=0x55f8e9a02420) at /home/apol/devel/frameworks/kscreenlocker/ksldapp.cpp:576
#44 0x00007fe0164a9165 in operator()(int, QProcess::ExitStatus) const (__closure=0x55f8e9a38dc0, exitCode=0, exitStatus=QProcess::NormalExit) at /home/apol/devel/frameworks/kscreenlocker/ksldapp.cpp:232
#45 0x00007fe0164ada59 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1>, QtPrivate::List<int, QProcess::ExitStatus>, void, ScreenLocker::KSldApp::initialize()::<lambda(int, QProcess::ExitStatus)> >::call(struct {...} &, void **) (f=..., arg=0x7fff4be4ef50)
--Type <RET> for more, q to quit, c to continue without paging--
    at /home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:146
#46 0x00007fe0164ad726 in QtPrivate::Functor<ScreenLocker::KSldApp::initialize()::<lambda(int, QProcess::ExitStatus)>, 2>::call<QtPrivate::List<int, QProcess::ExitStatus>, void>(struct {...} &, void *, void **) (f=..., arg=0x7fff4be4ef50)
    at /home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:256
#47 0x00007fe0164ad10f in QtPrivate::QFunctorSlotObject<ScreenLocker::KSldApp::initialize()::<lambda(int, QProcess::ExitStatus)>, 2, QtPrivate::List<int, QProcess::ExitStatus>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *)
    (which=1, this_=0x55f8e9a38db0, r=0x55f8e9a02420, a=0x7fff4be4ef50, ret=0x0) at /home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:443
#48 0x00007fe014417f06 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7fff4be4ef50, r=0x55f8e9a02420, this=0x55f8e9a38db0) at ../../include/QtCore/../../../../../devel/frameworks/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:398
#49 doActivate<false>(QObject*, int, void**) (sender=0x55f8e9a3a4b0, signal_index=11, argv=argv@entry=0x7fff4be4ef50) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qobject.cpp:3886
#50 0x00007fe014411260 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x55f8e9a3a4b0, m=m@entry=0x7fe0146ae720 <QProcess::staticMetaObject>, local_signal_index=local_signal_index@entry=2, argv=argv@entry=0x7fff4be4ef50)
    at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qobject.cpp:3946
#51 0x00007fe01434f9c8 in QProcess::finished(int, QProcess::ExitStatus) (this=this@entry=0x55f8e9a3a4b0, _t1=<optimized out>, _t2=<optimized out>) at .moc/moc_qprocess.cpp:339
#52 0x00007fe014355173 in QProcessPrivate::_q_processDied() (this=0x55f8e96a4e30) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/io/qprocess.cpp:1184
#53 0x00007fe01435529e in QProcess::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=0x7fff4be4f0e0) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/io/qprocess.h:318
#54 0x00007fe014417f40 in doActivate<false>(QObject*, int, void**) (sender=0x55f8ea72b190, signal_index=3, argv=argv@entry=0x7fff4be4f0e0) at ../../include/QtCore/../../../../../devel/frameworks/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:395
#55 0x00007fe014411260 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x55f8ea72b190, m=m@entry=0x7fe0146b0b00 <QSocketNotifier::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fff4be4f0e0)
    at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qobject.cpp:3946
#56 0x00007fe01441b33f in QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) (this=this@entry=0x55f8ea72b190, _t1=..., _t2=<optimized out>, _t3=...) at .moc/moc_qsocketnotifier.cpp:178
#57 0x00007fe01441bb3b in QSocketNotifier::event(QEvent*) (this=0x55f8ea72b190, e=0x7fff4be4f1f0) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qsocketnotifier.cpp:302
#58 0x00007fe014ef511f in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x55f8ea72b190, e=0x7fff4be4f1f0) at /home/apol/devel/frameworks/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3671
#59 0x00007fe0143e1a3a in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55f8ea72b190, event=0x7fff4be4f1f0) at ../../include/QtCore/5.15.0/QtCore/private/../../../../../../../../devel/frameworks/qt5/qtbase/src/corelib/thread/qthread_p.h:325
#60 0x00007fe0144361eb in QEventDispatcherUNIXPrivate::activateSocketNotifiers() (this=0x55f8e8d00d10) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qeventdispatcher_unix.cpp:304
#61 0x00007fe01443664b in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qeventdispatcher_unix.cpp:511
#62 0x00007fe00fa0828d in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...) at /home/apol/devel/frameworks/qt5/qtbase/src/platformsupport/eventdispatchers/qunixeventdispatcher.cpp:63
#63 0x00007fe0143e03fb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fff4be4f380, flags=..., flags@entry=...) at ../../include/QtCore/../../../../../devel/frameworks/qt5/qtbase/src/corelib/global/qflags.h:141
#64 0x00007fe0143e8660 in QCoreApplication::exec() () at ../../include/QtCore/../../../../../devel/frameworks/qt5/qtbase/src/corelib/global/qflags.h:121
#65 0x000055f8e8b2158f in main(int, char**) (argc=3, argv=0x7fff4be4fd58) at /home/apol/devel/frameworks/kwin/main_wayland.cpp:707
Edited by Aleix Pol Gonzalez

Merge request reports

Loading