git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [BUG] segmentation fault in git-diff
@ 2020-04-09 22:22 Érico Rolim
  2020-04-09 22:45 ` Junio C Hamano
  0 siblings, 1 reply; 10+ messages in thread
From: Érico Rolim @ 2020-04-09 22:22 UTC (permalink / raw)
  To: git

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.

Thanks,

Érico Nogueira

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

end of thread, other threads:[~2020-04-10  5:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09 22:22 [BUG] segmentation fault in git-diff Érico Rolim
2020-04-09 22:45 ` 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

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