Bug 281035

Summary: Plasma desktop crash on startup (in TaskManager::isOnTop)
Product: [Plasma] plasma4 Reporter: Jonathan Verner <jonathan.verner>
Component: widget-taskbarAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: asraniel, gioloi72, kai, piotrekw1
Priority: NOR    
Version: 4.9.2   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: New crash information added by DrKonqi

Description Jonathan Verner 2011-08-30 08:11:31 UTC
Application: plasma-desktop (0.4)
KDE Platform Version: 4.7.00 (4.7.0)
Qt Version: 4.7.2
Operating System: Linux 2.6.38-11-generic i686
Distribution: Ubuntu 11.04

-- Information about the crash:
- What I was doing when the application crashed:

After updating to KDE 4.7, plasma desktop suddenly started
crashing on startup. It happens consistently on every start.

The crash can be reproduced every time.

-- Backtrace:
Application: Shell plochy Plasma (plasma-desktop), signal: Segmentation fault
[Current thread is 1 (Thread 0xb7877720 (LWP 2748))]

Thread 3 (Thread 0xb6814b70 (LWP 2751)):
#0  0x00d7c416 in __kernel_vsyscall ()
#1  0x02c7048c in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:169
#2  0x006d13fd in __pthread_cond_wait (cond=0x27942b0, mutex=0x2794298) at forward.c:139
#3  0x0267b817 in QTWTF::TCMalloc_PageHeap::scavengerThread (this=0x278f1c0) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2359
#4  0x0267b851 in QTWTF::TCMalloc_PageHeap::runScavengerThread (context=0x278f1c0) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1464
#5  0x02c6be99 in start_thread (arg=0xb6814b70) at pthread_create.c:304
#6  0x006c373e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 2 (Thread 0xb0900b70 (LWP 2866)):
#0  pthread_mutex_unlock (mutex=0x8ff862c) at forward.c:184
#1  0x067cdfc2 in g_main_context_prepare () from /lib/i386-linux-gnu/libglib-2.0.so.0
#2  0x067cee63 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#3  0x067cf524 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#4  0x049cf577 in QEventDispatcherGlib::processEvents (this=0x8fca550, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#5  0x049a1289 in QEventLoop::processEvents (this=0xb0900280, flags=...) at kernel/qeventloop.cpp:149
#6  0x049a1522 in QEventLoop::exec (this=0xb0900280, flags=...) at kernel/qeventloop.cpp:201
#7  0x048ab2a0 in QThread::exec (this=0x8fcaae8) at thread/qthread.cpp:492
#8  0x04982fdb in QInotifyFileSystemWatcherEngine::run (this=0x8fcaae8) at io/qfilesystemwatcher_inotify.cpp:248
#9  0x048adda2 in QThreadPrivate::start (arg=0x8fcaae8) at thread/qthread_unix.cpp:320
#10 0x02c6be99 in start_thread (arg=0xb0900b70) at pthread_create.c:304
#11 0x006c373e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 1 (Thread 0xb7877720 (LWP 2748)):
[KCrash Handler]
#7  0x043a53d7 in value (this=0x8cbec58, task=0x8f05e30) at /usr/include/qt4/QtCore/qhash.h:607
#8  TaskManager::TaskManager::isOnTop (this=0x8cbec58, task=0x8f05e30) at ../../../libs/taskmanager/taskmanager.cpp:528
#9  0x04397456 in TaskManager::Task::isOnTop (this=0x8f05e30) at ../../../libs/taskmanager/task.cpp:226
#10 0x07946586 in TaskSource::updateTask (this=0x8d91b88, taskChanges=...) at ../../../../../plasma/generic/dataengines/tasks/tasksource.cpp:96
#11 0x079476d4 in TaskSource::TaskSource (this=0x8d91b88, task=..., parent=0x8d91f90) at ../../../../../plasma/generic/dataengines/tasks/tasksource.cpp:48
#12 0x0794445e in TasksEngine::addTask (this=0x8d91f90, task=...) at ../../../../../plasma/generic/dataengines/tasks/tasksengine.cpp:107
#13 0x0794454b in TasksEngine::taskAdded (this=0x8d91f90, task=...) at ../../../../../plasma/generic/dataengines/tasks/tasksengine.cpp:89
#14 0x07944610 in TasksEngine::qt_metacall (this=0x8d91f90, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0xbfefc6c8) at ./tasksengine.moc:81
#15 0x049a86ba in QMetaObject::metacall (object=0x8d91f90, cl=QMetaObject::InvokeMetaMethod, idx=26, argv=0xbfefc6c8) at kernel/qmetaobject.cpp:237
#16 0x049b84ff in QMetaObject::activate (sender=0x8cbec58, m=0x43b2ccc, local_signal_index=0, argv=0xbfefc6c8) at kernel/qobject.cpp:3287
#17 0x043a5123 in TaskManager::TaskManager::taskAdded (this=0x8cbec58, _t1=...) at ./taskmanager.moc:172
#18 0x043a61a8 in TaskManager::TaskManager::windowAdded (this=0x8cbec58, w=14680386) at ../../../libs/taskmanager/taskmanager.cpp:299
#19 0x043a6c8f in TaskManager::TaskManager::qt_metacall (this=0x8cbec58, _c=QMetaObject::InvokeMetaMethod, _id=7, _a=0xbfefc8c8) at ./taskmanager.moc:123
#20 0x049a86ba in QMetaObject::metacall (object=0x8cbec58, cl=QMetaObject::InvokeMetaMethod, idx=11, argv=0xbfefc8c8) at kernel/qmetaobject.cpp:237
#21 0x049b84ff in QMetaObject::activate (sender=0x872db80, m=0x1187fcc, local_signal_index=1, argv=0xbfefc8c8) at kernel/qobject.cpp:3287
#22 0x011104f3 in KWindowSystem::windowAdded (this=0x872db80, _t1=14680386) at ./kwindowsystem.moc:126
#23 0x01111506 in KWindowSystemPrivate::addClient (this=0x8857948, w=14680386) at ../../kdeui/windowmanagement/kwindowsystem_x11.cpp:233
#24 0x01120537 in NETRootInfo::update (this=0x885795c, dirty_props=0xbfefca7c) at ../../kdeui/windowmanagement/netwm.cpp:2227
#25 0x011210a6 in NETRootInfo::event (this=0x885795c, event=0xbfefcc5c, properties=0xbfefcb04, properties_size=5) at ../../kdeui/windowmanagement/netwm.cpp:2099
#26 0x01112fb9 in KWindowSystemPrivate::x11Event (this=0x8857948, ev=0xbfefcc5c) at ../../kdeui/windowmanagement/kwindowsystem_x11.cpp:136
#27 0x00fe6bb2 in publicX11Event (this=0x87432c8, message=0xbfefcc5c) at ../../kdeui/kernel/ksystemeventfilter.cpp:43
#28 KSystemEventFilterPrivate::filterEvent (this=0x87432c8, message=0xbfefcc5c) at ../../kdeui/kernel/ksystemeventfilter.cpp:102
#29 0x00fe6c26 in _k_eventFilter (message=0xbfefcc5c) at ../../kdeui/kernel/ksystemeventfilter.cpp:91
#30 0x0499427d in QAbstractEventDispatcher::filterEvent (this=0x86970a8, message=0xbfefcc5c) at kernel/qabstracteventdispatcher.cpp:501
#31 0x03420511 in x11EventSourceDispatch (s=0x8730840, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:143
#32 0x067ceaa8 in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
#33 0x067cf270 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#34 0x067cf524 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#35 0x049cf53c in QEventDispatcherGlib::processEvents (this=0x86970a8, flags=...) at kernel/qeventdispatcher_glib.cpp:422
#36 0x034201e5 in QGuiEventDispatcherGlib::processEvents (this=0x86970a8, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#37 0x049a1289 in QEventLoop::processEvents (this=0xbfefcf24, flags=...) at kernel/qeventloop.cpp:149
#38 0x049a1522 in QEventLoop::exec (this=0xbfefcf24, flags=...) at kernel/qeventloop.cpp:201
#39 0x049a5ecc in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1008
#40 0x033678e7 in QApplication::exec () at kernel/qapplication.cpp:3736
#41 0x00af0fdb in kdemain (argc=1, argv=0xbfefd144) at ../../../../plasma/desktop/shell/main.cpp:120
#42 0x080485bb in main (argc=1, argv=0xbfefd144) at plasma-desktop_dummy.cpp:3

