Bug 262850 - Not-existing activity set as activity/activityId inside a [Containments] section in plasma-desktop-appletsrc crashes plasma-desktop on startup
Summary: Not-existing activity set as activity/activityId inside a [Containments] sect...
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-11 12:56 UTC by Elias Probst
Modified: 2011-01-18 07:17 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Crash when deleting the currently active activity (8.03 KB, text/plain)
2011-01-11 13:05 UTC, Elias Probst
Details
New crash information added by DrKonqi (8.22 KB, text/plain)
2011-01-17 16:15 UTC, S. Burmeister
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elias Probst 2011-01-11 12:56:27 UTC
Application: plasma-desktop (0.4)
KDE Platform Version: 4.5.95 (4.6 RC2)
Qt Version: 4.7.1
Operating System: Linux 2.6.37-rc8+ x86_64
Distribution (Platform): Gentoo Packages

-- Information about the crash:
- What I was doing when the application crashed:
1. Installed the 'Activity Manager Plasmoid' from
http://kde-apps.org/content/show.php/Activity+Manager+Plasmoid?content=136278
2. Added it to the panel
3. Opened the 'Activity Manager Plasmoid'
4. Clicked the + icon to add an activity
5. Clicked on the 'New Activity' to switch to it
6. plasma-desktop crashed and also continued to do so on each startup

It seems the 'Activity Manager Plasmoid' caused some problems when creating an activity.
Whether this problem is a Plasma bug (likely) or just a problem within the plasmoid itself still needs to be figured out.

The actual problem is, that the activity/activityId inside a [Containments] section of plasma-desktop-appletsrc isn't checked for existence when starting plasma-desktop.

This crash is easy to reproduce by doing this:

1. Stop plasma-desktop (kquitapp plasma-desktop)
2. Open ~/.kde4/share/config/plasma-desktop-appletsrc
3. Go to the section [Containments][100] (100 might be a different number for you)
4. Add these lines to this section:
activity=Foo Bar
activityId=ca94fbab-297f-4965-8648-d5f2d3807412
5. Start 'plasma-desktop'
6. plasma-desktop crashes

It needs to be made sure on plasma-desktop startup, that either the defined activity within a [Containments] section exists or is just ignored.

Furthermore there seems to be some code which crashes when changing the current activity to one which isn't properly created yet.
I'll try to provide further information about this when having investigated into the problem which initially revealed this bug.

DrKonqi reported some other bugs as possible duplicates, but as these all refer to this fix:
http://websvn.kde.org/trunk/KDE/kdebase/workspace/plasma/desktop/shell/activity.cpp?r1=1211307&r2=1211306&pathrev=1211307
which is already in 4.6 RC2 (4.5.95) the cause of this crash seems to be a different one.


The crash produces this backtrace.

The crash can be reproduced every time.

-- Backtrace:
Application: Plasma-Desktop-Umgebung (kdeinit4), signal: Segmentation fault
[Current thread is 1 (Thread 0x7fc6ce1c5760 (LWP 3095))]

