git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: "Александр Булаев" <aleks.bulaev@gmail.com>,
	"Git List" <git@vger.kernel.org>
Subject: Re: git 2.16.0 segfaults on clone of specific repo
Date: Fri, 19 Jan 2018 02:47:39 +0000	[thread overview]
Message-ID: <20180119024738.GA222163@genre.crustytoothpaste.net> (raw)
In-Reply-To: <CAPig+cTkBEGyoS93GYCtoDgccTF_UixqBkVTExg7Zf0M1J7KRQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2669 bytes --]

On Thu, Jan 18, 2018 at 07:15:56PM -0500, Eric Sunshine wrote:
> [+cc:brian]
> 
> On Thu, Jan 18, 2018 at 3:55 PM, Александр Булаев
> <aleks.bulaev@gmail.com> wrote:
> > I found that git 2.16.0 segfaults on clone of vim-colorschemes repo.
> >
> > (lldb) run
> > Process 25643 launched: '/usr/local/bin/git' (x86_64)
> > Cloning into 'vim-colorschemes'...
> > remote: Counting objects: 1457, done.
> > remote: Total 1457 (delta 0), reused 0 (delta 0), pack-reused 1457
> > Receiving objects: 100% (1457/1457), 1.43 MiB | 289.00 KiB/s, done.
> > Resolving deltas: 100% (424/424), done.
> > Process 25643 stopped
> > * thread #1, queue = 'com.apple.main-thread', stop reason =
> > EXC_BAD_ACCESS (code=1, address=0x48)
> 
> I can confirm that this crashes on MacOS; it does not crash on Linux or BSD.
> 
> git-bisect places blame on eb0ccfd7f5 (Switch empty tree and blob
> lookups to use hash abstraction, 2017-11-12).

I unfortunately don't have a macOS system to test with, and I've
compiled with both gcc and clang on my Debian system and, as you
mentioned, it doesn't fail there.

I have a guess about what the problem might be.  Can you try this patch
and see if it fixes things?

-- >8 --
From 10b690241619a452634b31fbc5ccd054a4f6e5ec Mon Sep 17 00:00:00 2001
From: "brian m. carlson" <sandals@crustytoothpaste.net>
Date: Sun, 14 Jan 2018 18:26:29 +0000
Subject: [PATCH] repository: pre-initialize hash algo pointer

There are various git subcommands (among them, clone) which don't set up
the repository but end up needing to have information about the hash
algorithm in use.  In the future, we can add a command line option for
this or read it from the configuration, but until we're ready to expose
that functionality to the user, simply initialize the repository
structure to use the current hash algorithm, SHA-1.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
---
 repository.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/repository.c b/repository.c
index 998413b8bb..f66fcb1342 100644
--- a/repository.c
+++ b/repository.c
@@ -5,7 +5,7 @@
 
 /* The main repository */
 static struct repository the_repo = {
-	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &the_index, NULL, 0, 0
+	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &the_index, &hash_algos[GIT_HASH_SHA1], 0, 0
 };
 struct repository *the_repository = &the_repo;
 
-- 
2.16.0.rc2.280.g09355b536d
-- >8 --
-- 
brian m. carlson / brian with sandals: Houston, Texas, US
https://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: https://keybase.io/bk2204

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 867 bytes --]

  reply	other threads:[~2018-01-19  2:47 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-18 20:55 git 2.16.0 segfaults on clone of specific repo Александр Булаев
2018-01-18 21:03 ` Randall S. Becker
2018-01-19  0:15 ` Eric Sunshine
2018-01-19  2:47   ` brian m. carlson [this message]
2018-01-19  3:06     ` Eric Sunshine
2018-01-19  3:39       ` Randall S. Becker
2018-01-19  3:40       ` brian m. carlson
2018-01-19  5:31         ` Duy Nguyen
2018-01-19  7:40           ` Eric Sunshine
2018-01-19  8:22             ` Duy Nguyen
2018-01-19  8:28               ` Eric Sunshine
2018-01-19 17:25             ` Todd Zullinger
2018-01-20  0:23               ` Eric Sunshine
2018-01-19 22:31             ` brian m. carlson
2018-01-20  0:15               ` Eric Sunshine
2018-01-20  0:23                 ` brian m. carlson
2018-01-20  0:27                   ` Eric Sunshine
2018-01-19  4:18       ` [PATCH] repository: pre-initialize hash algo pointer brian m. carlson
2018-01-19  7:54         ` Eric Sunshine
2018-01-19 19:24           ` Junio C Hamano
2018-01-19 21:48             ` Eric Sunshine
2018-01-19 22:25               ` Junio C Hamano
2018-01-19 23:14             ` brian m. carlson
2018-01-20  7:01             ` Junio C Hamano
2018-01-20  9:38               ` Eric Sunshine
2018-01-20 20:33         ` [PATCH] t: add clone test for files differing only in case brian m. carlson
2018-01-21  1:19           ` Eric Sunshine
2018-01-21  7:33           ` Junio C Hamano
2018-01-21  7:46             ` Eric Sunshine
2018-01-21  8:07               ` Eric Sunshine
2018-01-21 19:55                 ` brian m. carlson
2018-01-21 11:50           ` Duy Nguyen
2018-01-21 18:47             ` Eric Sunshine

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=20180119024738.GA222163@genre.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=aleks.bulaev@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sunshine@sunshineco.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 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).