Bug 198499 - plasma crash after right clicking on folderview applet
Summary: plasma crash after right clicking on folderview applet
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Plasma
Component: widget-folderview (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
: 195916 199659 199861 200122 203300 204204 207317 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-07-01 09:32 UTC by Sebastian Schwarzl
Modified: 2009-09-14 14:29 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Proposed patch (903 bytes, patch)
2009-08-10 22:03 UTC, Dario Andres
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Schwarzl 2009-07-01 09:32:33 UTC
Application that crashed: plasma-desktop
Version of the application: 0.3
KDE Version: 4.2.95 (KDE 4.2.95 (KDE 4.3 RC1)) "release 139"
Qt Version: 4.5.2
Operating System: Linux 2.6.27.23-0.1-default i686

 -- Backtrace:
Application: Plasma-Arbeitsfläche (kdeinit4), signal: Segmentation fault
[Current thread is 1 (Thread 0xb5fdc700 (LWP 18270))]

Thread 2 (Thread 0xa9059b90 (LWP 18273)):
#0  0xffffe430 in __kernel_vsyscall ()
#1  0xb7e5dc35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0xb7ebd582 in QWaitCondition::wait (this=0x82ecd70, mutex=0x82ecd6c, time=4294967295) at thread/qwaitcondition_unix.cpp:87
#3  0xb7735ad2 in QHostInfoAgent::run (this=0x82ecd60) at kernel/qhostinfo.cpp:260
#4  0xb7ebc572 in QThreadPrivate::start (arg=0x82ecd60) at thread/qthread_unix.cpp:188
#5  0xb7e5a1b5 in start_thread () from /lib/libpthread.so.0
#6  0xb66a33be in clone () from /lib/libc.so.6

Thread 1 (Thread 0xb5fdc700 (LWP 18270)):
[KCrash Handler]
#6  0xb78e0d09 in KFileItem::permissions (this=0xbef4ff0) at /usr/src/debug/kdelibs-4.2.95/kio/kio/kfileitem.cpp:1271
#7  0xb69d1abc in QWidget::event (this=0xbef4ff0, event=0xbfde0e80) at kernel/qwidget.cpp:7708
#8  0xb697a7fc in QApplicationPrivate::notify_helper (this=0x80a8f70, receiver=0xbef4ff0, e=0xbfde0e80) at kernel/qapplication.cpp:4056
#9  0xb698302d in QApplication::notify (this=0x80a2ca0, receiver=0xbef4ff0, e=0xbfde0e80) at kernel/qapplication.cpp:3845
#10 0xb746e10d in KApplication::notify (this=0x80a2ca0, receiver=0xbef4ff0, event=0xbfde0e80) at /usr/src/debug/kdelibs-4.2.95/kdeui/kernel/kapplication.cpp:302
#11 0xb7fb116b in QCoreApplication::notifyInternal (this=0x80a2ca0, receiver=0xbef4ff0, event=0xbfde0e80) at kernel/qcoreapplication.cpp:610
#12 0xb698593e in QCoreApplication::sendSpontaneousEvent (receiver=0xbef4ff0, event=0xbfde097c) at ../../src/corelib/kernel/qcoreapplication.h:216
#13 0xb69f2ecf in QETWidget::translateMouseEvent (this=0xbef4ff0, event=0xbfde24ec) at kernel/qapplication_x11.cpp:4413
#14 0xb69f1ab5 in QApplication::x11ProcessEvent (this=0x80a2ca0, event=0xbfde24ec) at kernel/qapplication_x11.cpp:3426
#15 0xb6a1b5ca in x11EventSourceDispatch (s=0x80ab958, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#16 0xb65209c8 in IA__g_main_context_dispatch (context=0x80ab098) at gmain.c:2144
#17 0xb6524083 in g_main_context_iterate (context=0x80ab098, block=1, dispatch=1, self=0x80a80b8) at gmain.c:2778
#18 0xb6524241 in IA__g_main_context_iteration (context=0x80ab098, may_block=1) at gmain.c:2841
#19 0xb7fdc8d8 in QEventDispatcherGlib::processEvents (this=0x80a65e0, flags={i = -1075960152}) at kernel/qeventdispatcher_glib.cpp:327
#20 0xb6a1acc5 in QGuiEventDispatcherGlib::processEvents (this=0x80a65e0, flags={i = -1075960104}) at kernel/qguieventdispatcher_glib.cpp:202
#21 0xb7faf78a in QEventLoop::processEvents (this=0xbfde2750, flags={i = -1075960040}) at kernel/qeventloop.cpp:149
#22 0xb7fafbd2 in QEventLoop::exec (this=0xbfde2750, flags={i = -1075959976}) at kernel/qeventloop.cpp:201
#23 0xb7fb2079 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:888
#24 0xb697a677 in QApplication::exec () at kernel/qapplication.cpp:3525
#25 0xb4a0b9f0 in kdemain (argc=1, argv=0x805ca58) at /usr/src/debug/kdebase-workspace-4.2.95/plasma/shells/desktop/main.cpp:50
#26 0x0804e2b0 in launch (argc=1, _name=0x808ad4c "/usr/bin/plasma-desktop", args=0x808ad64 "", cwd=0x0, envc=0, envs=0x808ad68 "", reset_env=false, tty=0x0, avoid_loops=false, 
    startup_id_str=0x8051389 "0") at /usr/src/debug/kdelibs-4.2.95/kinit/kinit.cpp:672
