From owner-freebsd-bugs Mon Jun 23 04:10:03 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id EAA28149 for bugs-outgoing; Mon, 23 Jun 1997 04:10:03 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.5/8.8.5) id EAA28143; Mon, 23 Jun 1997 04:10:01 -0700 (PDT) Resent-Date: Mon, 23 Jun 1997 04:10:01 -0700 (PDT) Resent-Message-Id: <199706231110.EAA28143@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, pine@math.okayama-u.ac.jp Received: from decpc5.math.okayama-u.ac.jp (decpc5.math.okayama-u.ac.jp [150.46.179.59]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id EAA27965 for ; Mon, 23 Jun 1997 04:04:51 -0700 (PDT) Received: (from pine@localhost) by decpc5.math.okayama-u.ac.jp (8.6.12/8.6.12) id UAA17960; Mon, 23 Jun 1997 20:14:52 +0900 Message-Id: <199706231114.UAA17960@decpc5.math.okayama-u.ac.jp> Date: Mon, 23 Jun 1997 20:14:52 +0900 From: pine@math.okayama-u.ac.jp Reply-To: pine@math.okayama-u.ac.jp To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: kern/3938: Problem about mmap() over NFS Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 3938 >Category: kern >Synopsis: Problem about mmap() over NFS >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jun 23 04:10:00 PDT 1997 >Last-Modified: >Originator: Hiroaki Komatsu >Organization: Okayama University >Release: FreeBSD 2.1-STABLE i386 >Environment: NFS server: SPARC station 20 running SunOS 4.1.3 NFS client: FreeBSD 2.2.2-RELEASE FreeBSD 2.2.1-RELEASE FreeBSD 2.1.0-RELEASE >Description: An ftp command `get foo' between different NFS clients for a remote file `foo' of NFS causes ftpd to be frozen. >How-To-Repeat: I think that the following program causes the same trouble, when an argument is a remote file of NFS, say `foo'. While the program is sleeping 10 seconds, if another machine executes `echo >foo' then write() call can not return. ------------------------------------------------------------ #include #include main(int argc, char *argv[]) { FILE *fin; char *buf; if (argc != 2 || (fin = fopen(argv[1], "r")) == NULL) { fprintf(stderr, "Usage: %s file\n", argv[0]); exit(1); } fprintf(stderr, "sleep 10 seconds ...\n"); sleep(10); buf = mmap(0, 1, PROT_READ, MAP_SHARED, fileno(fin), 0); if ((int)buf == -1) { fprintf(stderr, "? mmap\n"); exit(1); } write(1, buf, 1); } >Fix: >Audit-Trail: >Unformatted: