[Samba] Samba daemons hang trying to lock locking.tdb

Fermin Molina fermin at asic.udl.es
Tue Jan 31 19:07:05 GMT 2006


Hi,

After upgrade to samba 3.0.21b, the behaviour is the same.
I think the problem must be related to TDB (Trivial DB) code. The call
fcntl64() is trying to lock for write the file /var/cache/locking.tdb,
but with the F_SETLKW file control command. This control command waits
if the file is blocked. If another process locks for write this file,
can we get a deadlock?

The fact is that some hours after start samba, some smbd daemons hangs
waiting to get a write lock to locking.tdb file. The windows clients
associated with these smbd daemons get stalled and the user must to
reset the machine (or I kill -9 these daemons).

Any clue?

Thanks in advance.



On Wed, 2006-01-25 at 16:11 +0100, Fermin Molina wrote:
> Hi,
> 
> A day or so after starting samba, some daemons (diferent forks) begin to
> hang. Then, the WinXP clients hang too completely.
> 
> When I try to figure out what is happen, I see that smbd daemons hangs
> always in a fcntl64() call:
> 
> # strace -p 6414
> Process 6414 attached - interrupt to quit
> fcntl64(14, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=3684, len=1}  <unfinished ...>
> Process 6414 detached
> # 
> 
> The file descriptor 14 corresponds to /var/lib/samba/locking.tdb file.
> A backtrace using gdb from one stalled daemon:
> 
> (gdb) bt
> #0  0x00faf402 in __kernel_vsyscall ()
> #1  0x003dbd7a in fcntl () from /lib/libc.so.6
> #2  0x008e50eb in tdb_set_lock_alarm () from /usr/sbin/smbd
> #3  0x008e5307 in tdb_set_lock_alarm () from /usr/sbin/smbd
> #4  0x008e5868 in tdb_chainlock () from /usr/sbin/smbd
> #5  0x00880da8 in get_share_mode_lock () from /usr/sbin/smbd
> #6  0x00881677 in get_delete_on_close_flag () from /usr/sbin/smbd
> #7  0x007718fb in reply_trans2 () from /usr/sbin/smbd
> #8  0x007906bc in smb_fn_name () from /usr/sbin/smbd
> #9  0x007913c4 in process_smb () from /usr/sbin/smbd
> #10 0x00791899 in smbd_process () from /usr/sbin/smbd
> #11 0x0096c5c0 in main () from /usr/sbin/smbd
> (gdb)
> 
> 
> A backtrace from another stalled daemon:
> 
> 
> (gdb) bt
> #0  0x00faf402 in __kernel_vsyscall ()
> #1  0x003dbd7a in fcntl () from /lib/libc.so.6
> #2  0x008e50eb in tdb_set_lock_alarm () from /usr/sbin/smbd
> #3  0x008e5307 in tdb_set_lock_alarm () from /usr/sbin/smbd
> #4  0x008e5868 in tdb_chainlock () from /usr/sbin/smbd
> #5  0x00880da8 in get_share_mode_lock () from /usr/sbin/smbd
> #6  0x0077ab8b in open_file_ntcreate () from /usr/sbin/smbd
> #7  0x0074a922 in reply_ntcreate_and_X () from /usr/sbin/smbd
> #8  0x007906bc in smb_fn_name () from /usr/sbin/smbd
> #9  0x007913c4 in process_smb () from /usr/sbin/smbd
> #10 0x00791899 in smbd_process () from /usr/sbin/smbd
> #11 0x0096c5c0 in main () from /usr/sbin/smbd
> (gdb)       
> 
> 
> The number of smbd daemons stalled increases in time.
> I'm using FC4 with last updates installed and samba 3.0.21a.
> 
> Maybe is a kernel related problem with file locking?
> 
> Thanx in advance!
> 
> -- 
> Fermin Molina Ibarz
> Tècnic sistemes - ASIC
> Universitat de Lleida
> Tel: +34 973 702151
> GPG: 0x060F857A
> 
> 
-- 
Fermin Molina Ibarz
Tècnic sistemes - ASIC
Universitat de Lleida
Tel: +34 973 702151
GPG: 0x060F857A




More information about the samba mailing list