#27 0x0804ea8d in handle_launcher_request (sock=7, who=<value optimized out>) at /usr/src/debug/kdelibs-4.2.95/kinit/kinit.cpp:1164
#28 0x0804ef23 in handle_requests (waitForPid=0) at /usr/src/debug/kdelibs-4.2.95/kinit/kinit.cpp:1357
#29 0x0804fbca in main (argc=2, argv=0xbfde2f34, envp=0xbfde2f40) at /usr/src/debug/kdelibs-4.2.95/kinit/kinit.cpp:1784

This bug may be a duplicate of or related to bug 198368

Reported using DrKonqi
Comment 1 FiNeX 2009-07-01 10:24:18 UTC
It looks similar to bug 195916. But this has a better backtrace.
Comment 2 Beat Wolf 2009-07-02 10:43:03 UTC
*** Bug 195916 has been marked as a duplicate of this bug. ***
Comment 3 Dario Andres 2009-07-10 13:32:31 UTC
*** Bug 199659 has been marked as a duplicate of this bug. ***
Comment 4 Dario Andres 2009-07-13 14:51:13 UTC
*** Bug 199861 has been marked as a duplicate of this bug. ***
Comment 5 Dario Andres 2009-07-14 14:39:28 UTC
*** Bug 200122 has been marked as a duplicate of this bug. ***
Comment 6 Dario Andres 2009-07-14 14:40:04 UTC
Bug 200122 mentions another situation related with the folderview widget too.
Comment 7 Dario Andres 2009-08-10 21:56:01 UTC
Ok, I managed to reproduce this crash:

Some previous details: (so the bug is easier to reproduce)
- "Show confirmation for moving to trash" should be disabled
- FoldeView should point to "desktop:/" (Desktop folder using the desktop kio protocol)

Steps to reproduce:

- Open Plasma or "plasmoidviewer folderview".
- Create a folder "TEST"
- Select the folder "TEST"
- With the mouse near it, press "Del".

The selected folder should move to the trash (without confirmation GUI), but as it is a bit slow ("desktop:/" related?), you can quickly move the mouse cursor over the folder. 

The popupview for that folder should appear, and after some time the legend "the file or folder TEST does not exist" (with a red cross). 
- Right click on that Popup:

Plasma(or plasmoidviewer) should crash, as it is trying to check for the permissions of the root KFileItem (which was just deleted, so it will create a null KFileItem)

(if you can't reproduce, try with another new folder, moving the mouse and hovering the invalid folder quickly)

references:
void PopupView::contextMenuEvent(QContextMenuEvent *event)
    KFileItem rootItem = m_model->itemForIndex(QModelIndex());
    KFileItem item(rootItem.mode(), rootItem.permissions(), m_url);

A possible solution would be catch "IconView::itemsDeleted" (which shows the message "file/folder unexistant") and invalidate/close the popup, or avoid the crash on right click. (check for some "invalid root path")

I could reproduce the bug here using:

Qt: 4.5.2 (KDE-Qt git commit 5b7a2eb42acfdea07c6075556cb43e2c95852145
        Date:   Tue Jul 28 14:10:47 2009 -0300)
KDE: 4.3.63 (KDE 4.3.63 (KDE 4.4 >= 20090805))
kdelibs svn rev. 1009010 / kdebase svn rev. 1009010
on ArchLinux i686 - Kernel 2.6.30.4
Comment 8 Dario Andres 2009-08-10 21:56:54 UTC
*** Bug 203300 has been marked as a duplicate of this bug. ***
Comment 9 Dario Andres 2009-08-10 22:03:45 UTC
Created attachment 36055 [details]
Proposed patch
Comment 10 Dario Andres 2009-08-10 22:17:11 UTC
SVN commit 1009770 by darioandres:

Fixed for 4.4 by svn rev. 1009763
Backport to 4.3branch:

In some situation, the Popup of the folderview may be still showing an invalid(non-existant)
folder (case described on https://bugs.kde.org/show_bug.cgi?id=198499#c7)
Right-clicking the popup will crash Plasma as it is trying to read a field from an invalid
KFileItem)

- Add a check for KFileItem(rootItem)::isNull and avoid showing the menu in that case

BUG: 198499


 M  +6 -1      popupview.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1009770
Comment 11 Dario Andres 2009-08-17 22:37:07 UTC
*** Bug 204204 has been marked as a duplicate of this bug. ***
Comment 12 Dario Andres 2009-09-14 14:29:39 UTC
*** Bug 207317 has been marked as a duplicate of this bug. ***