git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Elijah Newren <newren@gmail.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Alex Riesen" <alexander.riesen@cetitec.com>,
	"Git Mailing List" <git@vger.kernel.org>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: Re: Crashes in t/t4058-diff-duplicates.sh
Date: Mon, 9 May 2022 20:50:06 -0700	[thread overview]
Message-ID: <CABPp-BHyNw0dj=mh65pb9HirGFFTxF1+Kky_T4NUxFKANPE2yQ@mail.gmail.com> (raw)
In-Reply-To: <Ynkx/nI67uOUDhL9@nand.local>

On Mon, May 9, 2022 at 8:23 AM Taylor Blau <me@ttaylorr.com> wrote:
>
> On Fri, May 06, 2022 at 09:14:07PM -0700, Elijah Newren wrote:
> > > That commit talks about "trees with duplicate entries".  Does it
> > > mean a bad history where a tree object has two or more entries under
> > > the same name?
> >
> > Yes.
> >
> > > We should of course be catching these things at fsck
> > > time and rejecting at network transfer time, but I agree it is not a
> > > good excuse for us to segfault.  We should diagnose it as a broken
> > > tree object and actively refuse to proceed by calling die().
>
> Elijah would be able to comment more authoritatively than I could about
> whether or not these are easily detect-able. If they are, then I think
> it'd be worth doing so and calling die(). But they may be tricker, I
> don't know.

It's been a couple years, so I don't remember much.  I think the way I
discovered these issues was that in order to make sure some other code
changes of mine didn't regress on some issues, I was attempting to
recreate problematic cases that had been covered by the code I was
restructuring.  The existing tests related to that code had some
problems, so I was modifying/creating my own testcases, and I
misunderstood the setup of those tests and the checks behind them and
ended up creating trees broken in a *different* way and which was not
covered by the existing code anywhere.  I was already a few tangents
from the focus of my work at the time (the new merge backend), so I
don't think I investigated whether these were easily detectable.  I do
remember being concerned that the necessary checks might be expensive,
and feeling that it'd be unfortunate to add expensive checks for
issues that no one had ever triggered in 15.5 years, and which I only
discovered due to intentionally trying to create a broken tree but
accidentally creating the wrong type of broken tree.

As it was, the new merge backend took a few years of work, and I
probably followed too many tangents along the way.  This particular
issue was a case where it clearly didn't touch code I was modifying
(the merge or diff machinery) and instead triggered in unpack-trees.c
and cache-tree.c.  So, I decided to simply document it in case others
wanted to investigate.

Long story short, I can't comment about the difficulty of detecting
and working around these.  If you've read this email and the commit
message I wrote at the time, then you know everything I remember about
the issue.

  reply	other threads:[~2022-05-10  3:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-05  8:53 Crashes in t/t4058-diff-duplicates.sh Alex Riesen
     [not found] ` <YnSWgDdxgm+XWiLt@nand.local>
2022-05-06 10:18   ` Alex Riesen
2022-05-06 16:30     ` Junio C Hamano
2022-05-07  4:14       ` Elijah Newren
2022-05-09 15:23         ` Taylor Blau
2022-05-10  3:50           ` Elijah Newren [this message]
2022-05-09 12:51       ` Alex Riesen

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to='CABPp-BHyNw0dj=mh65pb9HirGFFTxF1+Kky_T4NUxFKANPE2yQ@mail.gmail.com' \
    --to=newren@gmail.com \
    --cc=alexander.riesen@cetitec.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.com \
    --cc=pclouds@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).