Bug 6653 - smbd (or samba in samba4) randomly uses 100% cpu
Summary: smbd (or samba in samba4) randomly uses 100% cpu
Status: RESOLVED WORKSFORME
Alias: None
Product: Samba 3.4
Classification: Unclassified
Component: File services (show other bugs)
Version: 3.4.0
Hardware: x86 Linux
: P3 major
Target Milestone: ---
Assignee: Volker Lendecke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-20 13:07 UTC by Mark Walmsley
Modified: 2009-09-18 11:40 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Walmsley 2009-08-20 13:07:46 UTC
Hi

I'm running samba 3.4.0 on SuSE Linux 11.1 x86_64 under xinetd.

Every couple of days smbd starts to use 100% cpu for no apparent reason and cannot be killed.

I have tried removing printer support with "load printers = no" in smb.conf but to no avail.

I have also tried using samba 4 but within an hour or so the samba daemon  randomly starts to use 100% cpu and cannot be killed.

I can't provide much more info because when this happens it is almost impossible to do anything except reboot ... although I have managed to run top to show that it is samba that is using 100% cpu.

(Also samba 4 does not seem to update unix file permissions correctly ... so for example setting a file to be read only via windows does not set the unix permissions to 444 as I expected???)

I would be very grateful for any help as I have had to turn off samba ... and life without it is very hard.

Thanks
Mark
Comment 1 Jeremy Allison 2009-08-20 13:50:07 UTC
My guess is it's this bug:

https://bugzilla.samba.org/show_bug.cgi?id=6476

which was fixed post 3.4.0 and is in the current 3.4.1 code branch. Are you able to compile from source to test this version ?

Jeremy.
Comment 2 Mark Walmsley 2009-08-20 14:27:35 UTC
(In reply to comment #1)
> My guess is it's this bug:
> https://bugzilla.samba.org/show_bug.cgi?id=6476
> which was fixed post 3.4.0 and is in the current 3.4.1 code branch. Are you
> able to compile from source to test this version ?
> Jeremy.

I just checked the 3.4.0 source that I build from and the patch (for source3/smbd/server.c) that you suggest already seems to be included.

I do not have lots of zombie processes ... just one smbd process using 100% cpu.
Comment 3 Jeremy Allison 2009-08-20 14:52:22 UTC
Ok, then I'm going to need more help in tracking this down. I need a gdb backtrace from the spinning smbd - make sure it's built with -g for symbols. Try and get a couple of backtraces at different points so I can see where it's spinning, also an strace would help.
Jeremy.
Comment 4 Volker Lendecke 2009-08-21 07:01:43 UTC
Can you try upgrading your kernel? There have been reports where the linux kernel inotify implementation is buggy, leading to this behaviour.

As a quick measure, please try "kernel change notify = false"

Please tell us if this helped.

Thanks,

Volker
Comment 5 Mark Walmsley 2009-08-22 14:21:37 UTC
(In reply to comment #4)
> Can you try upgrading your kernel? There have been reports where the linux
> kernel inotify implementation is buggy, leading to this behaviour.
> As a quick measure, please try "kernel change notify = false"
> Please tell us if this helped.
> Thanks,
> Volker

I've added "kernel change notify = no" to my smb.conf file and I'm running strace on the smbd daemon to try to catch it when it starts using 100% cpu ... I'll let you know what happens ...
Comment 6 Mark Walmsley 2009-08-26 04:17:46 UTC
(In reply to comment #5)
> I've added "kernel change notify = no" to my smb.conf file and I'm running
> strace on the smbd daemon to try to catch it when it starts using 100%
> cpu ... I'll let you know what happens ...

So far so good ... however several things have changed ...

- above change to smb.conf
- reconfigured samba build with CFLAGS=-g
- continuously tracing smbd with strace
- running another unrelated process with very high cpu usage

... I'll continue to watch for the bug ...
Comment 7 Volker Lendecke 2009-08-28 04:43:14 UTC
Any news?

Volker
Comment 8 Mark Walmsley 2009-08-28 04:53:21 UTC
(In reply to comment #7)
> Any news?
> Volker

Still running okay ... I'll let you know if it hangs again.
Comment 9 Karolin Seeger 2009-09-01 04:04:15 UTC
Lowering severity as this is not a showstopper for 3.4.1.
Comment 10 Mark Walmsley 2009-09-13 15:55:09 UTC
... samba still running okay ... I've finally stopped running the other process with high CPU-usage a couple of days ago and it seems to make no difference ... looks like it is inotify that was the problem ... I'll stop tracing smbd and re-build samba without the -g flag as soon as I get a minute to see if that makes any difference ...
Comment 11 Volker Lendecke 2009-09-18 11:40:59 UTC
Closing as WORKSFORME. Please re-open if you can reproduce this with kernel oplocks off.

Thanks,

Volker