Thread 2 (Thread 0x7fc6b2754710 (LWP 3097)):
#0  0x00007fc6cb8e9503 in __poll (fds=<value optimized out>, nfds=<value optimized out>, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007fc6c896a253 in g_main_context_poll (context=0x1073e80, block=<value optimized out>, dispatch=<value optimized out>, self=<value optimized out>) at gmain.c:3093
#2  g_main_context_iterate (context=0x1073e80, block=<value optimized out>, dispatch=<value optimized out>, self=<value optimized out>) at gmain.c:2775
#3  0x00007fc6c896a55e in g_main_context_iteration (context=0x1073e80, may_block=1) at gmain.c:2843
#4  0x00007fc6cce62a7a in QEventDispatcherGlib::processEvents (this=0xf0b760, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:417
#5  0x00007fc6cce39a32 in QEventLoop::processEvents (this=<value optimized out>, flags=) at kernel/qeventloop.cpp:149
#6  0x00007fc6cce39d91 in QEventLoop::exec (this=0x7fc6b2753de0, flags=) at kernel/qeventloop.cpp:201
#7  0x00007fc6ccd59f82 in QThread::exec (this=<value optimized out>) at thread/qthread.cpp:490
#8  0x00007fc6cce1c0ea in QInotifyFileSystemWatcherEngine::run (this=0x105daf0) at io/qfilesystemwatcher_inotify.cpp:248
#9  0x00007fc6ccd5ca08 in QThreadPrivate::start (arg=0x105daf0) at thread/qthread_unix.cpp:285
#10 0x00007fc6ccacf8b4 in start_thread (arg=<value optimized out>) at pthread_create.c:297
#11 0x00007fc6cb8f21dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 1 (Thread 0x7fc6ce1c5760 (LWP 3095)):
[KCrash Handler]
#6  Plasma::Containment::setScreen (this=0x0, newScreen=0, newDesktop=-1) at /var/tmp/portage/kde-base/kdelibs-4.5.95/work/kdelibs-4.5.95/plasma/containment.cpp:959
#7  0x00007fc6bd149920 in Activity::containmentForScreen (this=0x23ea4d0, screen=0, desktop=-1) at /var/tmp/portage/kde-base/plasma-workspace-4.5.95/work/plasma-workspace-4.5.95/plasma/desktop/shell/activity.cpp:191
#8  0x00007fc6bd149c43 in Activity::activateContainment (this=0x0, screen=0, desktop=-1) at /var/tmp/portage/kde-base/plasma-workspace-4.5.95/work/plasma-workspace-4.5.95/plasma/desktop/shell/activity.cpp:205
#9  0x00007fc6bd149cd2 in Activity::checkScreens (this=0x23ea4d0) at /var/tmp/portage/kde-base/plasma-workspace-4.5.95/work/plasma-workspace-4.5.95/plasma/desktop/shell/activity.cpp:235
#10 0x00007fc6bd149fb4 in Activity::opened (this=0x23ea4d0) at /var/tmp/portage/kde-base/plasma-workspace-4.5.95/work/plasma-workspace-4.5.95/plasma/desktop/shell/activity.cpp:404
#11 0x00007fc6bd14a230 in Activity::ensureActive (this=0x0) at /var/tmp/portage/kde-base/plasma-workspace-4.5.95/work/plasma-workspace-4.5.95/plasma/desktop/shell/activity.cpp:217
#12 0x00007fc6bd152d09 in DesktopCorona::currentActivityChanged (this=0x74bbf0, newActivity=...) at /var/tmp/portage/kde-base/plasma-workspace-4.5.95/work/plasma-workspace-4.5.95/plasma/desktop/shell/desktopcorona.cpp:664
#13 0x00007fc6bd155b32 in DesktopCorona::qt_metacall (this=0x74bbf0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fffe7438930) at /var/tmp/portage/kde-base/plasma-workspace-4.5.95/work/plasma-workspace-4.5.95_build/plasma/desktop/shell/desktopcorona.moc:122
#14 0x00007fc6cce50621 in QMetaObject::activate (sender=0x8e0b60, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x10eb2be) at kernel/qobject.cpp:3272
#15 0x00007fc6bcca9aca in KActivityConsumer::currentActivityChanged (this=0x0, _t1=<value optimized out>) at /var/tmp/portage/kde-base/libkworkspace-4.5.95/work/libkworkspace-4.5.95_build/libs/kworkspace/moc_kactivityconsumer.cpp:126
#16 0x00007fc6bcca9c95 in KActivityConsumer::qt_metacall (this=0x8e0b60, _c=QMetaObject::InvokeMetaMethod, _id=6342208, _a=0x7fffe7438b30) at /var/tmp/portage/kde-base/libkworkspace-4.5.95/work/libkworkspace-4.5.95_build/libs/kworkspace/moc_kactivityconsumer.cpp:87
#17 0x00007fc6bccb92a2 in KActivityController::qt_metacall (this=0x0, _c=QMetaObject::InvokeMetaMethod, _id=-1, _a=0x10eb2be) at /var/tmp/portage/kde-base/libkworkspace-4.5.95/work/libkworkspace-4.5.95_build/libs/kworkspace/kactivitycontroller.moc:88
#18 0x00007fc6cce50621 in QMetaObject::activate (sender=0x8e0cd0, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x10eb2be) at kernel/qobject.cpp:3272
#19 0x00007fc6bccc7485 in OrgKdeActivityManagerInterface::CurrentActivityChanged (this=0x0, _t1=<value optimized out>) at /var/tmp/portage/kde-base/libkworkspace-4.5.95/work/libkworkspace-4.5.95_build/libs/kworkspace/activitymanager_interface.moc:249
#20 0x00007fc6bccc79a1 in OrgKdeActivityManagerInterface::qt_metacall (this=0x8e0cd0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fffe74392a0) at /var/tmp/portage/kde-base/libkworkspace-4.5.95/work/libkworkspace-4.5.95_build/libs/kworkspace/activitymanager_interface.moc:145
#21 0x00007fc6bcca9ae5 in KActivityManager::qt_metacall (this=0x0, _c=QMetaObject::InvokeMetaMethod, _id=-1, _a=0x10eb2be) at /var/tmp/portage/kde-base/libkworkspace-4.5.95/work/libkworkspace-4.5.95_build/libs/kworkspace/moc_kactivitymanager_p.cpp:75
#22 0x00007fc6c9d1e381 in QDBusConnectionPrivate::deliverCall (this=<value optimized out>, object=<value optimized out>, msg=<value optimized out>, metaTypes=..., slotIdx=<value optimized out>) at qdbusintegrator.cpp:919
#23 0x00007fc6c9d285ab in QDBusCallDeliveryEvent::placeMetaCall (this=0x60c640, object=0x0) at qdbusintegrator_p.h:103
#24 0x00007fc6cce4ad1a in QObject::event (this=0x8e0cd0, e=0x0) at kernel/qobject.cpp:1211
#25 0x00007fc6cc049745 in QApplicationPrivate::notify_helper (this=0x6f9830, receiver=0x8e0cd0, e=0x1edd810) at kernel/qapplication.cpp:4445
#26 0x00007fc6cc04e2e2 in QApplication::notify (this=0x6ef2d0, receiver=0x8e0cd0, e=0x1edd810) at kernel/qapplication.cpp:4324
#27 0x00007fc6cdbd8a1c in KApplication::notify (this=0x6ef2d0, receiver=0x8e0cd0, event=0x1edd810) at /var/tmp/portage/kde-base/kdelibs-4.5.95/work/kdelibs-4.5.95/kdeui/kernel/kapplication.cpp:311
#28 0x00007fc6cce3a9fe in QCoreApplication::notifyInternal (this=0x6ef2d0, receiver=0x8e0cd0, event=0x1edd810) at kernel/qcoreapplication.cpp:732
#29 0x00007fc6cce3d5c4 in sendEvent (receiver=0x0, event_type=<value optimized out>, data=0x610c00) at kernel/qcoreapplication.h:215
#30 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=<value optimized out>, data=0x610c00) at kernel/qcoreapplication.cpp:1373
#31 0x00007fc6cce62e3e in sendPostedEvents (s=0x6fcc00) at kernel/qcoreapplication.h:220
#32 postEventSourceDispatch (s=0x6fcc00) at kernel/qeventdispatcher_glib.cpp:277
#33 0x00007fc6c8966cda in g_main_dispatch (context=0x6fbdf0) at gmain.c:2149
#34 g_main_context_dispatch (context=0x6fbdf0) at gmain.c:2702
#35 0x00007fc6c896a3a1 in g_main_context_iterate (context=0x6fbdf0, block=<value optimized out>, dispatch=<value optimized out>, self=<value optimized out>) at gmain.c:2780
#36 0x00007fc6c896a55e in g_main_context_iteration (context=0x6fbdf0, may_block=1) at gmain.c:2843
#37 0x00007fc6cce62a42 in QEventDispatcherGlib::processEvents (this=0x6f9540, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:415
#38 0x00007fc6cc0ebaf2 in QGuiEventDispatcherGlib::processEvents (this=0x0, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#39 0x00007fc6cce39a32 in QEventLoop::processEvents (this=<value optimized out>, flags=) at kernel/qeventloop.cpp:149
#40 0x00007fc6cce39d91 in QEventLoop::exec (this=0x7fffe7439e90, flags=) at kernel/qeventloop.cpp:201
#41 0x00007fc6cce3d807 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1009
#42 0x00007fc6bd15d38e in kdemain (argc=<value optimized out>, argv=<value optimized out>) at /var/tmp/portage/kde-base/plasma-workspace-4.5.95/work/plasma-workspace-4.5.95/plasma/desktop/shell/main.cpp:118
#43 0x0000000000407a48 in launch (argc=1, _name=<value optimized out>, args=<value optimized out>, cwd=<value optimized out>, envc=0, envs=<value optimized out>, reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0x40adab "0") at /var/tmp/portage/kde-base/kdelibs-4.5.95/work/kdelibs-4.5.95/kinit/kinit.cpp:730
#44 0x0000000000408418 in handle_launcher_request (sock=8, who=<value optimized out>) at /var/tmp/portage/kde-base/kdelibs-4.5.95/work/kdelibs-4.5.95/kinit/kinit.cpp:1222
#45 0x0000000000408bb5 in handle_requests (waitForPid=0) at /var/tmp/portage/kde-base/kdelibs-4.5.95/work/kdelibs-4.5.95/kinit/kinit.cpp:1415
#46 0x00000000004097d7 in main (argc=4, argv=<value optimized out>, envp=<value optimized out>) at /var/tmp/portage/kde-base/kdelibs-4.5.95/work/kdelibs-4.5.95/kinit/kinit.cpp:1903

