mmap over NFS fails on binaries and shared libs in 2.1.61?

Richard Jones (rjones@imcl.com)
Mon, 10 Nov 1997 15:56:56 +0000


I don't know if anyone's seen this. Apologies in advance if
it is a well-known bug.

Since installing 2.1.61 + Dave's CVS patches (971103), some
binaries and shared libraries fail to work, but only when
they are on NFS-mounted drives.

For example, an strace running RTIN from an NFS mounted drive:

whistler:~$strace rtin
execve("/usr/local/i386-unknown-linux/bin/rtin", ["rtin"], [/* 34 vars */]) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40007000
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++

(Runs fine from /tmp)

Similarly, libmediatool.so.0.0.6 (from KDE Beta 1) fails
in mmap() when it's loaded from an NFS drive, but not when
I get it from /tmp. In this case, the error is slightly
different:

[extract from strace ...]

open("/usr/local/i386-unknown-linux/lib/kde-beta-1/lib/libmediatool.so.0", O_RDO
NLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 16384, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4000c000
mmap(0x4000c000, 9535, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x400
0c000
mmap(0x4000f000, 1756, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x2000) =
-1 EINVAL (Invalid argument)
write(2, "ls: can\'t map \'/usr/local/i386"..., 83ls: can't map '/usr/local/i386
-unknown-linux/lib/kde-beta-1/lib/libmediatool.so.0'
) = 83

Has anyone seen this before? It only affects certain programs/
libraries. Lots of things still run OK from NFS.

I haven't tried 2.1.62 yet, but a quick glance seems to show
that there are no patches in there that should affect mmap.

The client: Linux 2.1.61 + CVS 971103, -o nolock
The server: Linux 2.0.30, NFS server 2.2beta29

Rich.

-- 
Richard Jones  rjones@imcl.com  Tel: +44 171 460 6141  Fax: .. 4461
ABLE INmEDIA Ltd.  262a Fulham Rd.  London  SW10 9EL.  "you'll write in
PGP: www.four11.com     telegraphic, or you won't write at all" [Céline]