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

Re: index-pack died on pread

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jul 25, 2007, 23:44 UTC
Message-ID
<alpine.LFD.0.999.0707251636490.3607@woody.linux-foundation.org>
In-Reply-To
<200707260115.13234.robin.rosenberg.lists@dewire.com>
On Thu, 26 Jul 2007, Robin Rosenberg wrote:
> 
> Does cygwin have the same pread problem then.. ? after make NO_PREAD=1 with 1.5.2.4
> clone works.
Interesting.

It's true that pread() is used much less than normal reads, and maybe the cygwin pread() is indeed broken. But it's intriguing how apparently both HP-UX and Cygwin are showing the same breakage.

But if git was doing something odd with pread(), then NO_PREAD shouldn't work either, because that just enables the exact same code, except we now supply a pread emulation library function (which does it using "lseek()": not a *good* emulation, but good enough for the very limited use that git puts it to).

So yeah, it looks like pread() is broken under cygwin and hpux-11.11.

Googling for "pread" "cygwin" does seem to show that it's been buggy at times. Eg:

	Fixes since 1.5.21-1:
	...
	- Fix pread in case current file offset is non-zero. (Hideki Iwamoto)

but I'm a bit surprised that hp-ux has the bug. pread isn't *that* complex.

		Linus
Previous: Robin RosenbergNext: Alex Riesen
Message 8 of 17 in “index-pack died on pread”
  1. Michal RokosJul 23, 2007
  2. Alex RiesenJul 23, 2007
  3. Michal RokosJul 25, 2007
  4. Alex RiesenJul 25, 2007
  5. Linus TorvaldsJul 23, 2007
  6. Nicolas PitreJul 23, 2007
  7. Robin RosenbergJul 25, 2007
  8. Linus TorvaldsJul 25, 2007
  9. Alex RiesenJul 26, 2007
  10. Linus TorvaldsJul 26, 2007
  11. Alex RiesenJul 26, 2007
  12. Linus TorvaldsJul 26, 2007
  13. Junio C HamanoJul 27, 2007
  14. Linus TorvaldsJul 27, 2007
  15. Tomash BrechkoJul 27, 2007
  16. Tomash BrechkoJul 27, 2007
  17. Nicolas PitreJul 27, 2007

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.