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

Re: "failed to read delta base object at..."

From
Nicolas Pitre <nico@cam.org>
Date
Aug 27, 2008, 20:46 UTC
Message-ID
<alpine.LFD.1.10.0808271627540.1624@xanadu.home>
In-Reply-To
<alpine.LFD.1.10.0808271222250.3363@nehalem.linux-foundation.org>
On Wed, 27 Aug 2008, Linus Torvalds wrote:
Show 8 quoted lines
> On Wed, 27 Aug 2008, Nicolas Pitre wrote:
> 
> > However, in the pack-objects case, it is almost impossible to have such 
> > a corruption since the data is SHA1 summed immediately before being 
> > written out.
> 
> Yes. Anything that uses the "sha1write()" model (which includes the 
> regular pack-file _and_ the index) should generally be pretty safe. 

What that means is that if git was the cause of the corruption itself then the pack would still match its checksum (verify-pâck would still fail nevertheless).

Show 10 quoted lines
> However, we do have this odd case of fixing up the pack after-the-fact 
> when we receive it from somebody else (because we get a thin pack and 
> don't know how many objects the final result will have). And that case 
> seems to be not as safe, because it
> 
>  - re-reads the file to recompute the SHA1
> 
>    This is understandable, and it's fairly ok, but it does mean that there 
>    is a bigger chance of the SHA1 matching if something has corrupted the 
>    file in the meantime!

I think that can be fixed. When reading the file back, it is possible to compute 2 sha1s: one to compare with the recieved one using original pack header, and the second which would be the final one. FRom a certain offset, new objects were added, so that first sha1 is validated against the received one and reset, and at the end, it should correspond to the sha1 of added objects that we should compute when writing them.

Nicolas
Previous: Linus TorvaldsNext: J. Bruce Fields
Message 14 of 16 in “"failed to read delta base object at..."”
  1. J. Bruce FieldsAug 25, 2008
  2. Nicolas PitreAug 25, 2008
  3. J. Bruce FieldsAug 25, 2008
  4. Linus TorvaldsAug 25, 2008
  5. J. Bruce FieldsAug 25, 2008
  6. Linus TorvaldsAug 25, 2008
  7. J. Bruce FieldsAug 25, 2008
  8. Linus TorvaldsAug 25, 2008
  9. Jason McMullanAug 26, 2008
  10. Jason McMullanAug 26, 2008
  11. Linus TorvaldsAug 27, 2008
  12. Nicolas PitreAug 27, 2008
  13. Linus TorvaldsAug 27, 2008
  14. Nicolas PitreAug 27, 2008
  15. J. Bruce FieldsAug 26, 2008
  16. Junio C HamanoAug 27, 2008

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.