From: John Keeping <john@keeping.me.uk>
To: Andreas Jacobsen <andreas@andreasjacobsen.com>
Cc: git@vger.kernel.org
Subject: Re: Segfault in git merge-tree (1.8.2.2)
Date: Mon, 6 May 2013 15:29:23 +0100 [thread overview]
Message-ID: <20130506142923.GC25912@serenity.lan> (raw)
In-Reply-To: <CADEJa-5-UpkUaNQ=QResY54cH4TvXqiUSeG-jewH+n+HsZqmHA@mail.gmail.com>
On Mon, May 06, 2013 at 04:13:28PM +0200, Andreas Jacobsen wrote:
> Sure, here you go, this time built from the HEAD I found on github
> (7d3ccdffb5d28970dd7a4d177cfcca690ccd0c22) with:
>
> NO_GETTEXT=1 make prefix=/usr/local/Cellar/git/HEAD CC=cc CFLAGS='-O0
> -g' install (this is homebrew's setup, but I built it manually rather
> than using the recipe.)
>
> And the gdb output:
>
> (gdb) set args merge-tree 027058e6ac8d03e029c4e1455bf90f63cd20e65b
> FETCH_HEAD master
> (gdb) run
> Starting program: /usr/local/bin/git merge-tree
> 027058e6ac8d03e029c4e1455bf90f63cd20e65b FETCH_HEAD master
> Reading symbols for shared libraries +++++.............................. done
>
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
> 0x000000010006f1a3 in add_merge_entry (entry=0x100432ba0) at
> builtin/merge-tree.c:24
> 24 *merge_result_end = entry;
Thanks. I have an idea of what's going on, but the set up is in an
earlier pass and it only fails the next time it gets into
add_merge_entry.
Can you try adding the following patch on top? Hopefully the added
debug is in the right caller, otherwise the new assert at the top will
point us to the right one.
-- >8 --
diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c
index ec49917..8eebab7 100644
--- a/builtin/merge-tree.c
+++ b/builtin/merge-tree.c
@@ -23,6 +23,7 @@ static void add_merge_entry(struct merge_list *entry)
{
*merge_result_end = entry;
merge_result_end = &entry->next;
+ assert(merge_result_end);
}
static void merge_trees_recursive(struct tree_desc t[3], const char *base, int df_conflict);
@@ -267,6 +268,12 @@ static void unresolved(const struct traverse_info *info, struct name_entry n[3])
if (n[0].mode && !S_ISDIR(n[0].mode))
entry = link_entry(1, info, n + 0, entry);
+ if (!entry) {
+ fprintf(stderr, "n[0].mode = %d\nn[1].mode = %d\nn[2].mode = %d\n",
+ n[0].mode, n[1].mode, n[2].mode);
+ assert(FALSE);
+ }
+
add_merge_entry(entry);
}
next prev parent reply other threads:[~2013-05-06 14:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-06 13:02 Segfault in git merge-tree (1.8.2.2) Andreas Jacobsen
2013-05-06 13:39 ` John Keeping
2013-05-06 14:13 ` Andreas Jacobsen
2013-05-06 14:29 ` John Keeping [this message]
2013-05-06 14:49 ` John Keeping
2013-05-06 15:20 ` [PATCH] merge-tree: handle directory/empty conflict correctly John Keeping
2013-05-07 4:54 ` Andreas Jacobsen
2013-05-07 5:17 ` 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:
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=20130506142923.GC25912@serenity.lan \
--to=john@keeping.me.uk \
--cc=andreas@andreasjacobsen.com \
--cc=git@vger.kernel.org \
/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).