samba problem on IRIX 5.3

samba problem on IRIX 5.3

Post by Pete Turnb » Thu, 10 Jun 2004 19:44:51


I have a problem installing+running samba on a machine running IRIX
5.3; for various reasons it can't be upgraded to 6.5.x.

A file pointer is going way out of bounds. It appears that some
pointer somewhere in the code is not being correctly initialised, or
there's an endian problem, or something like that. Details below. I've
seen this before somewhere, but I can't remember what the fix was. Has
anyone seen this? Can anyone suggest a fix?

I downloaded samba-2.2.9 source, ran configure (as root), and compiled
with the 5.3 IDO (no gcc here). I got a few warnings about mismatched
pointer types, but nothing apparently to worry about. "make install"
seems fine, and I have a minimal smb.conf in
/usr/local/samba/lib/smb.conf -- checked with testparm and works OK on
a 6.5.19f machine with the same version of samba. I can start smbd and
nmbd with -D, and then (as a normal user) run "smbclient -L MORK" on
the same machine (mork is the machine name). The result is:

$ smbclient -L MORK
added interface ip=xxx.xx.xx.xx bcast=xxx.xx.xx.255 nmask=255.255.255.0
Password:
Domain=[DUNNINGTON] OS=[Unix] Server=[Samba 2.2.9]
tree connect failed: NT_STATUS_REQUEST_NOT_ACCEPTED
$

What it should do, of course, is list the shares. The error means the
server responds but won't accept any [more] connections. It's
obviously broken and the logs give a clue:

# tail log.nmbd
[2004/06/06 22:23:30, 0] tdb/tdbutil.c:(531)
tdb(/usr/local/samba/var/locks/unexpected.tdb): tdb_oob len
1413759544 beyond eof at 8192
[2004/06/06 22:23:30, 0] tdb/tdbutil.c:(531)
tdb(/usr/local/samba/var/locks/unexpected.tdb): tdb_oob len
1413759544 beyond eof at 8192
[2004/06/06 22:23:30, 0] tdb/tdbutil.c:(531)
tdb(/usr/local/samba/var/locks/unexpected.tdb): tdb_read failed at
168 len=4 (Invalid argument)
[2004/06/06 22:23:59, 0] tdb/tdbutil.c:(531)
tdb(/usr/local/samba/var/locks/unexpected.tdb): tdb_oob len
1413759544 beyond eof at 8192
[2004/06/06 22:24:19, 0] tdb/tdbutil.c:(531)
tdb(/usr/local/samba/var/locks/unexpected.tdb): tdb_oob len
1413759544 beyond eof at 8192
# tail log.smbd
[2004/06/06 22:24:07, 0] tdb/tdbutil.c:(531)
tdb(/usr/local/samba/var/locks/connections.tdb): tdb_oob len
1111638618 beyond eof at 16384
[2004/06/06 22:24:07, 0] smbd/connection.c:(188)
claim_connection: tdb_store failed with error IO Error.
[2004/06/06 22:24:07, 1] smbd/service.c:(504)
too many connections - rejected
[2004/06/06 22:24:07, 0] tdb/tdbutil.c:(531)
tdb(/usr/local/samba/var/locks/connections.tdb): tdb_oob len
1111638618 beyond eof at 16384
[2004/06/06 22:24:07, 0] smbd/connection.c:(62)
yield_connection: tdb_delete for name failed with error IO Error.
#

I get the same result with samba-2.2.3a; I plan to try 2.2.4 tonight
because someone suggested in a post I found with Google, that there was
a bugfix between those two versions, and maybe that will help (but I
doubt it).

--
Pete Peter Turnbull
Network Manager
University of York
 
 
 

samba problem on IRIX 5.3

Post by Pete Turnb » Tue, 15 Jun 2004 21:35:34


[ ... ]

Since nobody responded, I fixed it myself :-) Here's what I did, in case
it helps anyone else (the problem exists for all version of Samba between
at least 2.2.3 and 2.2.9, and probably other versions too):

The problem is in configure. It looks for functions called __pread,
_pread, pread, __pwrite, ... and the same with "64" appended. These are
atomic file seek-and-read (or write) ops. Unfortunately IRIX 5.3 has
some undocumented (private?) functions by these names, but they either do
something different, or return a different result, so they're not useful
(one shouldn't use private functions anyway, of course: they're often
private for a reason). Anyway, the way configure tests to see if should
use these (instead of lseek + read) is to create a test file that is more
or less just:

#include <anything_that_looks_useful.h>
(void *)pread();

and see if the compiler barfs on it. It doesn't barf, but the database
code in samba2.2.x/source/tdb/* doesn't work either.

The solution is to comment out four relevant #define HAVE_....s in
samba2.2.x/source/include/config.h

--
Pete Peter Turnbull
Network Manager
University of York