Plasma crashes on an X11-display without RENDER extension ( fix included )

Bug #397374 reported by Christian Linhart
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KDE Base
Fix Released
High
kdebase-workspace (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

On Kubuntu-9.04, "plasma" crashes when starting it on an X11-display which does not support the RENDER extension ( such as the nested desktop in DemoRecorder, or maybe also Xnest ).

The source package containing this problem is kdebase-workspace_4.2.2-0ubuntu2

Here is the fix as a diff:
=============================================
--- kdebase-workspace-4.2.2-before-patch-by-clinhart/plasma/applets/systemtray/protocols/fdo/fdoselectionmanager.cpp 2009-01-06 18:22:29.000000000 +0100
+++ kdebase-workspace-4.2.2-0ubuntu2patch-from-demorec/plasma/applets/systemtray/protocols/fdo/fdoselectionmanager.cpp 2009-06-26 07:22:40.000000000 +0200
@@ -274,7 +274,8 @@
                                       &templ, &nvi);
     for (int i = 0; i < nvi; i++) {
         XRenderPictFormat *format = XRenderFindVisualFormat(d->display, xvi[i].visual);
- if (format->type == PictTypeDirect && format->direct.alphaMask) {
+ //patch by clinhart 20090705 to avoid crash with X11-Displays without Render-extension
+ if (format && format->type == PictTypeDirect && format->direct.alphaMask) {
             visual = xvi[i].visualid;
             break;
         }
=============================================

The problem is that "format" is a NULL-ptr when there is no RENDER extension.
I have added a NULL-ptr check before it is dereferenced, therefore fixing the crash.

Here's the backtrace:
=============================================
[KCrash Handler]
#6 SystemTray::FdoSelectionManager::initSelection (this=0xa074320) at /build/buildd/kdebase-workspace-4.2.2/plasma/applets/systemtray/protocols/fdo/fdoselectionmanager.cpp:277
#7 0xa983c5cb in SystemTray::FdoSelectionManager::qt_metacall (this=0xa074320, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0xbfe79218)
    at /build/buildd/kdebase-workspace-4.2.2/obj-i486-linux-gnu/plasma/applets/systemtray/moc_fdoselectionmanager.cpp:79
#8 0xb66a7ca8 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#9 0xb66a8932 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#10 0xb66ad0a7 in ?? () from /usr/lib/libQtCore.so.4
#11 0xb66ad1cc in ?? () from /usr/lib/libQtCore.so.4
#12 0xb66a215f in QObject::event () from /usr/lib/libQtCore.so.4
#13 0xb693ef2c in QApplicationPrivate::notify_helper () from /usr/lib/libQtGui.so.4
#14 0xb694722e in QApplication::notify () from /usr/lib/libQtGui.so.4
#15 0xb779794d in KApplication::notify () from /usr/lib/libkdeui.so.5
#16 0xb6691a3b in QCoreApplication::notifyInternal () from /usr/lib/libQtCore.so.4
#17 0xb66c0d71 in ?? () from /usr/lib/libQtCore.so.4
#18 0xb66bd4e0 in ?? () from /usr/lib/libQtCore.so.4
#19 0xb4ff4b88 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#20 0xb4ff80eb in ?? () from /usr/lib/libglib-2.0.so.0
#21 0xb4ff8268 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#22 0xb66bd438 in QEventDispatcherGlib::processEvents () from /usr/lib/libQtCore.so.4
#23 0xb69e03f5 in ?? () from /usr/lib/libQtGui.so.4
#24 0xb669006a in QEventLoop::processEvents () from /usr/lib/libQtCore.so.4
#25 0xb66904aa in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#26 0xb6692959 in QCoreApplication::exec () from /usr/lib/libQtCore.so.4
#27 0xb693eda7 in QApplication::exec () from /usr/lib/libQtGui.so.4
#28 0xb800db56 in kdemain (argc=1, argv=0xbfe79a74) at /build/buildd/kdebase-workspace-4.2.2/plasma/shells/desktop/main.cpp:54
#29 0x08048712 in main (argc=) at /build/buildd/kdebase-workspace-4.2.2/obj-i486-linux-gnu/plasma/shells/desktop/plasma_qgv_dummy.cpp:3
=============================================

If you have any questions regarding this please tell me and I'll be glad to answer them.

If you need to test it with DemoRecorder, you simply can download it from
http://demorecorder.com/download/download_trial_links.php?nn=1
(just install. No license needed for the reproduction tests...
"plasma" is automatically started when you start "demorec" )
I can also do the testing for you, once you have integrated the fix...

Best regards,

Chris

Revision history for this message
Rich Johnson (nixternal) wrote :

Filed this report upstream. Thanks!

Changed in kdebase-workspace (Ubuntu):
status: New → Incomplete
Revision history for this message
Jonathan Thomas (echidnaman) wrote :

Patch included upstream. We should try to get this in for 9.10.

Changed in kdebase-workspace (Ubuntu):
importance: Undecided → Low
status: Incomplete → In Progress
Changed in kdebase-workspace (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package kdebase-workspace - 4:4.3.2-0ubuntu4

---------------
kdebase-workspace (4:4.3.2-0ubuntu4) karmic; urgency=low

  * Add kubuntu_100_fix_systray_crash_without_render.diff from upstream
    to fix a plasma crash when the XRENDER extension is unavailable. Can be
    dropped in KDE 4.4. (B.K.O. #209271, LP: #397374)

 -- Jonathan Thomas <email address hidden> Wed, 14 Oct 2009 22:50:36 -0400

Changed in kdebase-workspace (Ubuntu):
status: Fix Committed → Fix Released
Changed in kdebase:
status: Unknown → Fix Released
Changed in kdebase:
importance: Unknown → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.