Bug 316655 - Dolphin freezes when a network [cifs] mount is lost
Summary: Dolphin freezes when a network [cifs] mount is lost
Status: RESOLVED UPSTREAM
Alias: None
Product: kfile
Classification: Applications
Component: kfileplacesview (show other bugs)
Version: 4.8.0
Platform: Mageia RPMs Linux
: HI major
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
: 184062 274414 324654 355292 380940 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-03-13 10:38 UTC by Robert Wood
Modified: 2023-01-23 17:27 UTC (History)
25 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Wood 2013-03-13 10:38:32 UTC
If I have a mount point set up using cifs and the remote connection is lost, Dolphin freezes; the only way to regain use is to reboot the computer. Logging out and back does not work.

mount -l //drive/directory

Enables the rest of the computer to function again, including konqueror. Dolphin will not unfreeze at all though. 

Reproducible: Always

Steps to Reproduce:
1. Mount a cifs drive
2. Disconnect cifs drive


Actual Results:  
Once this happens, you can force a shutdown of Dolphin - either by clicking the x button and it eventually shuts down, or by using xkill. Either way, when it is relaunched it is just a grey screen.

Expected Results:  
It should show all mounted directories as with a fresh boot.
Comment 1 Robert Wood 2013-03-13 10:39:31 UTC
Sorry, I should have said - this is on Mageia 2 and Open SuSE 12.2
Comment 2 Frank Reininghaus 2013-03-13 11:00:05 UTC
Thanks for the report. To find out where the freeze occurs, could you try

gdb dolphin

Then enter "run" at the gdb prompt, reproduce the freeze, press Ctrl+Z in gdb to interrupt Dolphin,  enter

thread apply all backtrace

and paste the output here? Thanks.
Comment 3 Robert Wood 2013-03-14 10:02:44 UTC
Et voilà! (Sorry for the delay.)

-------------------------------------------------------------
(gdb) thread apply all backtrace

