Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Dec 2000 09:35:13 -0800
From:      Alfred Perlstein <bright@wintelcom.net>
To:        "G. Adam Stanislav" <adam@whizkidtech.net>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: A bug in mmap?
Message-ID:  <20001222093512.L19572@fw.wintelcom.net>
In-Reply-To: <20001222112836.A239@whizkidtech.net>; from adam@whizkidtech.net on Fri, Dec 22, 2000 at 11:28:36AM -0600
References:  <20001222112836.A239@whizkidtech.net>

next in thread | previous in thread | raw e-mail | index | archive | help
* G. Adam Stanislav <adam@whizkidtech.net> [001222 09:30] wrote:
> 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.

Most likely a result of a bug in the msdosfs code, perhaps you can
help track it down?  I don't use msdosfs. :(

-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."


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?20001222093512.L19572>