Possible duplicates by query: bug 262440, bug 262217, bug 261246, bug 261157, bug 261154.

Reported using DrKonqi
Comment 1 Elias Probst 2011-01-11 13:05:10 UTC
Created attachment 55859 [details]
Crash when deleting the currently active activity

plasma-desktop does also crash, when deleting the currently active activity using the 'Activity Manager Plasmoid'.
Backtrace attached.
Comment 2 Aaron J. Seigo 2011-01-11 20:19:52 UTC
SVN commit 1213830 by aseigo:

use Corona::contaimentForScreen always to avoid problems with locked setups
BUG:262850


 M  +23 -19    activity.cpp  
 M  +0 -1      activity.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1213830
Comment 3 Aaron J. Seigo 2011-01-11 20:30:38 UTC
SVN commit 1213834 by aseigo:

use Corona::contaimentForScreen always to avoid problems with locked setups
BUG:262850


 M  +23 -19    activity.cpp  
 M  +0 -1      activity.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1213834
Comment 4 Elias Probst 2011-01-11 22:53:31 UTC
Thanks a lot for fixing it that quick!
Comment 5 S. Burmeister 2011-01-17 16:15:54 UTC
Created attachment 56129 [details]
New crash information added by DrKonqi

plasma-desktop (0.4) on KDE Platform 4.5.95 (4.6 RC2) using Qt 4.7.1

