[darcs-devel] [issue2556] apply fails with 'hGetBuf: invalid argument (Invalid argument)' for large patch bundle

Ben Franksen bugs at darcs.net
Fri Nov 3 10:44:35 UTC 2017


Ben Franksen <ben.franksen at online.de> added the comment:

Sorry for the latency, I was pretty much distracted by other stuff.

gzFetchFilePS reads the whole file into a strict ByteString. It uses
mmapFilePS unless mingw32_HOST_OS is true as a preprocessor symbol.
Looking at the docs for System.IO.MMap I see that Windows is supported
as well. Perhaps we should remove the #if here and use mmap unconditionally?

There is one more detail where reading from stdin differs: in isGZFile
we seek and read off the number of bytes from the last 4 bytes in the
file and return an Int. I think this fails if the size is greater than
2^31. This is the code:

       else do hSeek h SeekFromEnd (-4)
               len <- hGetLittleEndInt h

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue2556>
__________________________________


More information about the darcs-devel mailing list