Thread 3 (Thread 0xb2ec0b70 (LWP 6665)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb7e93221 in select () from /lib/i686/libc.so.6
#2  0xb6d21c34 in ?? () from /usr/lib/libQtCore.so.4
#3  0xb6c30d48 in ?? () from /usr/lib/libQtCore.so.4
#4  0xb5914a37 in start_thread () from /lib/i686/libpthread.so.0
#5  0xb7e9a98e in clone () from /lib/i686/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 2 (Thread 0xb3c68b70 (LWP 6662)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb7e8ffee in poll () from /lib/i686/libc.so.6
#2  0xb579f93b in g_poll () from /lib/libglib-2.0.so.0
#3  0xb5791f2e in ?? () from /lib/libglib-2.0.so.0
#4  0xb5792081 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#5  0xb6d796b7 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/libQtCore.so.4
#6  0xb6d4547d in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#7  0xb6d45719 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#8  0xb6c2d81c in QThread::exec() () from /usr/lib/libQtCore.so.4
#9  0xb6d2274d in ?? () from /usr/lib/libQtCore.so.4
#10 0xb6c30d48 in ?? () from /usr/lib/libQtCore.so.4
#11 0xb5914a37 in start_thread () from /lib/i686/libpthread.so.0
#12 0xb7e9a98e in clone () from /lib/i686/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further
---Type <return> to continue, or q <return> to quit---

Thread 1 (Thread 0xb4e1b6e0 (LWP 6659)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb7e89372 in __old__lxstat64 () from /lib/i686/libc.so.6
#2  0xb7e00318 in realpath@@GLIBC_2.3 () from /lib/i686/libc.so.6
#3  0xb7eb046d in __realpath_chk () from /lib/i686/libc.so.6
#4  0xb6f52f01 in KStandardDirs::realFilePath(QString const&) () from /usr/lib/libkdecore.so.5
#5  0xb6f830aa in KMountPoint::List::findByPath(QString const&) const () from /usr/lib/libkdecore.so.5
#6  0xb77649ea in KDiskFreeSpaceInfo::freeSpaceInfo(QString const&) () from /usr/lib/libkio.so.5
#7  0xb7d70326 in ?? () from /usr/lib/libkfile.so.4
#8  0xb678cebe in QListView::paintEvent(QPaintEvent*) () from /usr/lib/libQtGui.so.4
#9  0xb7d61cea in KFilePlacesView::paintEvent(QPaintEvent*) () from /usr/lib/libkfile.so.4
#10 0xb620ea56 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#11 0xb662b3f5 in QFrame::event(QEvent*) () from /usr/lib/libQtGui.so.4
#12 0xb66bec21 in QAbstractScrollArea::viewportEvent(QEvent*) () from /usr/lib/libQtGui.so.4
#13 0xb67640dc in QAbstractItemView::viewportEvent(QEvent*) () from /usr/lib/libQtGui.so.4
#14 0xb66c13a6 in ?? () from /usr/lib/libQtGui.so.4
#15 0xb6d46d96 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) ()
   from /usr/lib/libQtCore.so.4
#16 0xb61b3d62 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#17 0xb61b917a in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#18 0xb7314841 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#19 0xb6d46bfe in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#20 0xb6209bdc in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#21 0xb620a94c in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QP---Type <return> to continue, or q <return> to quit---
oint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#22 0xb6209938 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#23 0xb620a94c in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#24 0xb6209938 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#25 0xb620a94c in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#26 0xb620a812 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#27 0xb620a812 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#28 0xb6209938 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#29 0xb6401804 in ?? () from /usr/lib/libQtGui.so.4
#30 0xb61ff96b in QWidgetPrivate::syncBackingStore() () from /usr/lib/libQtGui.so.4
#31 0xb620e830 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#32 0xb6648a0c in QMainWindow::event(QEvent*) () from /usr/lib/libQtGui.so.4
#33 0xb7410c54 in KMainWindow::event(QEvent*) () from /usr/lib/libkdeui.so.5
#34 0xb7410ef2 in KXmlGuiWindow::event(QEvent*) () from /usr/lib/libkdeui.so.5
#35 0xb61b3d94 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#36 0xb61b917a in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#37 0xb7314841 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#38 0xb6d46bfe in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#39 0xb6d4a828 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
---Type <return> to continue, or q <return> to quit---
   from /usr/lib/libQtCore.so.4
#40 0xb6d4ab5c in QCoreApplication::sendPostedEvents(QObject*, int) () from /usr/lib/libQtCore.so.4
#41 0xb686827e in ?? () from /usr/lib/libQtGui.so.4
#42 0xb68683ab in ?? () from /usr/lib/libQtGui.so.4
#43 0xb6d58761 in QMetaCallEvent::placeMetaCall(QObject*) () from /usr/lib/libQtCore.so.4
#44 0xb6d61a1b in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#45 0xb686efd0 in QGraphicsScene::event(QEvent*) () from /usr/lib/libQtGui.so.4
#46 0xb61b3d94 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#47 0xb61b90d3 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#48 0xb7314841 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#49 0xb6d46bfe in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#50 0xb6d4a828 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
   from /usr/lib/libQtCore.so.4
#51 0xb6d4ab5c in QCoreApplication::sendPostedEvents(QObject*, int) () from /usr/lib/libQtCore.so.4
#52 0xb6d79264 in ?? () from /usr/lib/libQtCore.so.4
#53 0xb5791c06 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#54 0xb5791fa5 in ?? () from /lib/libglib-2.0.so.0
#55 0xb5792081 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#56 0xb6d79657 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/libQtCore.so.4
#57 0xb626791a in ?? () from /usr/lib/libQtGui.so.4
#58 0xb6d4547d in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#59 0xb6d45719 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#60 0xb6d4ac0a in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#61 0xb61b1c34 in QApplication::exec() () from /usr/lib/libQtGui.so.4
#62 0xb7f7e1ca in kdemain () from /usr/lib/libkdeinit4_dolphin.so
---Type <return> to continue, or q <return> to quit---
#63 0x0804850b in ?? ()
#64 0xb7ddf3e3 in __libc_start_main () from /lib/i686/libc.so.6
#65 0x08048531 in _start ()
Comment 4 Robert Wood 2013-03-14 10:04:31 UTC
And, FWIW, this is what the command line spat out before I stopped the program with CTL-Z.

-----------------------------------------------------------------------------------------------------------

Starting program: /usr/bin/dolphin 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i686/libthread_db.so.1".
[New Thread 0xb3c68b70 (LWP 6662)]
[New Thread 0xb2ec0b70 (LWP 6665)]
Detaching after fork from child process 6666.
Undecodable sequence: \001b(hex)[36h
dolphin(6659)/konsole Konsole::Session::run: Attempted to re-run an already running session. 
Detaching after fork from child process 6707.
dolphin(6659) KSambaSharePrivate::testparmParamValue: We got some errors while running testparm "Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Warning: Service printers defines a print command, but rameter is ignored when using CUPS libraries.
"
Comment 5 Frank Reininghaus 2013-03-14 10:10:25 UTC
Thanks for the feedback. The freeze happens while KFilePlacesView (the widget that provides the contents of the Places Panel in Dolphin <= 2.0) tries to determine the free space on the device.

This cannot happen any more in Dolphin >=  2.1 because the new Places Panel implementation does not display the free space at all. Please upgrade to resolve this issue on your system - Dolphin 2.0/KDE 4.8 is quite outdated.

However, it can still happen in other KDE applications because things like the "File" dialog still make use of KFilePlacesView, so I will reassign this report.
Comment 6 Robert Wood 2013-03-14 10:14:24 UTC
Thanks, Frank. I will enquire with Mageia as to whether there is an updated Dolphin in the repositories.  Great, fast response - thanks again. :~)
Comment 7 Ralf Habacker 2013-09-11 18:57:17 UTC
As far as i can from the backtrace bug 316655 seems to have the same reason.
Comment 8 Ralf Habacker 2013-09-11 19:03:26 UTC
from the backtrace I could say that  bug 184062 seems to have the same reasons, which are

- realpath(), which is called in the end from http://lxr.kde.org/source/kde/kdelibs/kio/kfile/kdiskfreespaceinfo.cpp#115, hangs when a mount is lost 

- statvfs(), called from http://lxr.kde.org/source/kde/kdelibs/kio/kfile/kdiskfreespaceinfo.cpp#135 also hangs when a mount is lost 

problem occurs in plasma-desktop on on opensuse 12.2, kde 4.11.1, cifs fs mounted with pam_mounted on resume from standby.
Comment 9 Ralf Habacker 2013-09-11 19:03:47 UTC
(In reply to comment #7)
> As far as i can from the backtrace bug 316655 seems to have the same reason.
ups wrong bug number
Comment 10 Ralf Habacker 2013-09-12 05:17:14 UTC
Seem to be a solid implementation issue. In

bool SolidDeviceEngine::updateFreeSpace(const QString &udi)
{
    Solid::Device device = m_devicemap.value(udi);
    if (!device.is<Solid::StorageAccess>() || device.is<Solid::OpticalDisc>()) {
        return false;

there is called a method to check if the device is accessible 

    } else if (!device.as<Solid::StorageAccess>()->isAccessible()) {
        removeData(udi, I18N_NOOP("Free Space"));
        removeData(udi, I18N_NOOP("Free Space Text"));
    }

which is defined as 
        /**
         * Indicates if this volume is mounted.
         *
         * @return true if the volume is mounted
         */
        bool isAccessible() const;

because the mount is not available yet, isAccessible() should return false in that case and updateFreeSpace() should return false too. 

    } else if (!device.as<Solid::StorageAccess>()->isAccessible()) {
        removeData(udi, I18N_NOOP("Free Space"));
        removeData(udi, I18N_NOOP("Free Space Text"));
+      return false;
    }

The important question is how to check if a mount is currently available when mounted  ... using lstat or similar will not work because there behavior raises the problem.

Any idea from the linux experts ?
Comment 11 Christoph Feck 2013-09-20 22:35:25 UTC
Isn't this the reason we are using KIO slaves instead of mounts?
Comment 12 Rex Dieter 2014-11-05 14:53:51 UTC
marking confirmed (per this and bug #184062)
Comment 13 Rex Dieter 2014-11-05 14:57:32 UTC
*** Bug 184062 has been marked as a duplicate of this bug. ***
Comment 14 Christoph Feck 2014-11-16 20:03:32 UTC
Confirmed? I see no confirmation whether the issue is in linux kernel, the network stack, solid, kdelibs, or kfile. Also, does Kickoff menu really use the same places view as the file dialog?
Comment 15 Ganton 2015-01-28 19:01:12 UTC
It looks like there are two duplicates of this bug, with additional information:
https://bugs.kde.org/show_bug.cgi?id=324654
https://bugs.kde.org/show_bug.cgi?id=274414
Comment 16 Ganton 2015-01-28 19:06:21 UTC
It it can be useful for anyone:
There are some comments about this bug in https://kver.wordpress.com/2015/01/22/plasma-5-2-the-quintissential-breakdown/#comment-351
Comment 17 Dawit Alemayehu 2015-03-24 12:37:38 UTC
*** Bug 274414 has been marked as a duplicate of this bug. ***
Comment 18 Ettore Atalan 2015-04-26 01:22:23 UTC
This long time bug is part of my mixed experiences with KDE.
Comment 19 Martin Kyral 2015-07-21 09:01:51 UTC
(In reply to Ettore Atalan from comment #18)
> This long time bug is part of my mixed experiences with KDE.

I feel the same..
Comment 20 David Faure 2015-09-28 21:59:03 UTC
Don't *all* applications (not just KDE/Qt based ones, but everything, including GTK apps, firefox, openoffice, command line tools etc.) hang when a CIFS mount is lost, and they are trying to access something in the mountpoint? This is "part of my mixed experiences with NFS/CIFS mounts", and the reason why I recommend against using them. POSIX is full of synchronous calls (like the realpath() call in the backtrace in this report), which don't mix well with asynchronous network communication.

E.g. try `find` in a large mount, and disconnect the mount while `find` is running. Yes you can Ctrl+C it (just like you can kill dolphin), but if I'm right find will hang, it will not abort with an error message. Right?

I suggest you take this issue to the Linux Kernel developers, unless I'm wrong, which would be the case if you can prove that *only* Qt/KDE apps are affected by this.
Comment 21 Armands Liepins 2015-11-05 17:14:55 UTC
Probably this bug https://bugzilla.redhat.com/show_bug.cgi?id=1042778
Comment 22 Frank Reininghaus 2015-11-16 21:47:03 UTC
*** Bug 355292 has been marked as a duplicate of this bug. ***
Comment 23 Elvis Angelaccio 2017-06-08 10:23:00 UTC
*** Bug 380940 has been marked as a duplicate of this bug. ***
Comment 24 Nate Graham 2018-04-20 22:09:43 UTC
*** Bug 324654 has been marked as a duplicate of this bug. ***
Comment 25 Kjetil Kjernsmo 2022-01-31 23:04:40 UTC
FWIW, for me, the NFS server is stable, but I couldn't bring the laptop along without jumping a lot of hoops, and I made this a lot less annoying by using a NetworkManager dispatcher-script:

#!/usr/bin/perl

use strict;
use warnings;

# Find the connection UUID with "nmcli con show" in terminal.
# All NetworkManager connection types are supported: wireless, VPN, wired...

#!/usr/bin/perl

use strict;
use warnings;

# Find the connection UUID with "nmcli con show" in terminal.
# All NetworkManager connection types are supported: wireless, VPN, wired...

use Data::Dumper;

my %connections = (
                                                 'some-uuid => 'ethernet',
                                                 'some-other-uuid' => 'wifi'
                                                );

my ($name, $event) = @ARGV;

my $conn = $ENV{'CONNECTION_UUID'};
print "Connection: $conn \nName: $name\nEvent: $event\n";

if ($event eq 'up') {
  # New connection is coming up
  if ($connections{$conn}) {
         # We are at home
         unless (mounted_ok()) {
                system("coming-home.sh");
         }
  }
}

if ($event eq 'connectivity-change' && $ENV{'CONNECTIVITY_STATE'} eq 'NONE') {
  if (mounted_ok()) {
         system("leaving-home.sh");
  }
}

sub mounted_ok {
  my $home_mounted = 0;
  open(FH, '<', '/proc/mounts') || die "Could not read mounts";
  while (<FH>) {
         if (m/site nfs/) {
                $home_mounted = 1;
                last;
         }
  }

Where the two shell scripts do the actual mounts/unmounts (and other housekeeping tasks in my case).

With this, I only need to disconnect the network before I pull the plug.
Comment 26 spamless.9v5xj 2023-01-23 10:05:12 UTC
For the time being, would it be possible to implement a workaround by having KDE automatically unmount all shares once it detects network connection is lost?
Comment 27 Nate Graham 2023-01-23 17:27:49 UTC
Please file new bug reports rather than re-opening old ones, as the code has changed so much and old bugs have lots of history pertaining to the old manifestation of the issue, not the current one.