Reported using DrKonqi
Comment 1 Jonathan Verner 2011-08-30 08:25:39 UTC
Bug might be related 276877, however the function where the crash happens is different.
Comment 2 Jonathan Verner 2011-12-05 10:18:33 UTC
Thanks for the fix!!
Comment 3 Myriam Schweingruber 2012-11-04 10:01:39 UTC
*** Bug 308917 has been marked as a duplicate of this bug. ***
Comment 4 Myriam Schweingruber 2012-11-04 10:02:33 UTC
Reopening as this is reproducible with KDE 4.9.2
Comment 5 Kai Krakow 2013-03-24 21:17:59 UTC
Created attachment 78353 [details]
New crash information added by DrKonqi

plasma-desktop (0.4) on KDE Platform 4.9.5 using Qt 4.8.4

- What I was doing when the application crashed:

plasma-desktop sometimes crashes when I log into my system.

-- Backtrace (Reduced):
#6  QHash<unsigned long, TaskManager::Task*>::findNode (this=0x2618b90, akey=@0x60bff8: <error reading variable>, ahp=0x0) at /usr/include/qt4/QtCore/qhash.h:882
#7  0x00007f70260ac371 in value (akey=@0x60bff8: <error reading variable>, this=0x2618b90) at /usr/include/qt4/QtCore/qhash.h:609
#8  TaskManager::TaskManager::isOnTop (this=0x261f680, task=0x303c5b0) at /var/tmp/portage/kde-base/libtaskmanager-4.9.5/work/libtaskmanager-4.9.5/libs/taskmanager/taskmanager.cpp:482
#9  0x00007f6f8f3c20bf in TaskSource::updateTask (this=0x2511de0, taskChanges=...) at /var/tmp/portage/kde-base/plasma-workspace-4.9.5/work/plasma-workspace-4.9.5/plasma/generic/dataengines/tasks/tasksource.cpp:97
#10 0x00007f6f8f3c3215 in TaskSource::TaskSource (this=0x2511de0, task=0x303c5b0, parent=<optimized out>) at /var/tmp/portage/kde-base/plasma-workspace-4.9.5/work/plasma-workspace-4.9.5/plasma/generic/dataengines/tasks/tasksource.cpp:44
Comment 6 Jekyll Wu 2013-05-18 02:10:38 UTC
*** Bug 319795 has been marked as a duplicate of this bug. ***
Comment 7 Aaron J. Seigo 2013-06-15 19:31:38 UTC
Git commit 11fd0f2c09dac9bd6cc559041eeeaa98553ebc4d by Aaron Seigo.
Committed on 15/06/2013 at 21:30.
Pushed by aseigo into branch 'master'.

don't crash when the list is empty

the do/while construct would die on an empty list. in theory this
shouldn't happen because we are asking with a Task pointer which
should only exist if there are, well, windows. however, due to the
async nature of windowing systems, during the time of the call all
of this can change.

M  +17   -14   libs/taskmanager/taskmanager.cpp

http://commits.kde.org/kde-workspace/11fd0f2c09dac9bd6cc559041eeeaa98553ebc4d