tdb corruption with "use mmap=false"

MCCALL,DON (HP-USA,ex1) don_mccall at
Thu Sep 6 13:55:21 GMT 2001

Hi Jeremy, Andrew, et. al;

I've come up with a pretty simple senario that I can cause corruption
to the connections.tdb file that maybe you could take a look at:

latest Samba 2_2 CVS running on a Debian Linux 2.2.19 kernel, slow (133mhz
pc on 10base T network.

running the following script on a HP-UX 11.11 "fast" system, to force a lot
of concurrent access to the connections.tdb on the slow system:

for ($i=0;$i <=200;$i++){
$test = "test"."$i";
$command = "nohup /usr/local/samba/source/bin/smbclient //mccall/dev
-Uddmc%passwd -d 0 -n $test -c dir &";
system $command;

Key components to the test:
1. smb.conf for slow system specifies "use mmap=false"
2. share used for testing has a lot of files (so the smbclient sessions hang
   around long enough to build up a lot of concurrent connections)
3. system script is running on is fast enough to 'load up' a bunch of
   requests on the slow system.

What I get, with log level = 0 on the Linux system after I perform this
test, is several log.testXX files with
the following errors:

ddmc at mccall:/usr/local/samba/var$ more log.test153
[2001/09/06 16:44:08, 0] tdb/tdbutil.c:tdb_log(342)
  tdb(/usr/local/samba/var/locks/connections.tdb): rec_read bad magic 0x0 at
[2001/09/06 16:44:08, 0] smbd/connection.c:claim_connection(159)
  claim_connection: traverse of connections.tdb failed with error Corrupt
[2001/09/06 16:44:12, 0] smbd/connection.c:yield_connection(63)
  yield_connection: tdb_delete for name  failed with error Record does not

I suspect the reason this has only come up on HP-UX until now is that we are
using mmap everywhere else, so
we don't see the stress on the fs calls manipulating the tdb files directly.
(yes, I know -get a unified cache
already!  ;->)

Any chance one of the Team could set this repro senario up and see if you
can break it as well, and maybe
point me in the right direction for tracking this down?  We're looking at it
here, of course, but could sure
use some help!

The smb.conf I use on the 'slow' machine is:
netbios name = mccall
workgroup = linuxtest
encrypt passwords = yes
log level = 0
log file = /usr/local/samba/var/log.%m
max log size = 5000
use mmap = no
path = /dev
readonly = yes

Thanks in advance,

More information about the samba-technical mailing list