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

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

From
Jeff King <peff@peff.net>
Date
Mar 8, 2011, 21:14 UTC
Message-ID
<20110308211423.GB4594@sigill.intra.peff.net>
In-Reply-To
<7vzkpa7qmp.fsf@alter.siamese.dyndns.org>
On Fri, Mar 04, 2011 at 09:16:30AM -0800, Junio C Hamano wrote:
Show 19 quoted lines
> How prevalent is the problematic cygwin1.dll 1.7.8?  Also for how long did
> this bug exist, in other words, if we were to make a table of problematic
> versions, would we have only just a handful entries in it?  Also can we at
> runtime find out what version we are running?
> 
> The reason I am asking these questions is because I think, assuming that
> this would affect many unsuspecting Cygwin users, the best fix would be to
> add a hook in the compat/ layer that decides if MAX_WRITE_SIZE workaround
> is necessary at runtime, and do something like this:
> 
> 	ssize_t xwrite(int fd, const void *buf, size_t len)
>         {
>         	ssize_t nr;
>                 static size_t max_write_size = platform_max_write_size();
> 
>                 if (max_write_size && max_write_size < len)
>                 	len = max_write_size;
> 		...
> 	}
How are we doing the runtime test for platform max write?

If I read the original bug report correctly, the problem was that write would actually write some bytes _and_ return -1, which is terrible. We can detect "seems to be returning -1 over and over", but we can't handle a misbehavior like writing and claiming not to have done so.

So I think the test needs to be "is our version of cygwin in the broken list" and not "let's try a few different writes and see what works".

But it is still not clear to me how many versions have this bug. I think the next stop is to show the cygwin developers a clear test-case and see whether it's already fixed, and which versions show the behavior. They should be able to get that information much more easily than us. I really don't want to get involved in bisecting bugs in cygwin (according to cygwin.com, it's kept in CVS. Blech).

Robert, can you try (or have you already tried) submitting a bug report to Cygwin?

-Peff
Previous: Robert WruckNext: Junio C Hamano
Message 7 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.