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

[PATCH 0/2] pack-objects: more brown-paper-bag multi-pack reuse fixes

From
Taylor Blau <me@ttaylorr.com>
Date
Nov 13, 2024, 17:32 UTC
Message-ID
<cover.1731518931.git.me@ttaylorr.com>

While starting to use multi-pack reuse in more places throughout GitHub, I noticed a rare but persistent segfault, which is the result of a broken assumption in write_reused_pack_verbatim().

The first patch demonstrates the problem, and the second patch fixes it. The second patch explains the broken assumption in detail, but the gist is that we can't infer that an all-1s word in the reuse bitmap from a non-preferred pack means that we want all objects between the ones corresponding to the first and last bit.

I'm fairly disappointed that I didn't catch this obviously-broken implementation during the original development of this feature, or in the first round of bugfixes. But these patches should conclusively resolve at least this issue.

Thanks in advance for your review!
Taylor Blau (2):
  t5332-multi-pack-reuse.sh: demonstrate duplicate packing failure
  pack-objects: only perform verbatim reuse on the preferred pack
 builtin/pack-objects.c      | 101 +++++++++++++++---------------------
 t/t5332-multi-pack-reuse.sh |  23 ++++++++
 2 files changed, 66 insertions(+), 58 deletions(-)
base-commit: 25b0f41288718625b18495de23cc066394c09a92
-- 
2.46.0.421.g159f2d50e75
Next: Taylor Blau
Message 1 of 14 in “pack-objects: more brown-paper-bag multi-pack reuse fixes”
  1. 0/2 pack-objects: more brown-paper-bag multi-pack reuse fixesTaylor Blau, Nov 13, 2024
  2. 1/2 t5332-multi-pack-reuse.sh: demonstrate duplicate packing failureTaylor Blau, Nov 13, 2024
  3. Junio C HamanoNov 14, 2024
  4. Taylor BlauNov 14, 2024
  5. 2/2 pack-objects: only perform verbatim reuse on the preferred packTaylor Blau, Nov 13, 2024
  6. Jeff KingNov 14, 2024
  7. Taylor BlauNov 14, 2024
  8. Jeff KingNov 15, 2024
  9. Kristoffer HaugsbakkNov 22, 2024
  10. 0/2 pack-objects: more brown-paper-bag multi-pack reuse fixesTaylor Blau, Nov 14, 2024
  11. 1/2 t5332-multi-pack-reuse.sh: demonstrate duplicate packing failureTaylor Blau, Nov 14, 2024
  12. 2/2 pack-objects: only perform verbatim reuse on the preferred packTaylor Blau, Nov 14, 2024
  13. Junio C HamanoNov 22, 2024
  14. Jeff KingNov 22, 2024

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.