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

Delitifier broken (Re: diff-core segfault)

From
Junio C Hamano <junkio@cox.net>
Date
Dec 12, 2005, 18:59 UTC
Message-ID
<7virtui1kj.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<7vmzj6i206.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 7 quoted lines
> Darrin Thompson <darrint@progeny.com> writes:
>
>> Could someone confirm that this exists on more recent git heads and fix
>> if needed?
>
> (1) Yup.  I can reproduce it.
> (2) Will look into it when able.

This is not just "diff". Our deltify code is half-broken, and in the worst case this can corrupt our packs if an empty blob is involved.

The problem is if from_size or to_size is empty, it does not produce any.

        if (!from_size || !to_size || delta_prepare(from_buf, from_size, &bdf))
                return NULL;
	

I think either we need to make the users more careful or fix deltifier to produce trivial delta. I'd vote for the latter; let me rig up something.

Previous: Junio C HamanoNext: Nicolas Pitre
Message 4 of 15 in “diff-core segfault”
  1. Darrin ThompsonDec 12, 2005
  2. Johannes SchindelinDec 12, 2005
  3. Junio C HamanoDec 12, 2005
  4. Delitifier broken (Re: diff-core segfault)Junio C Hamano, Dec 12, 2005
  5. Nicolas PitreDec 12, 2005
  6. Junio C HamanoDec 12, 2005
  7. Linus TorvaldsDec 12, 2005
  8. Junio C HamanoDec 13, 2005
  9. Linus TorvaldsDec 13, 2005
  10. Junio C HamanoDec 13, 2005
  11. Linus TorvaldsDec 13, 2005
  12. Nicolas PitreDec 13, 2005
  13. Junio C HamanoDec 13, 2005
  14. 2/2 diff-delta.c: allow delta with empty blob.Junio C Hamano, Dec 12, 2005
  15. Darrin ThompsonDec 12, 2005

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.