[darcs-users] darcs patch: Handle empty files in mmapFilePS. Also cater for FD sh...

Petr Rockai me at mornfall.net
Wed Feb 4 17:33:46 UTC 2009


Hi,

Eric Kow <eric.kow at gmail.com> writes:
> I'm getting the error 'System.IO.Posix.MMap.mmapFile: unable to mmap file'
> when I run the test suite (cabal test)
One possible problem that I have anticipated (but didn't address, wonder why)
is that empty files cannot be mmap'd. I have a fix for that in
hashed-storage. Moreover, FDs can run out much more easily with extensive mmap
use, since GC does not feel the pressure of many files mmap'd (probably not
this case though).

It turns out that this is indeed the empty file problem. Sorry to not have ran
the testsuite... Unfortunately none of the bots currently have bytestring-mmap,
it seems.

Anyhow, the patch is attached.

Wed Feb  4 18:29:53 CET 2009  Petr Rockai <me at mornfall.net>
  * Handle empty files in mmapFilePS. Also cater for FD shortage.

Yours,
   Petr.

PS: The patch also changes one occurence of Prelude.catch to
Control.Exception.catch. Hopefully that doesn't change semantics of
anything. Prelude.catch is unable to catch the mmap error, and is generally
unreliable as far as I can tell.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-darcs-patch
Size: 102227 bytes
Desc: A darcs patch for your repository!
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20090204/43229d3f/attachment-0001.bin 


More information about the darcs-users mailing list