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

Re: fact-import: failed to apply delta

From
Shawn O. Pearce <spearce@spearce.org>
Date
Feb 10, 2009, 15:56 UTC
Message-ID
<20090210155626.GM30949@spearce.org>
In-Reply-To
<alpine.DEB.1.00.0902101126040.10279@pacific.mpi-cbg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 16 quoted lines
> On Mon, 9 Feb 2009, Daniel Barkalow wrote:
> 
> > I'm getting a "fatal: failed to apply delta" from fast-import. I'm using 
> > a lot of checkpoints, and I haven't had it happen without making 
> > progress, so I was eventually able to import what I was importing (bunch 
> > of stuff I can't distribute, imported from perforce with the latest 
> > version of my p4 importer that I'm still working on). Also, everything 
> > that was saved by the checkpoints was valid and correct (at least after 
> > the fact).
> > 
> > I'm going to see if it's reproducable, and, if so, if I can get a test 
> > case that I can distribute, but I wanted to post to see if anyone had 
> > any special debugging advice for this error message and program 
> > combination.
> 
> I see three likely candidates: two in index-pack.c and one in sha1_file.c.  

It has to be the one in sha1_file.c. fast-import never calls into the code in index-pack.c.

> My advice: instrument the code (IOW litter the code with debug output that 
> tells you where it did what), and then run it on the same test case you 
> had the problems.

My initial guess is, we're probably having trouble reading from the pack we are writing. This shouldn't be possible; fast-import uses an index of all objects in memory to locate the byte offset and then reads from that block.

I wonder if this is a write(2) vs. mmap(2) inconsistency in the VM system of your OS. fast-import plays some games here where it is actively writing into areas that might have been mmap'd. We should be closing the existing mmap's and opening them again when we switch from writing to reading (see gfi_unpack_entry), but if that's failing for some reason then we might be trying to read a VM page which isn't correctly initialized, and the delta isn't valid, and we can't inflate it.

-- 
Shawn.
Previous: Johannes SchindelinNext: Daniel Barkalow
Message 3 of 24 in “fact-import: failed to apply delta”
  1. Daniel BarkalowFeb 10, 2009
  2. Johannes SchindelinFeb 10, 2009
  3. Shawn O. PearceFeb 10, 2009
  4. Daniel BarkalowFeb 10, 2009
  5. Shawn O. PearceFeb 10, 2009
  6. Daniel BarkalowFeb 10, 2009
  7. Shawn O. PearceFeb 10, 2009
  8. Daniel BarkalowFeb 10, 2009
  9. Shawn O. PearceFeb 10, 2009
  10. Daniel BarkalowFeb 10, 2009
  11. Shawn O. PearceFeb 10, 2009
  12. Daniel BarkalowFeb 10, 2009
  13. Shawn O. PearceFeb 10, 2009
  14. Daniel BarkalowFeb 10, 2009
  15. Junio C HamanoFeb 10, 2009
  16. Junio C HamanoFeb 10, 2009
  17. Shawn O. PearceFeb 10, 2009
  18. Junio C HamanoFeb 10, 2009
  19. Shawn O. PearceFeb 10, 2009
  20. Junio C HamanoFeb 10, 2009
  21. Daniel BarkalowFeb 11, 2009
  22. Shawn O. PearceFeb 11, 2009
  23. Junio C HamanoFeb 11, 2009
  24. Daniel BarkalowFeb 11, 2009

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.