Change in plasma-framework[master]: Fix segfault in KWin when all screens disappear

Jan Kundrát (Code Review) noreply at kde.org
Wed Mar 11 17:23:11 UTC 2015


Jan Kundrát has uploaded a new change for review.

  https://gerrit.vesnicky.cesnet.cz/r/415

Change subject: Fix segfault in KWin when all screens disappear
......................................................................

Fix segfault in KWin when all screens disappear

This is due to changes in Qt 5.5; they now attempt to gracefully handle
a situation where all screens disappear, e.g., when user disables all
outputs via xrandr. Without this patch (and with [1] and [2] in place),
here's how KWin ended up:

 #0  xcb_send_request (c=0x0, flags=flags at entry=0, vector=vector at entry=0x7ffce7a537d0, req=req at entry=0x7f3d1c55bb60 <xcb_req>)
     at /var/tmp/portage/x11-libs/libxcb-1.11-r1/work/libxcb-1.11/src/xcb_out.c:187
 #1  0x00007f3d1c54f29f in xcb_list_properties_unchecked (c=<optimized out>, window=<optimized out>) at xproto.c:2650
 #2  0x00007f3d1a18285d in Plasma::EffectWatcher::isEffectActive (this=this at entry=0x7f3d1f1be290)
     at /var/tmp/portage/kde-frameworks/plasma-5.7.0/work/plasma-framework-5.7.0/src/plasma/private/effectwatcher.cpp:91
 #3  0x00007f3d1a1829a9 in isEffectActive (this=0x7f3d1f1be290) at /var/tmp/portage/kde-frameworks/plasma-5.7.0/work/plasma-framework-5.7.0/src/plasma/private/effectwatcher.cpp:79
 #4  Plasma::EffectWatcher::nativeEventFilter (this=0x7f3d1f1be290, eventType=..., message=0x7f3d04005160, result=<optimized out>)
     at /var/tmp/portage/kde-frameworks/plasma-5.7.0/work/plasma-framework-5.7.0/src/plasma/private/effectwatcher.cpp:76
 #5  0x00007f3d1ca3aa8a in QAbstractEventDispatcher::filterNativeEvent (this=<optimized out>, eventType=..., message=message at entry=0x7f3d04005160, result=result at entry=0x7ffce7a538e8)
     at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qabstracteventdispatcher.cpp:460
 #6  0x00007f3d0c6d6951 in QXcbConnection::handleXcbEvent (this=this at entry=0x7f3d1f13c5a0, event=event at entry=0x7f3d04005160)
     at /var/tmp/portage/dev-qt/qtgui-5.5.9999/work/qtgui-5.5.9999/src/plugins/platforms/xcb/qxcbconnection.cpp:971
 #7  0x00007f3d0c6d89b3 in QXcbConnection::processXcbEvents (this=0x7f3d1f13c5a0) at /var/tmp/portage/dev-qt/qtgui-5.5.9999/work/qtgui-5.5.9999/src/plugins/platforms/xcb/qxcbconnection.cpp:1376
 #8  0x00007f3d1ca77c86 in QObject::event (this=0x7f3d1f13c5a0, e=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qobject.cpp:1246
 #9  0x00007f3d1d391ddc in QApplicationPrivate::notify_helper (this=this at entry=0x7f3d1f135000, receiver=receiver at entry=0x7f3d1f13c5a0, e=e at entry=0x7f3d040051d0)
     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qapplication.cpp:3716
 #10 0x00007f3d1d3977ba in QApplication::notify (this=0x7ffce7a540b0, receiver=0x7f3d1f13c5a0, e=0x7f3d040051d0)
     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qapplication.cpp:3499
 #11 0x00007f3d1ca3e9cd in QCoreApplication::notifyInternal (this=0x7ffce7a540b0, receiver=0x7f3d1f13c5a0, event=event at entry=0x7f3d040051d0)
     at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.cpp:963
 #12 0x00007f3d1ca4142b in sendEvent (event=0x7f3d040051d0, receiver=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.h:228
 #13 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver at entry=0x0, event_type=event_type at entry=0, data=0x7f3d1f126340)
     at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.cpp:1580
 #14 0x00007f3d1caa343a in QEventDispatcherUNIX::processEvents (this=0x7f3d1f15ea90, flags=flags at entry=...)
     at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qeventdispatcher_unix.cpp:579
 #15 0x00007f3d0c7160a0 in QUnixEventDispatcherQPA::processEvents (this=<optimized out>, flags=...)
     at /var/tmp/portage/dev-qt/qtgui-5.5.9999/work/qtgui-5.5.9999/src/platformsupport/eventdispatchers/qunixeventdispatcher.cpp:62
 #16 0x00007f3d1ca3be4b in QEventLoop::exec (this=this at entry=0x7ffce7a53fa0, flags=..., flags at entry=...)
     at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qeventloop.cpp:204
 #17 0x00007f3d1ca4521e in QCoreApplication::exec () at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.cpp:1216
 #18 0x00007f3d1cd90a0a in QGuiApplication::exec () at /var/tmp/portage/dev-qt/qtgui-5.5.9999/work/qtgui-5.5.9999/src/gui/kernel/qguiapplication.cpp:1522
 #19 0x00007f3d1d38db8b in QApplication::exec () at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qapplication.cpp:2976
 #20 0x00007f3d1e5c4bcf in kdemain (argc=2, argv=0x7ffce7a54208) at /var/tmp/portage/kde-plasma/kwin-5.2.9999/work/kwin-5.2.9999/main_x11.cpp:294
 #21 0x00007f3d1e23f9f5 in __libc_start_main (main=0x7f3d1e9eb9a0 <main(int, char**)>, argc=2, argv=0x7ffce7a54208, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>,
     stack_end=0x7ffce7a541f8) at libc-start.c:292
 #22 0x00007f3d1e9eba09 in _start ()

[1] https://codereview.qt-project.org/108329/
[2] https://git.reviewboard.kde.org/r/122908/

Change-Id: Id7fcb1c2138d604b2e6291dda4db9855548de2ec
---
M src/plasma/private/effectwatcher.cpp
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.vesnicky.cesnet.cz:29418/plasma-framework refs/changes/15/415/1

diff --git a/src/plasma/private/effectwatcher.cpp b/src/plasma/private/effectwatcher.cpp
index 25b48e2..179e626 100644
--- a/src/plasma/private/effectwatcher.cpp
+++ b/src/plasma/private/effectwatcher.cpp
@@ -88,6 +88,9 @@
         return false;
     }
     xcb_connection_t *c = QX11Info::connection();
+    if (!c) {
+        return false;
+    }
     xcb_list_properties_cookie_t propsCookie = xcb_list_properties_unchecked(c, QX11Info::appRootWindow());
     QScopedPointer<xcb_list_properties_reply_t, QScopedPointerPodDeleter> props(xcb_list_properties_reply(c, propsCookie, nullptr));
     if (props.isNull()) {

-- 
To view, visit https://gerrit.vesnicky.cesnet.cz/r/415
To unsubscribe, visit https://gerrit.vesnicky.cesnet.cz/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7fcb1c2138d604b2e6291dda4db9855548de2ec
Gerrit-PatchSet: 1
Gerrit-Project: plasma-framework
Gerrit-Branch: master
Gerrit-Owner: Jan Kundrát <jkt at kde.org>


More information about the Plasma-devel mailing list