git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Git segfaults with diff.external and comparing files with different permissions
@ 2024-01-28 20:24 Wilfred Hughes
  2024-01-29  1:57 ` [PATCH] diff: handle NULL meta-info when spawning external diff Jeff King
  0 siblings, 1 reply; 5+ messages in thread
From: Wilfred Hughes @ 2024-01-28 20:24 UTC (permalink / raw)
  To: git

Hi folks

It looks like git crashes if diff.external is set and the user
compares files that have different permissions. Here's a repro:

$ mkdir demo
$ cd demo
$ git init .
Initialized empty Git repository in /tmp/demo/.git/

$ git config diff.external /bin/echo
$ touch foo bar
$ chmod 755 foo
$ git diff --no-ext-diff --no-index foo bar
diff --git 1/foo 2/bar
old mode 100755
new mode 100644

$ git diff --no-index foo bar
zsh: segmentation fault (core dumped)  git diff --no-index foo bar

This was originally reported as a difftastic bug[1] but it seems to
occur regardless of the value of diff.external, hence my repro with
/bin/echo.

[1] https://github.com/Wilfred/difftastic/issues/615

[System Info]
git version:
git version 2.43.0
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 6.7.0-zen3-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Sat, 13 Jan
2024 14:36:54 +0000 x86_64
compiler info: gnuc: 13.2
libc info: glibc: 2.38
$SHELL (typically, interactive shell): /bin/zsh

Thanks
Wilfred

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

end of thread, other threads:[~2024-01-30 16:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-28 20:24 Git segfaults with diff.external and comparing files with different permissions Wilfred Hughes
2024-01-29  1:57 ` [PATCH] diff: handle NULL meta-info when spawning external diff Jeff King
2024-01-29 18:37   ` Junio C Hamano
2024-01-30  6:06     ` Jeff King
2024-01-30 16:29       ` Junio C Hamano

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