Subject: kern/24516: mmap not fully functional with smbfs
To: None <gnats-bugs@gnats.NetBSD.org>
From: Lloyd Parkes <lloyd@must-have-coffee.gen.nz>
List: netbsd-bugs
Date: 02/22/2004 12:32:53
>Number:         24516
>Category:       kern
>Synopsis:       open/mmap/close doesn't work like it should
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 21 23:34:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Lloyd Parkes
>Release:        NetBSD 1.6ZH Jan 26 2004
>Organization:
Must Have Coffee
>Environment:
System: NetBSD archangel.must-have-coffee.gen.nz 1.6ZH NetBSD 1.6ZH (Archangel) #0: Thu Feb 19 20:33:16 NZDT 2004 lloyd@archangel.must-have-coffee.gen.nz:/vol/build/NetBSD/src-current/sys/arch/sparc64/compile/Archangel sparc64
Architecture: sparc64
Machine: sparc64
>Description:

I have a program that opens a file, mmaps it and the closes it. The
mmaped data is then used. This program works if the file is on a local
file system, but not if the file is on a remote XP box. If I don't
close the file, then it all works as expected (until I run out of file
descriptors). The program fails with SIGSEGV as soon as tries to
access the mamped memory after the file is closed.

>How-To-Repeat:

  fd = open (filename, O_RDONLY);
  fstat (fd, &sb);
  memory = mmap (NULL, sb.st_size, PROT_READ, MAP_FILE|MAP_PRIVATE, fd, 0);
  close (fd);


>Fix:
Unknown.
>Release-Note:
>Audit-Trail:
>Unformatted: