Bug 306459

Summary: Dolphin crashes when I make 2-panel view and clicking into another panel
Product: [Applications] dolphin Reporter: Sergo <sergo>
Component: split viewAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: evrics, kevin.reffitt, mongolie2006-kde
Priority: NOR Keywords: investigated
Version: 2.1   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 4.9.3
Sentry Crash Report:
Attachments: crash-report1
crash-report2
screenshot of the Dolphin's window just before craching
new crash log

Description Sergo 2012-09-08 16:35:56 UTC
Application: dolphin (2.1)
KDE Platform Version: 4.9.1 "release 561"
Qt Version: 4.8.2
Operating System: Linux 3.4.6-2.10-desktop x86_64
Distribution: "openSUSE 12.2 (x86_64)"

-- Information about the crash:
- What I was doing when the application crashed:
1. Open Dolphin.
2. Settintgs -> Configure Dolphin.
3. Mark Split view mode, Ok.
4. Click into not-active panel or on the name of disk.

- Custom settings of the application:
split view mode enabled.

After next running dolphin this bug not appears. The bug appears only while enabling split mode view and clicking in this instance of Dolphin.

OpenSUSE 12.2, KDE from unstable repository KDE 4.9.1 (http://download.opensuse.org/repositories/KDE:/Release:/49/openSUSE_12.2/).

-- Backtrace:
Application: Dolphin (kdeinit4), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f99acc32780 (LWP 13225))]

Thread 2 (Thread 0x7f9992659700 (LWP 13228)):
#0  0x00007f99aa26b13f in poll () from /lib64/libc.so.6
#1  0x00007f99a6fb76d4 in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f99a6fb77f4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f99ab8b83f6 in QEventDispatcherGlib::processEvents (this=0x7f998c0008f0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007f99ab888ebf in QEventLoop::processEvents (this=this@entry=0x7f9992658d30, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f99ab889148 in QEventLoop::exec (this=0x7f9992658d30, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f99ab78cef0 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#7  0x00007f99ab86989f in QInotifyFileSystemWatcherEngine::run (this=0x21be990) at io/qfilesystemwatcher_inotify.cpp:248
#8  0x00007f99ab78fe8b in QThreadPrivate::start (arg=0x21be990) at thread/qthread_unix.cpp:307
#9  0x00007f999c960734 in ?? () from /usr/X11R6/lib64/libGL.so.1
#10 0x00007f99ab4f9e0e in start_thread () from /lib64/libpthread.so.0
#11 0x00007f99aa2732bd in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f99acc32780 (LWP 13225)):
[KCrash Handler]
#6  0x00007f99ab89e71b in QMetaObject::changeGuard (ptr=0x2897670, o=0x2068690) at kernel/qobject.cpp:446
#7  0x00007f99a4b80729 in KIO::JobUiDelegate::setWindow (this=<optimized out>, window=0x2068690) at /usr/src/debug/kdelibs-4.9.1/kio/kio/jobuidelegate.cpp:57
#8  0x00007f99a4b943b5 in KDirListerCache::listDir (this=0x21d21e0, lister=0x281c140, _u=..., _keep=<optimized out>, _reload=false) at /usr/src/debug/kdelibs-4.9.1/kio/kio/kdirlister.cpp:223
#9  0x00007f999797943b in KFileItemModel::loadDirectory (this=<optimized out>, url=...) at /usr/src/debug/kde-baseapps-4.9.1/dolphin/src/kitemviews/kfileitemmodel.cpp:113
#10 0x00007f99979c1bd9 in DolphinView::loadDirectory (this=0x281b850, url=..., reload=false) at /usr/src/debug/kde-baseapps-4.9.1/dolphin/src/views/dolphinview.cpp:1344
#11 0x00007f99979c369c in DolphinView::setUrl (this=0x281b850, url=...) at /usr/src/debug/kde-baseapps-4.9.1/dolphin/src/views/dolphinview.cpp:599
#12 0x00007f9998151873 in DolphinViewContainer::slotItemActivated (this=0x27f8540, item=...) at /usr/src/debug/kde-baseapps-4.9.1/dolphin/src/dolphinviewcontainer.cpp:443
#13 0x00007f99981534e9 in qt_static_metacall (_a=<optimized out>, _id=<optimized out>, _o=<optimized out>, _c=<optimized out>) at /usr/src/debug/kde-baseapps-4.9.1/build/dolphin/src/dolphinviewcontainer.moc:113
#14 DolphinViewContainer::qt_static_metacall (_o=0x26902b0, _c=32, _id=33756992, _a=0x1f55e70) at /usr/src/debug/kde-baseapps-4.9.1/build/dolphin/src/dolphinviewcontainer.moc:96
#15 0x00007f99ab8a09ff in QMetaObject::activate (sender=0x281b850, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7ffff25b2840) at kernel/qobject.cpp:3556
#16 0x00007f99979c0fd5 in DolphinView::itemActivated (this=this@entry=0x281b850, _t1=...) at /usr/src/debug/kde-baseapps-4.9.1/build/dolphin/src/dolphinview.moc:337
#17 0x00007f99979c100d in DolphinView::slotItemActivated (this=0x281b850, index=<optimized out>) at /usr/src/debug/kde-baseapps-4.9.1/dolphin/src/views/dolphinview.cpp:755
#18 0x00007f99979c68f0 in qt_static_metacall (_a=<optimized out>, _id=<optimized out>, _o=<optimized out>, _c=<optimized out>) at /usr/src/debug/kde-baseapps-4.9.1/build/dolphin/src/dolphinview.moc:237
#19 DolphinView::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /usr/src/debug/kde-baseapps-4.9.1/build/dolphin/src/dolphinview.moc:187
#20 0x00007f99ab8a09ff in QMetaObject::activate (sender=0x281e5c0, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7ffff25b29e0) at kernel/qobject.cpp:3556
#21 0x00007f999799002e in KItemListController::itemActivated (this=this@entry=0x281e5c0, _t1=_t1@entry=5) at /usr/src/debug/kde-baseapps-4.9.1/build/dolphin/src/kitemlistcontroller.moc:203
#22 0x00007f9997991da5 in KItemListController::mouseReleaseEvent (this=0x281e5c0, event=0x7ffff25b3700, transform=...) at /usr/src/debug/kde-baseapps-4.9.1/dolphin/src/kitemviews/kitemlistcontroller.cpp:729
#23 0x00007f999798f3be in KItemListController::processEvent (this=0x281e5c0, event=0x20, event@entry=0x7ffff25b3700, transform=...) at /usr/src/debug/kde-baseapps-4.9.1/dolphin/src/kitemviews/kitemlistcontroller.cpp:953
#24 0x00007f9997996ceb in KItemListView::event (this=0x281cda0, event=0x7ffff25b3700) at /usr/src/debug/kde-baseapps-4.9.1/dolphin/src/kitemviews/kitemlistview.cpp:845
#25 0x00007f99aaa1964c in QApplicationPrivate::notify_helper (this=this@entry=0x1faedb0, receiver=receiver@entry=0x281cda0, e=e@entry=0x7ffff25b3700) at kernel/qapplication.cpp:4551
#26 0x00007f99aaa1daca in QApplication::notify (this=0x7ffff25b4cb0, receiver=0x281cda0, e=0x7ffff25b3700) at kernel/qapplication.cpp:4412
#27 0x00007f99ac6230d6 in KApplication::notify (this=0x7ffff25b4cb0, receiver=0x281cda0, event=0x7ffff25b3700) at /usr/src/debug/kdelibs-4.9.1/kdeui/kernel/kapplication.cpp:311
#28 0x00007f99ab88a16e in QCoreApplication::notifyInternal (this=0x7ffff25b4cb0, receiver=0x281cda0, event=0x7ffff25b3700) at kernel/qcoreapplication.cpp:915
#29 0x00007f99aaffdbdb in sendEvent (event=0x7ffff25b3700, item=0x281cdb0, this=<optimized out>) at graphicsview/qgraphicsscene.cpp:1217
#30 QGraphicsScenePrivate::sendEvent (this=<optimized out>, item=0x281cdb0, event=0x7ffff25b3700) at graphicsview/qgraphicsscene.cpp:1197
#31 0x00007f99aaffe7c0 in sendMouseEvent (mouseEvent=0x7ffff25b3700, this=0x2823cd0) at graphicsview/qgraphicsscene.cpp:1295
#32 QGraphicsScenePrivate::sendMouseEvent (this=0x2823cd0, mouseEvent=0x7ffff25b3700) at graphicsview/qgraphicsscene.cpp:1274
#33 0x00007f99aafff1b5 in QGraphicsScene::mouseReleaseEvent (this=<optimized out>, mouseEvent=0x7ffff25b3700) at graphicsview/qgraphicsscene.cpp:4128
#34 0x00007f99ab011f0c in QGraphicsScene::event (this=0x2823cb0, event=0x7ffff25b3700) at graphicsview/qgraphicsscene.cpp:3458
#35 0x00007f99aaa1964c in QApplicationPrivate::notify_helper (this=this@entry=0x1faedb0, receiver=receiver@entry=0x2823cb0, e=e@entry=0x7ffff25b3700) at kernel/qapplication.cpp:4551
#36 0x00007f99aaa1daca in QApplication::notify (this=0x7ffff25b4cb0, receiver=0x2823cb0, e=0x7ffff25b3700) at kernel/qapplication.cpp:4412
#37 0x00007f99ac6230d6 in KApplication::notify (this=0x7ffff25b4cb0, receiver=0x2823cb0, event=0x7ffff25b3700) at /usr/src/debug/kdelibs-4.9.1/kdeui/kernel/kapplication.cpp:311
#38 0x00007f99ab88a16e in QCoreApplication::notifyInternal (this=0x7ffff25b4cb0, receiver=0x2823cb0, event=0x7ffff25b3700) at kernel/qcoreapplication.cpp:915
#39 0x00007f99ab028211 in QGraphicsView::mouseReleaseEvent (this=0x21fe660, event=0x7ffff25b4030) at graphicsview/qgraphicsview.cpp:3338
#40 0x00007f99aaa68cb0 in QWidget::event (this=0x21fe660, event=0x7ffff25b4030) at kernel/qwidget.cpp:8371
#41 0x00007f99aae12e86 in QFrame::event (this=0x21fe660, e=0x7ffff25b4030) at widgets/qframe.cpp:557
#42 0x00007f99ab02b68b in QGraphicsView::viewportEvent (this=0x21fe660, event=0x7ffff25b4030) at graphicsview/qgraphicsview.cpp:2866
#43 0x00007f99ab88a2d6 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=<optimized out>, receiver=0x2842df0, event=0x7ffff25b4030) at kernel/qcoreapplication.cpp:1025
#44 0x00007f99aaa1961c in QApplicationPrivate::notify_helper (this=this@entry=0x1faedb0, receiver=receiver@entry=0x2842df0, e=e@entry=0x7ffff25b4030) at kernel/qapplication.cpp:4547
#45 0x00007f99aaa1e32b in QApplication::notify (this=<optimized out>, receiver=0x2842df0, e=0x7ffff25b4030) at kernel/qapplication.cpp:4094
#46 0x00007f99ac6230d6 in KApplication::notify (this=0x7ffff25b4cb0, receiver=0x2842df0, event=0x7ffff25b4030) at /usr/src/debug/kdelibs-4.9.1/kdeui/kernel/kapplication.cpp:311
#47 0x00007f99ab88a16e in QCoreApplication::notifyInternal (this=0x7ffff25b4cb0, receiver=0x2842df0, event=0x7ffff25b4030) at kernel/qcoreapplication.cpp:915
#48 0x00007f99aaa1a48b in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../src/corelib/kernel/qcoreapplication.h:231
#49 QApplicationPrivate::sendMouseEvent (receiver=0x2842df0, event=0x7ffff25b4030, alienWidget=0x2842df0, nativeWidget=0x22171a0, buttonDown=0x7f99ab4ee248 <qt_button_down>, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:3162
#50 0x00007f99aaa94ad4 in QETWidget::translateMouseEvent (this=this@entry=0x22171a0, event=event@entry=0x7ffff25b47a0) at kernel/qapplication_x11.cpp:4513
#51 0x00007f99aaa93861 in QApplication::x11ProcessEvent (this=0x7ffff25b4cb0, event=0x7ffff25b47a0) at kernel/qapplication_x11.cpp:3636
#52 0x00007f99aaab9b32 in x11EventSourceDispatch (s=0x1fb1590, callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#53 0x00007f99a6fb7405 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#54 0x00007f99a6fb7738 in ?? () from /usr/lib64/libglib-2.0.so.0
#55 0x00007f99a6fb77f4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#56 0x00007f99ab8b83d6 in QEventDispatcherGlib::processEvents (this=0x1e8d790, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#57 0x00007f99aaab97ae in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#58 0x00007f99ab888ebf in QEventLoop::processEvents (this=this@entry=0x7ffff25b4b70, flags=...) at kernel/qeventloop.cpp:149
#59 0x00007f99ab889148 in QEventLoop::exec (this=0x7ffff25b4b70, flags=...) at kernel/qeventloop.cpp:204
#60 0x00007f99ab88dde8 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1187
#61 0x00007f9998157b47 in kdemain (argc=5, argv=0x1f35410) at /usr/src/debug/kde-baseapps-4.9.1/dolphin/src/main.cpp:89
#62 0x0000000000408932 in _start ()

