Bug 92347 - konqueror hangs when accessing CIFS mounted network share
Summary: konqueror hangs when accessing CIFS mounted network share
Status: RESOLVED NOT A BUG
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: file (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 93603 93839 94893 98815 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-10-29 21:22 UTC by Richard Musil
Modified: 2005-03-13 01:28 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
tethereal capture with GVim access and Konqueror access (13.38 KB, application/octet-stream)
2004-10-29 21:35 UTC, Richard Musil
Details
CIFS log when konqueror tries to access the share (12.10 KB, text/plain)
2004-10-29 21:36 UTC, Richard Musil
Details
patch to 2.6.9 kernel (445 bytes, patch)
2004-12-14 21:52 UTC, Richard Musil
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Musil 2004-10-29 21:22:37 UTC
Version:            (using KDE KDE 3.3.1)
Installed from:    Compiled From Sources
Compiler:          gcc 3.3.4 
OS:                Linux

Using linux kernel 2.6.9 (plain vanilla from kernel.org, no patches) in Gentoo distro on both client and server. Both machines are also running samba 3.0.7 from Gentoo portage.
Server is configured to export network share in pure CIFS way (no Samba) with linux extension on. Client mounts this share using fstab line command:
//amd-k6/data		/mnt/amd	cifs	iocharset=utf8,user=risa,noauto		0 0
(risa is allowed username on CIFS server, amd-k6 is server name)
There is no problem mounting this share from console (either from vc, or from Konsole in KDE), i.e files are accessible as expected charset translation works as expected etc. When I try to browse mounted share in konqueror, it hangs in hard way.
Hanging process cannot be killed (I presume it hangs in kernel). Even after shutting down X server it remains. ps -AFH looks like this:
UID        PID  PPID  C    SZ  RSS PSR STIME TTY          TIME CMD
root         1     0  0   339  496   0 12:34 ?        00:00:01 init [3]  
<omitted all other processes>
root      9786     1  0     0    0   0 12:40 ?        00:00:00   [cifsd]
risa     27165     1  0  9421 23568  0 20:41 ?        00:00:00   kdeinit: konqueror --silent
The problem is that after this happen it is impossible to shutdown correctly, because it is not possible to unmount network share. It is not possible to kill the konqueror process, it is however possible to kill [cifsd] process (which is probably hung up too). Sometimes it leads to crash, sometimes not.
Just for the record, applications using GTK(2) like GVim, Ethereal, run fine and can access mounted network share without any problem. I can submit CIFS log (created from "cifsFYI=1") and network capture from communication between server and client.
Comment 1 Richard Musil 2004-10-29 21:35:50 UTC
Created attachment 8083 [details]
tethereal capture with GVim access and Konqueror access

0-5 sec. is GVim access to the share
130- is Konqueror access to the share
Comment 2 Richard Musil 2004-10-29 21:36:53 UTC
Created attachment 8084 [details]
CIFS log when konqueror tries to access the share
Comment 3 Nicolas Goutte 2004-10-31 00:04:13 UTC
Could it be a problem that Konqueror tries to get the mimetypes and the thumbnails of the files. 

There was a similar bug with a file system that automatically moved old file to an external storage. And that behaviour of Konqueror was a huge problem. So may be it is a problem in your case too. (Sorry, I cannot find the bug number right now.)

So your first step could perhaps be to disable thumbnails for file:.

Have a nice day!
Comment 4 Richard Musil 2004-10-31 15:43:12 UTC
Ok, only option for thumbnails I found is:
"Use thumbnails embedded in files" in "Previews & Metadata" section of Konqueror configuration. I turned it off, but it did not help.
Actually, did you ever look at the packet cap I attached to the bug? Since there is clearly visible the distinction between how GVim (gtk) handles the access to CIFS and how it is done by Konqueror. I am not familiar with samba/cifs protocol, but it seems to me that for someone knowledgable it might present some hints.
Comment 5 Nicolas Goutte 2004-10-31 16:08:58 UTC
You were in the right dialog, but I mean the protocols "Select Protocols" in "Local Protocols" you have "file". As you describe that your filesystem is mounted, file: is the protool used.

Perhaps what you could do is to find out if Kate works for you to access such a file. (It is to know if it is more a KIO bug or more a Konqueror bug.)

As for the data that you have given, no, sorry, I have not looked at it. I am not a network expert and I am not even a Konqueror developer. But has Konqueror gets "tons" of bugs (and especially also bugs that are KIO bugs), I just try to help so that the Konqueror developers have not to do all the work of sorting their bug reports.

Have a nice day!
Comment 6 Richard Musil 2004-10-31 16:40:10 UTC
I do not have any of particular protocols selected in this section (and did not have before). Kate cannot access the share too.
Comment 7 Nicolas Goutte 2004-10-31 19:39:56 UTC
So the problem is probably somewhere in KIO.
Comment 8 Nicolas Goutte 2004-10-31 19:40:35 UTC
(Sorry, forgot to change the maintainer)
Comment 9 tgnb 2004-11-04 02:50:05 UTC
I'm observing the same problem
CIFS Client: Gentoo ADM64 kernel 2.6.9 vanilla samba 3.0.7-r1
Comment 10 Steven Karp 2004-11-08 06:20:32 UTC
Same issue seen here, using KDE 3.3.0 and kernel 2.6.8-24.3-smp as supplied by SuSE 9.2.
Comment 11 tgnb 2004-11-11 18:19:35 UTC
I would like to add that after upgrading to samba 3.0.8 and also kdenetwork 3.3.1-r1 (from 3.3.1) on Gentoo Linux I am no longer seeing this problem.
Comment 12 Richard Musil 2004-11-11 19:00:35 UTC
to #11: I have been observing the bug on kdebase 3.3.1, so I assume 3.3.1-r1 kdenetwork changes something. Also, from your post it is not clear to me, where did you upgrade samba (on the server? or client?). I believe on the client there is no need for samba at all, since CIFS is supported by kernel, but since I am not sure I am asking...
Also, the server upgrade might imply that it was not solely client issue.
Comment 13 tgnb 2004-11-11 19:25:40 UTC
#12 the upgrades I mentioned were only on the client side. Server is and has been running: Linux 2.6.7 vanilla - Samba 3.0.7-r1
As for not needing samba at all on the client i'm not sure. The kernel only adds support for CIFS filesystem but you need user space programs such as cifs.mount no?
On another note, i'm not seeing any problems when connecting to the samba server from a Windows XP xlient which is what contributed to my investigating this more on the client side.

Comment 14 Richard Musil 2004-11-11 19:34:10 UTC
#13 You are right, I forgot the user space support for CIFS. So it is definitely client side issue. I will probably try to upgrade kde first and then, if it won't help, add samba.
Comment 15 Lars Müller 2004-11-12 12:38:51 UTC
Regarding comment #10:  What Samba version are you using on the server and client side?

Could you please test with the Samba 3.0.8 packages from ftp://ftp.SuSE.com/pub/projects/samba or http://download.Samba.org/samba/ftp/Binary_Packages/SuSE/
Comment 16 Richard Musil 2004-11-12 22:41:16 UTC
Upgrading to samba 3.0.8 and to kde (regular, as "emerge kde") 3.3.1 (including kdenetworks-3.3.1-r1) did not help.
Comment 17 Steven Karp 2004-11-21 00:19:16 UTC
#15: Samba version on the client was 3.0.7-5 as supplied on the SuSE 9.2 Pro CD.

I just upgraded to the Samba 3.0.9-1.1 packages on the ftp site you suggested.  No change in behaviour -- I still lock up as soon as I attempt to access the share via KDE.

In all cases, the server side is a Windows machine (Server 2003 and XP Pro with Service Pack 2).  I'm using nfs to connect to the other Linux boxen on the network, and that's working just fine.
Comment 18 Mathieu Jobin 2004-11-22 03:17:58 UTC
little bit more information in Bug #93603

i think kio file:/ should check if he is inside a remote or a local mount.
protocol is not enough as a check, remote mount must be considered just like remote protocol:/



Comment 19 Stephan Kulow 2004-11-22 10:07:43 UTC
*** Bug 93603 has been marked as a duplicate of this bug. ***
Comment 20 Stephan Kulow 2004-11-22 10:48:00 UTC
#18 is nonsense. The kernel does that check, file:/ is just accessing the data. If the kernel hangs on reads, then this is a problem of the kernel. But I leave the bug open till we know what samba version fixes it for real.
Comment 21 Mathieu Jobin 2004-11-22 17:54:03 UTC
humm ? Am I talking about the kernel ?
I dont think its the kernel, since only KDE application crash/freeze on CIFS mounts.

I say, kio should have a detection of remote mounted filesystem

so it does not do the tons of extra work for thumbnails for example

Comment 22 Richard Musil 2004-11-23 10:10:38 UTC
to #20: My observation are clear in that only konqueror hangs. GVim and Ethereal (both using GTK and probably different file access stack) work fine, as well plain linux console or KDE Konsole.
Concerning the assignment of this bug, I originally assigned it to 'konqueror' since I am not familiar with KDE internals. It was later changed by someone else, so feel free to change it to whatever you find proper, just take into account the facts that konqueror on cifs exposes the bug, non-KDE components work fine on the same cifs.
If it is cifs bug, is there a way to pinpoint it down or get additional info with current setup (like packet capture, cifs log, kde log etc.)? For me it is really showstopper and I am willing to help, if I can.
Comment 23 Stephan Kulow 2004-11-24 13:18:48 UTC
*** Bug 93839 has been marked as a duplicate of this bug. ***
Comment 24 John Dell 2004-11-29 21:08:34 UTC
I'm seeing this also (I added votes for this bug).  Access from konsole to CIFS mount of Win2k3 share works great, but accessing same CIFS mount hangs konqueror.  Running SuSE 9.2 with all latest updates.

Please let me know if I can help in anyway to further trouble-shoot this bug!
Comment 25 Sebastian Strand 2004-12-07 18:25:30 UTC
*** This bug has been confirmed by popular vote. ***
Comment 26 Rudolf Kollien 2004-12-13 21:25:04 UTC
I can confirm the issue. The hang ONLY happens with KDE apps. All other (console, gtk) run fine with cifs. Switching zu smbfs solves the problem (but may cause other as smbfs seems to have same strange issues).

So "mount -t cifs -o..... //server/share /your/mount/point" hangs KDE
   "mount -t smbfs -o..... //server/share /your/mount/point" let you work.
Comment 27 Richard Musil 2004-12-13 21:46:58 UTC
Hmm, I wonder whether KDE devs are actually doing something or just waiting that someone else fixes this bug (as #20) suggested. In my opinion, this should be pretty straightforward reproducible and no one has proved yet this is indeed outside KDE.
Comment 28 John Dell 2004-12-14 00:27:18 UTC
Some thoughts on this...

See this thread:

http://lists.samba.org/archive/linux-cifs-client/2004-December/000563.html

and response:

http://lists.samba.org/archive/linux-cifs-client/2004-December/000565.html

<SWAG> Perhaps there is network filesystem fcntl that Konqueror uses that is not being used by MC, GTK apps, etc? </SWAG>

Some other questions:

Does anyone know if konqy access to CIFS mount worked in previous version of KDE  < 3.3.x ?

Has anyone verified that this bug exists in a QT app (not KDE app)?
Comment 29 Stephan Kulow 2004-12-14 09:34:54 UTC
The reply names it quite exactly: KDE does dir notify checks and that hangs up the kernel - which it shouldn't. 
Comment 30 Richard Musil 2004-12-14 09:44:49 UTC
#28 & #29: Ok, point taken. I was afraid of that, but did not know how to prove it. It is time to start idling on linux-cifs-client thread.
Comment 31 Marcin Juszkiewicz 2004-12-14 15:20:21 UTC
I have that under Debian 'sid' with up-to-date system on client side. Server has Samba 3.0.7 (I can send config).

$ apt-cache policy kdebase-kio-plugins
kdebase-kio-plugins:
  Installed: 4:3.3.1-3
  Candidate: 4:3.3.1-3
  Version Table:
 *** 4:3.3.1-3 0

$ uname -a
Linux marcinj 2.6.10-rc2-mm3 #2 Thu Nov 25 10:50:32 CET 2004 i686 GNU/Linux

Share mounted:
//192.168.1.50/ftp on /home/hrw/mnt/serwer/ftp type cifs (rw,mand,noexec,nosuid,nodev)
Comment 32 John Dell 2004-12-14 19:34:39 UTC
Here is the answer, wait for kernel 2.6.10 or patch.  Please let me know if anyone has success with this!  And if you do, please send along a patch!

http://lists.samba.org/archive/linux-cifs-client/2004-December/000612.html
Comment 33 Richard Musil 2004-12-14 21:52:52 UTC
Created attachment 8665 [details]
patch to 2.6.9 kernel

I applied the suggested changes (following
http://lists.samba.org/archive/linux-cifs-client/2004-December/000612.html).
The patch is to 2.6.9 plain vanilla kernel.
After short testing (accessing network mount and moving few files back and
forth) it seems OK.
Comment 34 Stephan Kulow 2004-12-15 11:18:07 UTC
I told you from the start :)
Comment 35 Mathieu Jobin 2004-12-15 16:35:41 UTC
ok, just to understand a little bit more, its a not a kde problem, but a kernel/samba problem ? that we can experience only in KDE, as far as we have discover. because only KDE use this functionnality ?

Comment 36 Marcin Juszkiewicz 2004-12-15 16:51:07 UTC
After kernel upgrade to 2.6.10-rc3-mm1 with "CIFS Experimental Features" switched on KDE works ok on my cifs mounted share.
Comment 37 Rudolf Kollien 2004-12-15 17:43:19 UTC
Is there a patch for kernel 2.6.8 too? (F.e. SuSE 9.2)

Why only KDE apps encounter this problem? Isn't there a bugfix planed for KDE versions running below kernel 2.6.10? I don't think that everyone who needs a cifs mount and is using kernel 2.6.8/.9 will upgrade to a expermental kernel. As the .8/.9 kernels are used in buyable distros, i think there should be a fix in kde too. Maybe a switch in one of the config files like "usebuggycifs=true" or something else. 
Comment 38 Mathieu Jobin 2004-12-15 18:04:47 UTC
he has a point, KDE should protect himself from being wrong in known cases.

i.e. kernel <= 2.6.9
Comment 39 Stephan Kulow 2004-12-15 21:59:13 UTC
please add
grep -q cifs /etc/fstab || exit 1
to startkde. This should help you to protect KDE
Comment 40 Richard Musil 2004-12-15 22:23:09 UTC
ad #37, #38
As far as (little) I understood, kernel implementation of notify feature for cifs is broken. (I assume this is the feature which provides (user space) client with notification when some (watched) file or dir changes).
And was broken long ago, but it only shew up recently, when konqeror started to use this feature (or people started to use cifs). So the guys developing the cifs module in kernel had to do some hard work to put the feature back.
So far there are two workarounds for incompatible KDE+kernel combination. Either disable notify for cifs in kernel or in KDE. Since the first option is pretty straightforward (as you can see in the patch I posted :)) I do not see any reason why KDE guys should do anything, because "anything" will be definitely more complex and more dangerous.
So whoever wants to run kernel of lesser version with KDE has to disable notify feature on cifs, and easy way to do this is by patching kernel. I cannot verify on 2.6.8 kernel, but I would presume that the required changes won't differ much  from the ones required for kernel 2.6.9. HTH
Comment 41 John Dell 2004-12-16 00:48:34 UTC
re #33, Richard's patch applies cleanly to stock SuSE 9.2 kernel (2.6.8+) and my CIFS mounts are working great!

Thanks Richard!

Regards,
John
Comment 42 Stephan Kulow 2004-12-16 16:39:29 UTC
*** Bug 94893 has been marked as a duplicate of this bug. ***
Comment 43 Chris Ditri 2005-01-04 17:07:44 UTC
I am having the same problem.  I have tried richards patch using -p0 and -p1 and -p2.. and it doesn't work:

---------------------------------------------------------------
missing header for unified diff at line 3 of patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- cifsfs.c.old       2004-12-14 21:04:10.404790384 +0100
|+++ cifsfs.c   2004-12-14 21:05:37.780507256 +0100
--------------------------
File to patch:
-----------------------------------------------------------------

What am I missing here?

Thanks.
Comment 44 Tom 2005-01-04 18:46:14 UTC
Try using kernel 2.6.10.  I am using 2.6.10-gentoo-r1, and it works great.
Comment 45 Richard Musil 2005-01-04 21:51:11 UTC
to #43)
You do not need to use -pX option. This patch was not created against the complete kernel source, but one file, so just go to the folder with cifsfs.c and do
patch cifsfs.c < cifsfs.c.patch
Comment 46 Maksim Orlovich 2005-02-08 02:05:12 UTC
*** Bug 98815 has been marked as a duplicate of this bug. ***
Comment 47 saxman29 2005-03-12 23:41:07 UTC
I have the standard SuSE 9.2 Kernel and it came as an RPM.  Is there anyway I can apply the patch from #33 to the RPM based or do I have to download the source and compile it?
Comment 48 Thiago Macieira 2005-03-12 23:43:42 UTC
You can't apply source patches to binary data. You must either use the source code, or instead get a patched binary.
Comment 49 Mathieu Jobin 2005-03-13 01:28:15 UTC
SuSE probably has a kernel update you can get by now. you dont have to apply 
the patch yourself. Both 2.6.10 and 2.6.11 include the patch so you dont have 
to worry about anything, just get the latest kernel from SuSE.

hope this helps.


> ------- Additional Comments From saxman29 hotmail com  2005-03-12 23:41
> ------- I have the standard SuSE 9.2 Kernel and it came as an RPM.  Is
> there anyway I can apply the patch from #33 to the RPM based or do I have
> to download the source and compile it?