git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG] git cat-file does not terminate

From
PBPeter Baumann <waste.manager@gmx.de>
Date
Mar 4, 2011, 15:40 UTC
Message-ID
<20110304154014.GE24660@m62s10.vlinux.de>
In-Reply-To
<4D70E340.3050309@tweerlei.de>
On Fri, Mar 04, 2011 at 02:04:00PM +0100, Robert Wruck wrote:
Show 31 quoted lines
> Hi,
> 
> this is some strange behaviour of cat-file:
> On a certain file, `git cat-file blob <objectname>` writes an
> endless stream repeating the first 4096 byte of the original file.
> cat-file -s and cat-file -t produce correct results.
> 
> Even stranger: This only happens with cygwin-git (1.7.4.1).
> msysgit (same machine, same repository): works
> linux-git (same machine, same repository): works
> 
> Even more strange: This only happens with cygwin on a particular
> machine (recent cygwin1.dll 1.7.8) under WinXP/32bit. On another
> machine, recent cygwin, Windows7/64bit it works...
> 
> Debugging a bit, I found that the following happens:
> In xwrite (wrapper.c), write() is called with the total file size -
> in my case about 87 MB. This call returns -1 and EAGAIN but
> nevertheless writes 4096 byte to the output fd. I don't think that's
> expected behaviour...
> 
> I "fixed" it by limiting each write to 64k (thus looping in
> write_in_full) but maybe somebody knows about that cygwin behaviour?
> 
> This seems to be the cause of the dreaded "No newline found after
> blob" when running `git svn clone` under cygwin on a repository with
> large files.
> 
> You could argue that this is a cygwin bug but maybe limiting each
> write to a maximum size is a simple workaround.
> 

Maybe you could post a patch, so everyone can see the technical implications and discuss the fix?

-Peter
Previous: Robert WruckNext: Jeff King
Message 2 of 12 in “[BUG] git cat-file does not terminate”
  1. Robert WruckMar 4, 2011
  2. Peter BaumannMar 4, 2011
  3. Jeff KingMar 4, 2011
  4. Junio C HamanoMar 4, 2011
  5. Robert WruckMar 4, 2011
  6. Robert WruckMar 4, 2011
  7. Jeff KingMar 8, 2011
  8. Junio C HamanoMar 8, 2011
  9. Robert WruckMar 9, 2011
  10. Junio C HamanoMar 9, 2011
  11. Robert WruckMar 9, 2011
  12. Jeff KingMar 9, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.