git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Clemens Buchacher <drizzd@aon.at>
To: Josh ben Jore <jbenjore@whitepages.com>
Cc: "'git@vger.kernel.org'" <git@vger.kernel.org>
Subject: Re: Fw: Null deref in recursive merge in df73af5f667a479764d2b2195cb0cb60b0b89e3d
Date: Wed, 29 Jul 2009 18:10:30 +0200	[thread overview]
Message-ID: <20090729161030.GA3848@localhost> (raw)
In-Reply-To: <D5F958F92101F74D8A5683C2FE14F4200F23102F@post.corp.w3data.com>

Hi,

On Tue, Jul 28, 2009 at 03:23:00PM -0700, Josh ben Jore wrote:
[...]
>   CONFLICT (rename/add): Rename
> config/conf/target/dev-ubuntu/wpn_rails/appserver.yml->config/conf/target/dev/wpn_rails/appserver.yml
> in Temporary merge branch 1. config/conf/target/dev/wpn_rails/appse2
>   Adding as config/conf/target/dev/wpn_rails/appserver.yml~Temporary merge branch 2 instead
>   Skipped config/conf/target/dev/wpn_rails/appserver.yml (merged same as existing)
[...]
>   There are unmerged index entries:
>   2 config/conf/target/dev/wpn_rails/appserver.yml
>   3 config/conf/target/dev/wpn_rails/appserver.yml
>   Merging:
>   virtual merged tree
>   e4a886b Adding legacy click log processing scripts
>   found 1 common ancestor(s):
>   09fb055 Merge commit 'rel_090630_prod_02'
> Segmentation fault

Yeah, if process_entry leaves unmerged entries, write_tree_from_memory will
return NULL. I can reproduce with the following script (same principle as
t7405).

Clemens
---

diff --git a/t/t6035-merge-recursive-ra.sh b/t/t6035-merge-recursive-ra.sh
new file mode 100755
index 0000000..15f2c7d
--- /dev/null
+++ b/t/t6035-merge-recursive-ra.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+test_description='test recursive merge with rename/add conflicts'
+
+. ./test-lib.sh
+
+#
+# history
+#
+#        a --- c
+#      /   \ /
+# root      X
+#      \   / \
+#        b --- d
+#
+
+test_expect_success setup '
+
+	: >src &&
+	git add src &&
+	test_tick &&
+	git commit -m root &&
+
+	git checkout -b a master &&
+	git mv src dst
+	test_tick &&
+	git commit -m a &&
+
+	git checkout -b b master &&
+	: >dst &&
+	git add dst &&
+	test_tick &&
+	git commit -m b
+
+	git checkout -b c a &&
+	git merge -s ours b &&
+
+	git checkout -b d b &&
+	git merge -s ours a
+'
+
+test_expect_success 'merging with rename/add conflict' '
+
+	git checkout -b test1 a &&
+	test_must_fail git merge b &&
+	test -f .git/MERGE_MSG &&
+	git diff &&
+	test -n "$(git ls-files -u)"
+'
+
+test_expect_success 'merging with a rename/add conflict between merge bases' '
+
+	git reset --hard HEAD &&
+	git checkout -b test2 c &&
+	git merge d
+
+'
+
+test_done
-- 
1.6.3.1

  parent reply	other threads:[~2009-07-29 16:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-28 22:23 Fw: Null deref in recursive merge in df73af5f667a479764d2b2195cb0cb60b0b89e3d Josh ben Jore
2009-07-29 14:11 ` Josh ben Jore
2009-07-30  7:03   ` Junio C Hamano
2009-07-30  7:24     ` Josh ben Jore
2009-07-30  7:54       ` Junio C Hamano
     [not found]     ` <7viqhaipg0.fsf@alter.siamese.dyndns.org>
2009-07-30  8:00       ` Johannes Schindelin
2009-08-18 21:35       ` Fredrik Kuivinen
2009-07-31  0:38     ` [PATCH] merge-recursive: don't segfault while handling rename clashes Junio C Hamano
2009-07-29 16:10 ` Clemens Buchacher [this message]
2009-07-29 20:45   ` Null deref in recursive merge in df73af5f667a479764d2b2195cb0cb60b0b89e3d Josh ben Jore
2009-07-30  6:34   ` Fw: " 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=20090729161030.GA3848@localhost \
    --to=drizzd@aon.at \
    --cc=git@vger.kernel.org \
    --cc=jbenjore@whitepages.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).