[PATCH] Fix in Git.pm cat_blob crashes on large files (resubmit with reviewed-by)

2013-02-22 Thread Joshua Clayton
Read and write each 1024 byte buffer, rather than trying to buffer the entire content of the file. Previous code would crash on all files 2 Gib, when the offset variable became negative (perhaps below the level of perl), resulting in a crash. On a 32 bit system, or a system with low memory it

Re: [PATCH] Fix in Git.pm cat_blob crashes on large files (resubmit with reviewed-by)

2013-02-22 Thread Jeff King
On Fri, Feb 22, 2013 at 09:30:57AM -0800, Joshua Clayton wrote: Read and write each 1024 byte buffer, rather than trying to buffer the entire content of the file. OK. Did you ever repeat your timing with a larger symmetric buffer? That should probably be a separate patch on top, but it might

Re: [PATCH] Fix in Git.pm cat_blob crashes on large files (resubmit with reviewed-by)

2013-02-22 Thread Junio C Hamano
Joshua Clayton stillcompil...@gmail.com writes: Read and write each 1024 byte buffer, rather than trying to buffer the entire content of the file. Previous code would crash on all files 2 Gib, when the offset variable became negative (perhaps below the level of perl), resulting in a crash.

Re: [PATCH] Fix in Git.pm cat_blob crashes on large files (resubmit with reviewed-by)

2013-02-22 Thread Joshua Clayton
Thanks for all the input and patience. On Fri, Feb 22, 2013 at 10:34 AM, Jeff King p...@peff.net wrote: On Fri, Feb 22, 2013 at 09:30:57AM -0800, Joshua Clayton wrote: Read and write each 1024 byte buffer, rather than trying to buffer the entire content of the file. OK. Did you ever repeat