Reported using DrKonqi
Comment 1 Sergo 2012-09-08 16:38:17 UTC
Created attachment 73749 [details]
crash-report1
Comment 2 Sergo 2012-09-08 16:38:40 UTC
Created attachment 73750 [details]
crash-report2
Comment 3 Frank Reininghaus 2012-09-10 09:53:02 UTC
Thanks for the bug report! Unfortunately, I cannot reproduce the problem - maybe one needs some special settings to get the crash. Could you create a screenshot of the Dolphin window after enabling 'Split View' in the settings?
Comment 4 Sergo 2012-09-10 18:39:23 UTC
Created attachment 73795 [details]
screenshot of the Dolphin's window just before craching

Процесс: kdeinit4 PID: 5355 Сигнал завершения: Segmentation fault (11)
Comment 5 Sergo 2012-09-10 18:54:36 UTC
I changed the language of Dolphin's interface.
Bug is present today too:) After the posted above window appears I click into active half-window on the name of one of the folders and then click on on the folder in another half-view.
The bug appears again only when after making split-window-mode the single window mode restored and Dolphin is closed and opened again.
So try to make this procedure:
1. Сhange the language of Dolphin in English (to compare our actions) in Help menu, close Dolphin and open it again. The result is Dolphin with single-mode view.
2. Settings -> Configure Dolphin. Dolphin's Preferences dialog opened.
3. Check the Split view mode and press Ok.
4. Must be a Dolphin's window like I attached above.
5. Just click 1 time on the name of one folder in non-active half-window and right then on the name of another folder in active half-window.
Note: if you opens Dolphin in split-window-view and clicking on the folders crash is absent.
To repeat the bug you must restore single mode view and make all again.
Comment 6 Sergo 2012-09-10 19:01:35 UTC
Try to click on the folders with different names.
I click on the folder 'Downloads' and right after in on the folder 'public_html'. But another combination 'works' too:(
Comment 7 Sergo 2012-09-10 19:03:45 UTC
Created attachment 73796 [details]
new crash log
Comment 8 Frank Reininghaus 2012-09-11 05:27:12 UTC
Thanks for the detailed description, I can reproduce the crash now!
Comment 9 Frank Reininghaus 2012-09-11 10:26:53 UTC
I think that the problem is the line

m_dirLister->setMainWindow(qApp->activeWindow());

in KFileItemModel's constructor. When "Split View" is enabled in the settings dialog, a new view is created, and the KFileItemModel which belogs to this view makes the settings dialog the main window for the dir lister. When the settings dialog is closed, the pointer becomes dangling, and when the dir lister tries to dereference it, we get a crash.

Removing that line would fix the crash, but create other problems, so we have to think of something better.
Comment 10 Frank Reininghaus 2012-09-29 17:58:21 UTC
Git commit 4dc8ea34c26ba38f63a099dc0a82a74d6194d807 by Frank Reininghaus.
Committed on 29/09/2012 at 19:47.
Pushed by freininghaus into branch 'KDE/4.9'.

Find out the main window by calling the parent widget's window() member

KFileItemModel calls the dir lister's setMainWindow() method to make
sure that the dir lister caches authentication data. However, the method
used to determine the main window (qApp->activeWindow()) is not
guaranteed to yield the DolphinMainWindow or the KonqMainWindow. In
particular, if "Split View" is enabled in Dolphin's settings dialog, the
active window is the dialog, and when it is closed, any later access to
the stored pointer leads to a crash.

A better method is to verify that the model's parent is a QWidget and
then use this widget's window(). I had to make a small modification in
DolphinMainWindow to make sure that it also works correctly when the
view is split (the new view container had been created with a 0 parent
previously).

I tested it in Dolphin and Konqueror and verified that the "main window"
passed to the dir lister is really the application's main window.
FIXED-IN: 4.9.3

M  +7    -1    dolphin/src/dolphinmainwindow.cpp
M  +6    -1    dolphin/src/kitemviews/kfileitemmodel.cpp

http://commits.kde.org/kde-baseapps/4dc8ea34c26ba38f63a099dc0a82a74d6194d807
Comment 11 Frank Reininghaus 2012-10-24 08:49:56 UTC
*** Bug 308843 has been marked as a duplicate of this bug. ***
Comment 12 Frank Reininghaus 2012-11-29 14:37:33 UTC
*** Bug 310877 has been marked as a duplicate of this bug. ***
Comment 13 Jekyll Wu 2012-11-30 23:32:53 UTC
*** Bug 310952 has been marked as a duplicate of this bug. ***