Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Dec 2000 11:28:36 -0600
From:      "G. Adam Stanislav" <adam@whizkidtech.net>
To:        hackers@FreeBSD.org
Subject:   A bug in mmap?
Message-ID:  <20001222112836.A239@whizkidtech.net>

next in thread | raw e-mail | index | archive | help
I think I have just discovered a bug... (FreeBSD 3.1).

Here is the scenario: The program (I have written) opens a file as O_RDWR,
then uses mmap with PROT_READ | PROT_WRITE and MAP_SHARED. It works on
the data, optionally reduces the file size, then unmaps and closes it.

Everything works fine as long as the file is on a native FreeBSD disk.
But if it is on a Windows formatted hard drive mounted under FreeBSD,
*sometimes* the file ends up filled with NULs.

Could it be mmap may get confused by a Windows formated drive? It does NOT
return an error, but it fills the mapped area with zeros. It overwrites
the contents of the file with zeros, but does not change the directory
information (i.e., the time of the last access, and such).

It never happens on a FreeBSD drive, only on a Windows formated drive,
which makes it rather spooky.

Adam

-- 
Apply standard disk lamer


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




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