Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Oct 1998 12:09:46 -0700 (PDT)
From:      jegelhof@cloud9.net
To:        freebsd-gnats-submit@FreeBSD.ORG
Subject:   kern/8345: mmap(2) hangs when dealing with certain files on NFS
Message-ID:  <199810161909.MAA17713@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help


>Number:         8345
>Category:       kern
>Synopsis:       mmap(2) hangs when dealing with certain files on NFS
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 16 12:10:00 PDT 1998
>Last-Modified:
>Originator:     James Egelhof
>Organization:
Cloud 9 Consulting, Inc.
>Release:        FreeBSD 2.2.7-STABLE
>Environment:
FreeBSD earl-grey.cloud9.net 2.2.7-STABLE FreeBSD 2.2.7-STABLE #0: 
Sat Sep  5 20:17:50 EDT 1998     
jegelhof@earl-grey.cloud9.net:/usr/src/sys/compile/EARL-GREY  i386

FreeBSD russian-caravan.cloud9.net 2.2.7-STABLE FreeBSD 2.2.7-STABLE #0:
Mon Oct 12 18:18:49 EDT 1998     
root@earl-grey.cloud9.net:/usr/src/sys/compile/RUSSIAN-CARAVAN  i386
>Description:
Programs that use mmap(2) can hang in the "vmopar" state.  Programs
stuck in that state cannot be killed or revived except by rebooting.

This problem happens when the file being read via mmap is mounted over
from another machine via NFS, and the file is appended to on the far
machine.  mmap fails regardless of the size of the file or of the 
append.
>How-To-Repeat:
Let's say that the NFS server is "Machine 1" and the client is
"Machine 2."

Mount a filesystem from Machine 1 onto Machine 2.  Let's say the
mount point is /mnt.

Create a file of nontrivial length in /mnt; say, /mnt/test.

Next we need to use a mmap-based utility that will run for a while.  
Good examples are sz (from the ports collection), cp (if the file is 
<8MB), and tail.  sz is especially good because it will run for a while.

machine1> sz /mnt/test
[download begins]
machine2> echo foo >> /the/filesystem/test
[download dies]

This will be the output from ps uxl:

jegelhof  5539  0.0  0.2   228  536  p9- D     2:43PM    0:00.05 
sz test2 (lsz)     349  5539     1   0 -18  0   228  536 vmopar D     
p9-   0:00.05 sz test2 (lsz)

This problem does not occur if you disable the mmap code in the
relevant appplication.

We have tested this on a variety of hardware and with several
different network configurations.  This has been done with 10MB
Ethernet, 10MB switched Ethernet, and 100MB switched Ethernet.

We currently use Intel EtherExpress Pro 10/100B network cards and a
Cisco Catalyst 2900XL 100MB switch.
>Fix:
Workaround is to disable mmap on every utility you use on NFS files.  
That is not a very good workaround because many FreeBSD standard 
utilities depend on mmap.

Otherwise, mmap needs to be able to handle file size changes on
NFS filesystems.
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810161909.MAA17713>