- What I was doing when the application crashed:
Starting plasma crashed after updating from KDE 4.5.5 to 4.6 RC2 because plasma-desktop-appletsrc contained the following lines:

[Containments][1]
ActionPluginsSource=Global
activity=Unbenannt
activityId=The name org.kde.ActivityManager was not provided by any .service files

Don't ask me how it got there but removing the "The name org..." solves the issue, i.e. plasma starts.

-- Backtrace (Reduced):
#6  Plasma::Containment::setScreen (this=0x0, newScreen=0, newDesktop=-1) at /usr/src/debug/kdelibs-4.5.95/plasma/containment.cpp:959
#7  0x00007feba9734144 in Activity::containmentForScreen (this=0x951de0, screen=0, desktop=-1) at /usr/src/debug/kdebase-workspace-4.5.95/plasma/desktop/shell/activity.cpp:191
#8  0x00007feba97342e7 in Activity::activateContainment (this=<value optimized out>, screen=0, desktop=-1) at /usr/src/debug/kdebase-workspace-4.5.95/plasma/desktop/shell/activity.cpp:205
#9  0x00007feba97343a4 in Activity::checkScreens (this=0x951de0) at /usr/src/debug/kdebase-workspace-4.5.95/plasma/desktop/shell/activity.cpp:235
#10 0x00007feba973469f in Activity::opened (this=0x951de0) at /usr/src/debug/kdebase-workspace-4.5.95/plasma/desktop/shell/activity.cpp:404
Comment 6 Elias Probst 2011-01-18 00:34:37 UTC
> activityId=The name org.kde.ActivityManager was not provided by any .service
> files
> 
> Don't ask me how it got there but removing the "The name org..." solves the
> issue, i.e. plasma starts.

What kind of activity related applets/panels do you use? Only the builtin activity manager panel or also a 3rd party activity manager?

It looks like the activity manager doesn't check whether org.kde.ActivityManager actually runs before using the output from acquiring the current activity name and putting it into the config.

So in the case org.kde.ActivityManager has crashed only the error message is returned but still used as return value and so set as activity name.

Would be interesting to find out which activity manager causes this.

@Chani: Added you as CC - could you check your builtin activity manager whether this probably happens there?
Comment 7 S. Burmeister 2011-01-18 06:45:39 UTC
(In reply to comment #6)
> What kind of activity related applets/panels do you use? Only the builtin
> activity manager panel or also a 3rd party activity manager?

I only use the activity changing plasmoid that comes with KDE. No 3rd party plasmoid.
Comment 8 Aaron J. Seigo 2011-01-18 07:12:19 UTC
"Don't ask me how it got there but removing the "The name org..." solves the
issue, i.e. plasma starts."

broken installation. KActivity* seems to be protected against this from happening now, though (it checks all replies so no errors get through like this)

"I only use the activity changing plasmoid that comes with KDE. No 3rd party
plasmoid."

the one called "activity bar"?
Comment 9 S. Burmeister 2011-01-18 07:17:27 UTC
In German it's called "Aktivitätsleiste" which is the literal translation of activity bar, so I would say I am using exactly that one.