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

Re: [PATCH jn/fast-import-blob-access] t9300: avoid short reads from dd

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 13, 2010, 07:21 UTC
Message-ID
<7vfwu25e9q.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20101213063151.GB20812@burratino>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 11 quoted lines
> dd is a thin wrapper around read(2).  As open group Issue 7 explains:
>
> 	It shall read the input one block at a time, using the specified
> 	input block size; it shall then process the block of data
> 	actually returned, which could be smaller than the requested
> 	block size.
>
> Any short read --- for example from a pipe whose capacity cannot fill
> a block --- results in that block being truncated.  As a result, the
> first cat-blob test (9300.114) fails on Mac OS X, where the pipe
> capacity is around 8 KiB.

I saw a similar breakage on my FBSD 8 bochs. It is unfortunate and feels yucky that we have to issue 8k+ read(2) of one byte, but I don't think of a better way. I thought it might be possible to specify cbs and/or conv to have the input buffered to a size to defeat the short read issue, but count specifies in terms of input blocks, so there doesn't seem to be a way to do so... Oh well...

Thanks.
Previous: Jonathan NiederNext: Jonathan Nieder
Message 5 of 6 in “SIGPIPE in t9300-fast-import”
  1. Brian GernhardtDec 12, 2010
  2. Jonathan NiederDec 12, 2010
  3. Brian GernhardtDec 12, 2010
  4. t9300: avoid short reads from ddJonathan Nieder, Dec 13, 2010
  5. Junio C HamanoDec 13, 2010
  6. t9300: use perl "head -c" clone in place of "dd bs=1 count=16000" klugeJonathan Nieder, Dec 13, 2010

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.