git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: What's cooking in git.git (Sep 2018, #04; Thu, 20)
Date: Mon, 1 Oct 2018 21:16:07 +0200	[thread overview]
Message-ID: <c5f7009b-53b5-26b9-8a01-b8648ee33a15@web.de> (raw)
In-Reply-To: <xmqqin2zxw55.fsf@gitster-ct.c.googlers.com>

Am 21.09.2018 um 07:22 schrieb Junio C Hamano:
> * cc/delta-islands (2018-08-16) 7 commits
>   (merged to 'next' on 2018-08-27 at cf3d7bd93f)
>  + pack-objects: move 'layer' into 'struct packing_data'
>  + pack-objects: move tree_depth into 'struct packing_data'
>  + t5320: tests for delta islands
>  + repack: add delta-islands support
>  + pack-objects: add delta-islands support
>  + pack-objects: refactor code into compute_layer_order()
>  + Add delta-islands.{c,h}
> 
>  Lift code from GitHub to restrict delta computation so that an
>  object that exists in one fork is not made into a delta against
>  another object that does not appear in the same forked repository.

> * jk/pack-delta-reuse-with-bitmap (2018-08-21) 6 commits
>   (merged to 'next' on 2018-08-22 at fc50b59dab)
>  + pack-objects: reuse on-disk deltas for thin "have" objects
>  + pack-bitmap: save "have" bitmap from walk
>  + t/perf: add perf tests for fetches from a bitmapped server
>  + t/perf: add infrastructure for measuring sizes
>  + t/perf: factor out percent calculations
>  + t/perf: factor boilerplate out of test_perf
>  (this branch is used by jk/pack-objects-with-bitmap-fix.)
> 
>  When creating a thin pack, which allows objects to be made into a
>  delta against another object that is not in the resulting pack but
>  is known to be present on the receiving end, the code learned to
>  take advantage of the reachability bitmap; this allows the server
>  to send a delta against a base beyond the "boundary" commit.

Not sure if it's the interaction of the two topics or if only one of
them is to blame, but the result of the merge can dereference a NULL
pointer.  Found using Clang's UBSan and t5310.

Here's a patch that avoids the issue, but I don't know if it's the
right thing to do -- should we rather treat a non-existing base as
"not from the same island" instead?

And it's certainly ugly -- that condition is complicated enough
already.  Splitting it up in a nice way would probably help, but how?

---
 builtin/pack-objects.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index e6316d294d..9abed4a0f0 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1559,7 +1559,8 @@ static void check_object(struct object_entry *entry)
 		    (base_entry = packlist_find(&to_pack, base_ref, NULL)) ||
 		    (thin &&
 		     bitmap_has_sha1_in_uninteresting(bitmap_git, base_ref))) &&
-		    in_same_island(&entry->idx.oid, &base_entry->idx.oid)) {
+		    (!base_entry ||
+		     in_same_island(&entry->idx.oid, &base_entry->idx.oid))) {
 			/*
 			 * If base_ref was set above that means we wish to
 			 * reuse delta data, and either we found that object in
-- 
2.19.0

  parent reply	other threads:[~2018-10-01 19:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-21  5:22 What's cooking in git.git (Sep 2018, #04; Thu, 20) Junio C Hamano
2018-09-21 14:30 ` Segfault in master due to 4fbcca4eff Ævar Arnfjörð Bjarmason
2018-09-21 14:34   ` Derrick Stolee
2018-09-21 14:40     ` Ævar Arnfjörð Bjarmason
2018-09-21 14:53       ` Derrick Stolee
2018-09-21 15:55         ` Junio C Hamano
2018-09-21 23:37           ` Ævar Arnfjörð Bjarmason
2018-09-21 23:45             ` Jeff King
2018-09-21 23:49               ` Ævar Arnfjörð Bjarmason
2018-09-21 17:05 ` What's cooking in git.git (Sep 2018, #04; Thu, 20) Johannes Sixt
2018-09-21 17:17   ` Junio C Hamano
2018-09-23 21:39 ` Paul-Sebastian Ungureanu
2018-10-01 19:16 ` René Scharfe [this message]
2018-10-01 20:12   ` Jeff King
2018-10-01 21:37     ` René Scharfe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c5f7009b-53b5-26b9-8a01-b8648ee33a15@web.de \
    --to=l.s.r@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).