All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ondrej Pohorelsky <opohorel@redhat.com>
To: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
Cc: git@vger.kernel.org, "SZEDER Gábor" <szeder.dev@gmail.com>
Subject: Re: git-core: try_to_follow_renames(): git killed by SIGSEGV
Date: Tue, 10 Mar 2020 13:07:55 +0100	[thread overview]
Message-ID: <CA+B51BErxp0Nzcc=1Ress4tbDmKYmcCqUyC-fmD+8O8KdaZLZQ@mail.gmail.com> (raw)
In-Reply-To: <3c722d21-ee57-7d20-81fb-0399f02f1bc7@syntevo.com>

Thank you for your further analyzation and explanation.

I would love to make a patch for this bug, but sadly
I'm not fully aware of what is going on in this functions
and how they are affecting other git functionality.

I hope @szeder can look into this bug and provide more explanation
as he knows this code best.

Best regards,
Ondřej Pohořelský

On Fri, Mar 6, 2020 at 3:58 PM Alexandr Miloslavskiy
<alexandr.miloslavskiy@syntevo.com> wrote:
>
> Since I like studying crashes and noone else replied, I decided to have
> a look.
>
> The problem is easy to reproduce with this (replace 1.c with any file):
>    git log --follow -L 1,1:1.c -- 1.c
>
> It occurs because `opt->pathspec.items` gets cleaned here:
>      clear_pathspec
>      queue_diffs
>          /* must look at the full tree diff to detect renames */
>          clear_pathspec(&opt->pathspec);
>          DIFF_QUEUE_CLEAR(&diff_queued_diff);
>      process_ranges_ordinary_commit
>      process_ranges_arbitrary_commit
>      line_log_filter
>      prepare_revision_walk
>      cmd_log_walk
>      cmd_log
>
> And on next iteration it crashes in 'try_to_follow_renames' on this line:
>      diff_opts.single_follow = opt->pathspec.items[0].match;
>
> I think that bug comes from commit:
>      a2bb801f by SZEDER Gábor, 2019-08-21 13:04:24
>      line-log: avoid unnecessary full tree diffs
>
> @szeder could you please look into that?
>
> On 27.02.2020 13:56, Ondrej Pohorelsky wrote:
> > Hi,
> >
> > there is a SIGSEGV appearing in Fedora[0] with Git 2.24.1
> >
> > This bug started to appear after update to Git 2.24.1.
> > Bug reporter said that Git crashed on him while running VS Code with
> > Git Lens extension[1]
> > I have tried to reproduce this bug with my own compiled Git with debug
> > flags, but sadly SIGSEGV never appeared.
> >
> > To me it seems like there is a problem in commit a2bb801f6a[2] which
> > changes move_diff_queue() function. This function calls
> > diff_tree_oid() that calls try_to_follow_renames(). In the last two
> > functions there are no arguments checks.
> >
> > Best regards,
> > Ondřej Pohořelský
> >
> > [0] https://retrace.fedoraproject.org/faf/problems/bthash/?bth=25aa7d7267ab5de548ffca337115cb68f7b65105
> > [1] https://bugzilla.redhat.com/show_bug.cgi?id=1791810
> > [2] https://git.kernel.org/pub/scm/git/git.git/commit/?id=a2bb801f6a430f6049e5c9729a8f3bf9097d9b34
> >
>


  reply	other threads:[~2020-03-10 12:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27 12:56 git-core: try_to_follow_renames(): git killed by SIGSEGV Ondrej Pohorelsky
2020-03-06 14:44 ` Alexandr Miloslavskiy
2020-03-10 12:07   ` Ondrej Pohorelsky [this message]
2020-03-10 16:57   ` SZEDER Gábor
2020-03-10 17:30     ` Konstantin Tokarev
2020-03-10 17:35     ` Alexandr Miloslavskiy

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='CA+B51BErxp0Nzcc=1Ress4tbDmKYmcCqUyC-fmD+8O8KdaZLZQ@mail.gmail.com' \
    --to=opohorel@redhat.com \
    --cc=alexandr.miloslavskiy@syntevo.com \
    --cc=git@vger.kernel.org \
    --cc=szeder.dev@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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.