mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Érico Rolim" <>
Subject: [BUG] segmentation fault in git-diff
Date: Thu, 9 Apr 2020 19:22:34 -0300	[thread overview]
Message-ID: <> (raw)

Hey there!

I have found a bug in the git-diff utility, which is reproducible in
the next branch. In any repository, if I run

    git diff :/any/path/

(The important part is the trailing forward slash. No slash will
generate either a valid diff or an error message about the path not
being known. ":/" also works without issue)

it will trigger a SIGSEV. I have traced that back to the
refs_read_raw_ref() function, where it seems the ref_store parameter
passed to it is 0x0 (according to GDB). It's always possible to include
a null-check in that function to fix the issue, but I don't think
that'd be the best solution. I can attempt to fix it, but I don't know
what (and where) the proper solution would be, because I don't know what
the expected behavior is here, nor where exactly it should fail. Do you
think this could also warrant the creation of a test?

I don't know what the best debug resources (valgrind output, core file
from gdb) would be, but I can provide them if necessary.


Érico Nogueira

             reply	other threads:[~2020-04-09 22:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09 22:22 Érico Rolim [this message]
2020-04-09 22:45 ` [BUG] segmentation fault in git-diff Junio C Hamano
2020-04-09 22:47   ` Junio C Hamano
2020-04-09 22:57     ` Junio C Hamano
2020-04-09 23:37       ` Junio C Hamano
2020-04-09 23:41       ` Jeff King
2020-04-10  0:03         ` Re* " Junio C Hamano
2020-04-10  1:42           ` Érico Rolim
2020-04-10  3:04           ` Jeff King
2020-04-10  5:39             ` Junio C Hamano

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:

  List information:

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

  git send-email \ \ \ \

* 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

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).