git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] pack-objects: more brown-paper-bag multi-pack reuse fixes
@ 2024-11-13 17:32 Taylor Blau
  2024-11-13 17:32 ` [PATCH 1/2] t5332-multi-pack-reuse.sh: demonstrate duplicate packing failure Taylor Blau
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Taylor Blau @ 2024-11-13 17:32 UTC (permalink / raw)
  To: git; +Cc: Jeff King, Junio C Hamano, Elijah Newren

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-11-22  9:17 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-13 17:32 [PATCH 0/2] pack-objects: more brown-paper-bag multi-pack reuse fixes Taylor Blau
2024-11-13 17:32 ` [PATCH 1/2] t5332-multi-pack-reuse.sh: demonstrate duplicate packing failure Taylor Blau
2024-11-14  1:12   ` Junio C Hamano
2024-11-14 13:37     ` Taylor Blau
2024-11-13 17:32 ` [PATCH 2/2] pack-objects: only perform verbatim reuse on the preferred pack Taylor Blau
2024-11-14  0:25   ` Jeff King
2024-11-14 13:40     ` Taylor Blau
2024-11-15  9:57       ` Jeff King
2024-11-22  9:16       ` Kristoffer Haugsbakk
2024-11-14 13:42 ` [PATCH v2 0/2] pack-objects: more brown-paper-bag multi-pack reuse fixes Taylor Blau
2024-11-14 13:42   ` [PATCH v2 1/2] t5332-multi-pack-reuse.sh: demonstrate duplicate packing failure Taylor Blau
2024-11-14 13:42   ` [PATCH v2 2/2] pack-objects: only perform verbatim reuse on the preferred pack Taylor Blau
2024-11-22  4:44     ` Junio C Hamano
2024-11-22  8:33       ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).