{"thread":{"id":"18602","subject":"Segfault on merge with 1.6.2.1","startedAt":"2009-03-28T16:19:31Z","lastAt":"2009-04-06T06:41:32Z","messageCount":18,"participants":["Michael Johnson","Miklos Vajna","Johannes Schindelin","Clemens Buchacher","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"109719","messageId":"op.urifmtkkso3nzr@sulidor.mdjohnson.us","threadId":"18602","inReplyTo":null,"subject":"Segfault on merge with 1.6.2.1","fromName":"Michael Johnson","fromEmail":"redbeard@mdjohnson.us","sentAt":"2009-03-28T16:19:31Z","receivedAt":"2009-03-28T16:19:31Z","isPatch":false,"sender":{"key":"redbeard@mdjohnson.us","avatar":"https://gravatar.com/avatar/3e1cc1194595b043db4cfecbc4fa9a094b93c909ca75ff5667380fab25daadc8?d=mp&s=160"},"body":"Greetings.\n\nI'm trying to figure out what's going on with a merge I'm trying to do. As  \nfar as I know, it's a fairly standard situation, just merging two  \nbranches. But I get a segfault each time. This occurs with 1.5.6.5 and  \n1.6.2.1. The earlier version is on a Debian Etch box with  \nbackports.debian.org. The latter is Debian Sid. I also tried on a Windows  \nbox with MSysGit 1.6.2.1-preview20090322.exe.\n\nThe 1.6.2.1 version just segfaults, but 1.5.6.5 says:\n\n/usr/bin/git-merge: line 438: 32335 Segmentation fault       \ngit-merge-$strategy $common -- \"$head_arg\" \"$@\"\nMerge with strategy recursive failed.\n\nIn all cases, .git/index.lock is left behind.\n\nI'm using the default configuration, with only a few basic options in my  \nperson .gitconfig.\n\nUnfortunately, I cannot post the archive, but I can tar the archive and  \nshare that with individuals, if need be.\n\nThe problems started with a weird merge by another developer a while ago  \nthat somehow reapplied earlier commits. It looked like he had done some  \ncommits that wiped some earlier commits but then a commit or two latter  \nthe old commits were added back. When I tried to merge the resulting  \nmaster into my working branch it segfaulted. I didn't have time (or the  \nimmediate need) to look into it then and it's been forgotten until now  \n(when, of course, it needs to be done in the next few days :( ).\n\nI have run git gc and also pruned a couple of minor dangling objects.  \nRunning git fsck --full reveals no problems. The largest file is about  \n6MiB.\n\nI've asked on #git, and drizzd there suggested I try here. At this point  \nI'm completely at a loss.\n\nAny help would be greatly appreciated.\n\nThanks,\nMichael\n\n-- \nMichael D Johnson   <redbeard@mdjohnson.us>    \nredbeardcreator.deviantart.com\n\n\"Marketing research...[has] shown that energy weapons that make sounds sell\n  better...\" - Kevin Siembieda (Rifts Game Master Guide, pg 111)\n"},{"id":"109773","messageId":"20090329121700.GN22446@genesis.frugalware.org","threadId":"18602","inReplyTo":"op.urifmtkkso3nzr@sulidor.mdjohnson.us","subject":"Re: Segfault on merge with 1.6.2.1","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-03-29T12:17:00Z","receivedAt":"2009-03-29T12:17:00Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Sat, Mar 28, 2009 at 11:19:31AM -0500, Michael Johnson <redbeard@mdjohnson.us> wrote:\n> The 1.6.2.1 version just segfaults, but 1.5.6.5 says:\n> \n> /usr/bin/git-merge: line 438: 32335 Segmentation fault       \n> git-merge-$strategy $common -- \"$head_arg\" \"$@\"\n> Merge with strategy recursive failed.\n> \n> In all cases, .git/index.lock is left behind.\n\nThat's because 1.6.2.1 has git-merge in C and it calls merge-recursive\ndirectly without a fork. Could you try it in gdb and provide a\nbacktrace, please?\n"},{"id":"109803","messageId":"op.urk20nanso3nzr@sulidor.mdjohnson.us","threadId":"18602","inReplyTo":"20090329121700.GN22446@genesis.frugalware.org","subject":"Re: Segfault on merge with 1.6.2.1","fromName":"Michael Johnson","fromEmail":"redbeard@mdjohnson.us","sentAt":"2009-03-30T02:39:49Z","receivedAt":"2009-03-30T02:39:49Z","isPatch":false,"sender":{"key":"redbeard@mdjohnson.us","avatar":"https://gravatar.com/avatar/3e1cc1194595b043db4cfecbc4fa9a094b93c909ca75ff5667380fab25daadc8?d=mp&s=160"},"body":"On Sun, 29 Mar 2009 07:17:00 -0500, Miklos Vajna <vmiklos@frugalware.org>  \nwrote:\n\n> On Sat, Mar 28, 2009 at 11:19:31AM -0500, Michael Johnson  \n> <redbeard@mdjohnson.us> wrote:\n>> The 1.6.2.1 version just segfaults, but 1.5.6.5 says:\n>>\n>> /usr/bin/git-merge: line 438: 32335 Segmentation fault\n>> git-merge-$strategy $common -- \"$head_arg\" \"$@\"\n>> Merge with strategy recursive failed.\n>>\n>> In all cases, .git/index.lock is left behind.\n>\n> That's because 1.6.2.1 has git-merge in C and it calls merge-recursive\n> directly without a fork. Could you try it in gdb and provide a\n> backtrace, please?\n\nWell, I've got a backtrace, but I don't have debugging symbols,  \napparently. There is not a Debian package I can find that has them. I  \nchecked debug.debian.net, as well as the standard sid repository. So I  \nwill have to rebuild the package with debugging turned on. I will not be  \nable to do that tonight, unfortunately. I will probably have a chance  \ntomorrow evening.\n\nJust in case it might be useful, though, here's the backtrace, without  \nsymbols.\n\nStarting program: /usr/bin/git merge origin/dojo-1.3\n(no debugging symbols found)\n... repeated multiple times ...\n[Thread debugging using libthread_db enabled]\n(no debugging symbols found)\n... repeated multiple times\n[New Thread 0xb7a73b30 (LWP 21505)]\n\nProgram received signal SIGSEGV, Segmentation fault.\n[Switching to Thread 0xb7a73b30 (LWP 21505)]\n0x080e5a6f in ?? ()\n(gdb) backtrace\n#0  0x080e5a6f in ?? ()\n#1  0x0893e000 in ?? ()\n#2  0x000f0000 in ?? ()\n#3  0xbf949098 in ?? ()\n#4  0x080e63ad in ?? ()\n#5  0x08977fcf in ?? ()\n#6  0x000f0000 in ?? ()\n#7  0xfff0ffff in ?? ()\n#8  0x08945dd8 in ?? ()\n#9  0x00000000 in ?? ()\n\nThanks for the continuing help.\n\nMichael\n\n-- \nMichael D Johnson   <redbeard@mdjohnson.us>    \nredbeardcreator.deviantart.com\n\n\"Marketing research...[has] shown that energy weapons that make sounds sell\n  better...\" - Kevin Siembieda (Rifts Game Master Guide, pg 111)\n"},{"id":"109848","messageId":"alpine.DEB.1.00.0903300944350.7534@intel-tinevez-2-302","threadId":"18602","inReplyTo":"op.urk20nanso3nzr@sulidor.mdjohnson.us","subject":"Re: Segfault on merge with 1.6.2.1","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-03-30T07:48:35Z","receivedAt":"2009-03-30T07:48:35Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 29 Mar 2009, Michael Johnson wrote:\n\n> On Sun, 29 Mar 2009 07:17:00 -0500, Miklos Vajna <vmiklos@frugalware.org>\n> wrote:\n> \n> >On Sat, Mar 28, 2009 at 11:19:31AM -0500, Michael Johnson\n> ><redbeard@mdjohnson.us> wrote:\n> > >The 1.6.2.1 version just segfaults, but 1.5.6.5 says:\n> > >\n> > >/usr/bin/git-merge: line 438: 32335 Segmentation fault\n> > >git-merge-$strategy $common -- \"$head_arg\" \"$@\"\n> > >Merge with strategy recursive failed.\n> > >\n> > >In all cases, .git/index.lock is left behind.\n> >\n> >That's because 1.6.2.1 has git-merge in C and it calls merge-recursive\n> >directly without a fork. Could you try it in gdb and provide a\n> >backtrace, please?\n> \n> Well, I've got a backtrace, but I don't have debugging symbols, apparently.\n> There is not a Debian package I can find that has them. I checked\n> debug.debian.net, as well as the standard sid repository. So I will have to\n> rebuild the package with debugging turned on. I will not be able to do that\n> tonight, unfortunately. I will probably have a chance tomorrow evening.\n> \n> Just in case it might be useful, though, here's the backtrace, without\n> symbols.\n> \n> Starting program: /usr/bin/git merge origin/dojo-1.3\n> (no debugging symbols found)\n> ... repeated multiple times ...\n> [Thread debugging using libthread_db enabled]\n> (no debugging symbols found)\n> ... repeated multiple times\n> [New Thread 0xb7a73b30 (LWP 21505)]\n> \n> Program received signal SIGSEGV, Segmentation fault.\n> [Switching to Thread 0xb7a73b30 (LWP 21505)]\n> 0x080e5a6f in ?? ()\n> (gdb) backtrace\n> #0  0x080e5a6f in ?? ()\n> #1  0x0893e000 in ?? ()\n> #2  0x000f0000 in ?? ()\n> #3  0xbf949098 in ?? ()\n> #4  0x080e63ad in ?? ()\n> #5  0x08977fcf in ?? ()\n> #6  0x000f0000 in ?? ()\n> #7  0xfff0ffff in ?? ()\n> #8  0x08945dd8 in ?? ()\n> #9  0x00000000 in ?? ()\n\nThis segfault sounds vaguely like something I tried to fix.  \nUnfortunately, I cannot spend time on it right now, except send you the \npatch that could help the issue:\n\n-- snipsnap --\n\n>From 084909acbb576be4c4815e047ee4247b95c70cda Mon Sep 17 00:00:00 2001\nFrom: Johannes Schindelin <johannes.schindelin@gmx.de>\nDate: Mon, 10 Nov 2008 23:25:31 +0100\nSubject: [PATCH] merge-recursive: fail gracefully with directory/submodule conflicts\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n merge-recursive.c         |   15 ++++++++-------\n\ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex 3e1bc3e..8ada5a9 100644\n--- a/merge-recursive.c\n+++ b/merge-recursive.c\n@@ -519,14 +519,14 @@ static void update_file_flags(struct merge_options *o,\n \t\tvoid *buf;\n \t\tunsigned long size;\n \n-\t\tif (S_ISGITLINK(mode))\n-\t\t\tdie(\"cannot read object %s '%s': It is a submodule!\",\n-\t\t\t    sha1_to_hex(sha), path);\n-\n-\t\tbuf = read_sha1_file(sha, &type, &size);\n+\t\tif (S_ISGITLINK(mode)) {\n+\t\t\tbuf = xstrdup(sha1_to_hex(sha));\n+\t\t\tsize = strlen(buf);\n+\t\t} else\n+\t\t\tbuf = read_sha1_file(sha, &type, &size);\n \t\tif (!buf)\n \t\t\tdie(\"cannot read object %s '%s'\", sha1_to_hex(sha), path);\n-\t\tif (type != OBJ_BLOB)\n+\t\tif (!S_ISGITLINK(mode) && type != OBJ_BLOB)\n \t\t\tdie(\"blob expected for %s '%s'\", sha1_to_hex(sha), path);\n \t\tif (S_ISREG(mode)) {\n \t\t\tstruct strbuf strbuf = STRBUF_INIT;\n@@ -542,7 +542,8 @@ static void update_file_flags(struct merge_options *o,\n \t\t\tfree(buf);\n \t\t\tgoto update_index;\n \t\t}\n-\t\tif (S_ISREG(mode) || (!has_symlinks && S_ISLNK(mode))) {\n+\t\tif (S_ISGITLINK(mode) || S_ISREG(mode) ||\n+\t\t\t\t(!has_symlinks && S_ISLNK(mode))) {\n \t\t\tint fd;\n \t\t\tif (mode & 0100)\n \t\t\t\tmode = 0777;\n"},{"id":"109885","messageId":"20090330110335.GF22446@genesis.frugalware.org","threadId":"18602","inReplyTo":"op.urk20nanso3nzr@sulidor.mdjohnson.us","subject":"Re: Segfault on merge with 1.6.2.1","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-03-30T11:03:35Z","receivedAt":"2009-03-30T11:03:35Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Sun, Mar 29, 2009 at 09:39:49PM -0500, Michael Johnson <redbeard@mdjohnson.us> wrote:\n> Well, I've got a backtrace, but I don't have debugging symbols,  \n> apparently. There is not a Debian package I can find that has them. I  \n> checked debug.debian.net, as well as the standard sid repository. So I  \n> will have to rebuild the package with debugging turned on. I will not be  \n> able to do that tonight, unfortunately. I will probably have a chance  \n> tomorrow evening.\n\nOkay, no rush. In case Dscho's patch does not fix your problem, please\nrebuild git with debug symbols enabled and send a normal trace.\n\nThanks.\n"},{"id":"109980","messageId":"op.urnad7jbso3nzr@sulidor.mdjohnson.us","threadId":"18602","inReplyTo":"20090330110335.GF22446@genesis.frugalware.org","subject":"Re: Segfault on merge with 1.6.2.1","fromName":"Michael Johnson","fromEmail":"redbeard@mdjohnson.us","sentAt":"2009-03-31T07:14:21Z","receivedAt":"2009-03-31T07:14:21Z","isPatch":false,"sender":{"key":"redbeard@mdjohnson.us","avatar":"https://gravatar.com/avatar/3e1cc1194595b043db4cfecbc4fa9a094b93c909ca75ff5667380fab25daadc8?d=mp&s=160"},"body":"On Mon, 30 Mar 2009 06:03:35 -0500, Miklos Vajna <vmiklos@frugalware.org>  \nwrote:\n\n> On Sun, Mar 29, 2009 at 09:39:49PM -0500, Michael Johnson  \n> <redbeard@mdjohnson.us> wrote:\n>> Well, I've got a backtrace, but I don't have debugging symbols,\n>> apparently. There is not a Debian package I can find that has them. I\n>> checked debug.debian.net, as well as the standard sid repository. So I\n>> will have to rebuild the package with debugging turned on. I will not be\n>> able to do that tonight, unfortunately. I will probably have a chance\n>> tomorrow evening.\n>\n> Okay, no rush. In case Dscho's patch does not fix your problem, please\n> rebuild git with debug symbols enabled and send a normal trace.\n>\n\nIt would appear that the patch has already been applied to 1.6.2.1.\n\nThat said, here's my backtrace. I've tried tracing through to figure out  \nwhere the problem is occurring, but my gdb-foo is non-existent, I'm wating  \nfor some GUIs to install, and I'm ready for some sleep :| So if I haven't  \nheard back by tomorrow evening, I'll be running one of the frontends for  \ngdb until I have something traced down :)\n\nIf you need any more information, please let me know.\n\nThanks,\nMichael\n\n(gdb) run merge origin/dojo-1.3\nStarting program: /usr/bin/git merge origin/dojo-1.3\n[Thread debugging using libthread_db enabled]\n[New Thread 0xb7b1bb30 (LWP 2651)]\n\nProgram received signal SIGSEGV, Segmentation fault.\n[Switching to Thread 0xb7b1bb30 (LWP 2651)]\n0x080fa828 in parse_tree (item=0x0) at tree.c:250\n250\t\tif (item->object.parsed)\n(gdb) backtrace\n#0  0x080fa828 in parse_tree (item=0x0) at tree.c:250\n#1  0x080cc40b in init_tree_desc_from_tree (desc=0xbfdf53ac, tree=0x0) at  \nmerge-recursive.c:161\n#2  0x080cc4d4 in git_merge_trees (index_only=1, common=0x8fa5df8,  \nhead=0x0, merge=0x8fa5718) at merge-recursive.c:186\n#3  0x080cf28e in merge_trees (o=0xbfdf54d0, head=0x0, merge=0x8fa5718,  \ncommon=0x8fa5df8, result=0xbfdf5448)\n     at merge-recursive.c:1170\n#4  0x080cf75f in merge_recursive (o=0xbfdf54d0, h1=0x8ffc200,  \nh2=0x8f992f0, ca=0x0, result=0xbfdf548c)\n     at merge-recursive.c:1294\n#5  0x080cf6c7 in merge_recursive (o=0xbfdf54d0, h1=0x8f99050,  \nh2=0x8f98ff0, ca=0x8f97b98, result=0xbfdf551c)\n     at merge-recursive.c:1280\n#6  0x08080d75 in try_merge_strategy (strategy=0x811b9b0 \"recursive\",  \ncommon=0x8fd40f0, head_arg=0x811be14 \"HEAD\")\n     at builtin-merge.c:566\n#7  0x08082446 in cmd_merge (argc=1, argv=0xbfdf5808, prefix=0x0) at  \nbuiltin-merge.c:1111\n#8  0x0804bb5f in run_builtin (p=0x8130400, argc=2, argv=0xbfdf5808) at  \ngit.c:244\n#9  0x0804bcf3 in handle_internal_command (argc=2, argv=0xbfdf5808) at  \ngit.c:388\n#10 0x0804bdf0 in run_argv (argcp=0xbfdf5780, argv=0xbfdf5784) at git.c:434\n#11 0x0804bf82 in main (argc=2, argv=0xbfdf5808) at git.c:505\n\n-- \nMichael D Johnson   <redbeard@mdjohnson.us>    \nredbeardcreator.deviantart.com\n\n\"Marketing research...[has] shown that energy weapons that make sounds sell\n  better...\" - Kevin Siembieda (Rifts Game Master Guide, pg 111)\n"},{"id":"110088","messageId":"op.uro0u0xuso3nzr@sulidor.mdjohnson.us","threadId":"18602","inReplyTo":"op.urnad7jbso3nzr@sulidor.mdjohnson.us","subject":"Re: Segfault on merge with 1.6.2.1","fromName":"Michael Johnson","fromEmail":"redbeard@mdjohnson.us","sentAt":"2009-04-01T05:43:38Z","receivedAt":"2009-04-01T05:43:38Z","isPatch":false,"sender":{"key":"redbeard@mdjohnson.us","avatar":"https://gravatar.com/avatar/3e1cc1194595b043db4cfecbc4fa9a094b93c909ca75ff5667380fab25daadc8?d=mp&s=160"},"body":"On Tue, 31 Mar 2009 02:14:21 -0500, Michael Johnson  \n<redbeard@mdjohnson.us> wrote:\n\n> That said, here's my backtrace. I've tried tracing through to figure out  \n> where the problem is occurring, but my gdb-foo is non-existent, I'm  \n> wating for some GUIs to install, and I'm ready for some sleep :| So if I  \n> haven't heard back by tomorrow evening, I'll be running one of the  \n> frontends for gdb until I have something traced down :)\n\nI tried tracing it manually with KDbg tonight. But either I'm too tired  \n(and my patience is low), or I'm just not capable of understanding it. I  \nhope it's the former, since I was able to follow the basic flow well  \nenough. But I still wasn't terribly happy with the front end. It's obvious  \nthat gdb is awesome, I'm just not ready for it yet :)\n\nAnyway, I decided to try an experiment, as I had mentioned to someone that  \nif I couldn't get this bug tracked down, I'd have to do the merge  \nmanually. So... I figured out the common ancestor (I used git show-branch,  \nbut I'm betting there's an easier way), and merged the ancestor + 1 of the  \nother branch into my HEAD. It segfaulted. So, I tried the resolve strategy  \nat the same point. Amazingly, it worked. And a default recursive merge  \nhandled the rest.\n\nThat means my current problem is resolved, but I'm guessing a segfault on  \na default merge is still a bad thing, so I'll try to keep up on this. I do  \nhave a copy of the repository before the merge (several, right now,  \nactually), so I can try fixes. If I'm lucky I'll have some time to work on  \nit myself. But it will be at least two weeks before I actually have the  \ntime to personally track down the problem without help. However, I should  \nbe able to assist someone else fairly easily.\n\nIn short, I don't personally need a fix right now, but I can help figure  \nout what is broken with it.\n\nThanks,\nMichael\n\n-- \nMichael D Johnson   <redbeard@mdjohnson.us>    \nredbeardcreator.deviantart.com\n\n\"Marketing research...[has] shown that energy weapons that make sounds sell\n  better...\" - Kevin Siembieda (Rifts Game Master Guide, pg 111)\n"},{"id":"110112","messageId":"20090401095014.GT22446@genesis.frugalware.org","threadId":"18602","inReplyTo":"op.uro0u0xuso3nzr@sulidor.mdjohnson.us","subject":"Re: Segfault on merge with 1.6.2.1","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-04-01T09:50:14Z","receivedAt":"2009-04-01T09:50:14Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Wed, Apr 01, 2009 at 12:43:38AM -0500, Michael Johnson <redbeard@mdjohnson.us> wrote:\n> Anyway, I decided to try an experiment, as I had mentioned to someone that  \n> if I couldn't get this bug tracked down, I'd have to do the merge  \n> manually. So... I figured out the common ancestor (I used git show-branch,  \n> but I'm betting there's an easier way), and merged the ancestor + 1 of the  \n> other branch into my HEAD. It segfaulted. So, I tried the resolve strategy  \n> at the same point. Amazingly, it worked. And a default recursive merge  \n> handled the rest.\n\nI initially replied to this thread as I wasn't sure if it's a bug in\nmerge-recursive or builtin-merge itself. I'm not that familiar with\nmerge-recursive, that's why I didn't reply so far. ;-)\n\n> In short, I don't personally need a fix right now, but I can help figure  \n> out what is broken with it.\n\nIf you don't need rename detection, you can merge with '-s resolve', I\nthink that would do what you need and it avoids the problematic\ncodepath.\n"},{"id":"110158","messageId":"20090401180627.GA14716@localhost","threadId":"18602","inReplyTo":"op.urnad7jbso3nzr@sulidor.mdjohnson.us","subject":"Re: Segfault on merge with 1.6.2.1","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2009-04-01T18:06:27Z","receivedAt":"2009-04-01T18:06:27Z","isPatch":false,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"On Tue, Mar 31, 2009 at 02:14:21AM -0500, Michael Johnson wrote:\n> It would appear that the patch has already been applied to 1.6.2.1.\n\nI don't think it has. But judging from the stack trace this bug is unrelated\nto the patch anyways.\n\nIf nobody else is dealing with this I'd like to have a look at it. Could you\nplease send me a copy of the repo.\n\nThanks,\nClemens\n"},{"id":"110177","messageId":"op.urqg6bhmso3nzr@sulidor.mdjohnson.us","threadId":"18602","inReplyTo":"20090401180627.GA14716@localhost","subject":"Re: Segfault on merge with 1.6.2.1","fromName":"Michael Johnson","fromEmail":"redbeard@mdjohnson.us","sentAt":"2009-04-02T00:33:37Z","receivedAt":"2009-04-02T00:33:37Z","isPatch":false,"sender":{"key":"redbeard@mdjohnson.us","avatar":"https://gravatar.com/avatar/3e1cc1194595b043db4cfecbc4fa9a094b93c909ca75ff5667380fab25daadc8?d=mp&s=160"},"body":"On Wed, 01 Apr 2009 13:06:27 -0500, Clemens Buchacher <drizzd@aon.at>  \nwrote:\n\n> On Tue, Mar 31, 2009 at 02:14:21AM -0500, Michael Johnson wrote:\n>> It would appear that the patch has already been applied to 1.6.2.1.\n>\n> I don't think it has. But judging from the stack trace this bug is  \n> unrelated to the patch anyways.\n\nWhen I tried to appy the patch I got a conflict (I applied it directly to  \nDebian's source package for git-core). When I compared the code to the  \npatch it appeared it had been applied. Of course, I'm far from an expert  \nat applying patches, so I might have misread the direction of the patch.\n\n> If nobody else is dealing with this I'd like to have a look at it. Could  \n> you please send me a copy of the repo.\n\nIt doesn't sound like anyone else is. So I'll send you a copy shortly, off  \nlist.\n\nThanks for all the help,\nMichael\n\n-- \nMichael D Johnson   <redbeard@mdjohnson.us>    \nredbeardcreator.deviantart.com\n\n\"Marketing research...[has] shown that energy weapons that make sounds sell\n  better...\" - Kevin Siembieda (Rifts Game Master Guide, pg 111)\n"},{"id":"110364","messageId":"1238892420-721-1-git-send-email-drizzd@aon.at","threadId":"18602","inReplyTo":"20090401180627.GA14716@localhost","subject":"Re: Segfault on merge with 1.6.2.1","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2009-04-05T00:46:57Z","receivedAt":"2009-04-05T00:46:57Z","isPatch":false,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"Hi,\n\nThe segmentation fault is caused by a null pointer dereference which happens\nduring recursive merge with a submodule conflict between two merge bases. This\nis fixed by the following patches.\n\nHowever, there are other problems with merging submodules. For example, git\ndiff aborts with \"fatal: read error 'sub'\" for conflicting submodules. I have\nalso added a test for this.\n\nDscho has already started working on related issues. I have therefore skipped\nt7404, which is already used in Dscho's work.\n\nClemens\n\n merge-recursive.c          |   16 ++-------\n t/t7405-submodule-merge.sh |   74 ++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 78 insertions(+), 12 deletions(-)\n\n[PATCH 1/3] add tests for merging with submodules\n[PATCH 2/3] update cache for conflicting submodule entries\n[PATCH 3/3] simplify output of conflicting merge\n"},{"id":"110361","messageId":"1238892420-721-2-git-send-email-drizzd@aon.at","threadId":"18602","inReplyTo":"1238892420-721-1-git-send-email-drizzd@aon.at","subject":"[PATCH 1/3] add tests for merging with submodules","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2009-04-05T00:46:58Z","receivedAt":"2009-04-05T00:46:58Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"\nSigned-off-by: Clemens Buchacher <drizzd@aon.at>\n---\n t/t7405-submodule-merge.sh |   74 ++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 74 insertions(+), 0 deletions(-)\n create mode 100755 t/t7405-submodule-merge.sh\n\ndiff --git a/t/t7405-submodule-merge.sh b/t/t7405-submodule-merge.sh\nnew file mode 100755\nindex 0000000..9778ad4\n--- /dev/null\n+++ b/t/t7405-submodule-merge.sh\n@@ -0,0 +1,74 @@\n+#!/bin/sh\n+\n+test_description='merging with submodules'\n+\n+. ./test-lib.sh\n+\n+#\n+# history\n+#\n+#        a --- c\n+#      /   \\ /\n+# root      X\n+#      \\   / \\\n+#        b --- d\n+#\n+\n+test_expect_success setup '\n+\n+\tmkdir sub &&\n+\t(cd sub &&\n+\t git init &&\n+\t echo original > file &&\n+\t git add file &&\n+\t test_tick &&\n+\t git commit -m sub-root) &&\n+\tgit add sub &&\n+\ttest_tick &&\n+\tgit commit -m root &&\n+\n+\tgit checkout -b a master &&\n+\t(cd sub &&\n+\t echo A > file &&\n+\t git add file &&\n+\t test_tick &&\n+\t git commit -m sub-a) &&\n+\tgit add sub &&\n+\ttest_tick &&\n+\tgit commit -m a &&\n+\n+\tgit checkout -b b master &&\n+\t(cd sub &&\n+\t echo B > file &&\n+\t git add file &&\n+\t test_tick &&\n+\t git commit -m sub-b) &&\n+\tgit add sub &&\n+\ttest_tick &&\n+\tgit commit -m b\n+\n+\tgit checkout -b c a &&\n+\tgit merge -s ours b &&\n+\n+\tgit checkout -b d b &&\n+\tgit merge -s ours a\n+'\n+\n+test_expect_failure 'merging with modify/modify conflict' '\n+\n+\tgit checkout -b test1 a &&\n+\ttest_must_fail git merge b &&\n+\ttest -f .git/MERGE_MSG &&\n+\tgit diff\n+\n+'\n+\n+test_expect_failure 'merging with a modify/modify conflict between merge bases' '\n+\n+\tgit reset --hard HEAD &&\n+\tgit checkout -b test2 c &&\n+\tgit merge d\n+\n+'\n+\n+test_done\n-- \n1.6.2.1\n"},{"id":"110363","messageId":"1238892420-721-3-git-send-email-drizzd@aon.at","threadId":"18602","inReplyTo":"1238892420-721-2-git-send-email-drizzd@aon.at","subject":"[PATCH 2/3] update cache for conflicting submodule entries","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2009-04-05T00:46:59Z","receivedAt":"2009-04-05T00:46:59Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"When merging merge bases during a recursive merge we do not want to\nleave any unmerged entries. Otherwise we cannot create a temporary\ntree for the recursive merge to work with.\n\nWe failed to do so in case of a submodule conflict between merge\nbases, causing a NULL pointer dereference in the next step of the\nrecursive merge.\n\nSigned-off-by: Clemens Buchacher <drizzd@aon.at>\n---\n merge-recursive.c          |    5 +++--\n t/t7405-submodule-merge.sh |    2 +-\n 2 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex 3e1bc3e..f1b120b 100644\n--- a/merge-recursive.c\n+++ b/merge-recursive.c\n@@ -1118,10 +1118,11 @@ static int process_entry(struct merge_options *o,\n \t\tclean_merge = mfi.clean;\n \t\tif (mfi.clean)\n \t\t\tupdate_file(o, 1, mfi.sha, mfi.mode, path);\n-\t\telse if (S_ISGITLINK(mfi.mode))\n+\t\telse if (S_ISGITLINK(mfi.mode)) {\n \t\t\toutput(o, 1, \"CONFLICT (submodule): Merge conflict in %s \"\n \t\t\t       \"- needs %s\", path, sha1_to_hex(b.sha1));\n-\t\telse {\n+\t\t\tupdate_file(o, 0, mfi.sha, mfi.mode, path);\n+\t\t} else {\n \t\t\toutput(o, 1, \"CONFLICT (%s): Merge conflict in %s\",\n \t\t\t\t\treason, path);\n \ndiff --git a/t/t7405-submodule-merge.sh b/t/t7405-submodule-merge.sh\nindex 9778ad4..aa6c44c 100755\n--- a/t/t7405-submodule-merge.sh\n+++ b/t/t7405-submodule-merge.sh\n@@ -63,7 +63,7 @@ test_expect_failure 'merging with modify/modify conflict' '\n \n '\n \n-test_expect_failure 'merging with a modify/modify conflict between merge bases' '\n+test_expect_success 'merging with a modify/modify conflict between merge bases' '\n \n \tgit reset --hard HEAD &&\n \tgit checkout -b test2 c &&\n-- \n1.6.2.1\n"},{"id":"110362","messageId":"1238892420-721-4-git-send-email-drizzd@aon.at","threadId":"18602","inReplyTo":"1238892420-721-3-git-send-email-drizzd@aon.at","subject":"[PATCH 3/3] simplify output of conflicting merge","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2009-04-05T00:47:00Z","receivedAt":"2009-04-05T00:47:00Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"This simplifies the code without changing the semantics and removes\nthe unhelpful \"needs $sha1\" part of the conflicting submodule message.\n\nSigned-off-by: Clemens Buchacher <drizzd@aon.at>\n---\n merge-recursive.c |   17 ++++-------------\n 1 files changed, 4 insertions(+), 13 deletions(-)\n\ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex f1b120b..d6f0582 100644\n--- a/merge-recursive.c\n+++ b/merge-recursive.c\n@@ -1116,22 +1116,13 @@ static int process_entry(struct merge_options *o,\n \t\t\t\t o->branch1, o->branch2);\n \n \t\tclean_merge = mfi.clean;\n-\t\tif (mfi.clean)\n-\t\t\tupdate_file(o, 1, mfi.sha, mfi.mode, path);\n-\t\telse if (S_ISGITLINK(mfi.mode)) {\n-\t\t\toutput(o, 1, \"CONFLICT (submodule): Merge conflict in %s \"\n-\t\t\t       \"- needs %s\", path, sha1_to_hex(b.sha1));\n-\t\t\tupdate_file(o, 0, mfi.sha, mfi.mode, path);\n-\t\t} else {\n+\t\tif (!mfi.clean) {\n+\t\t\tif (S_ISGITLINK(mfi.mode))\n+\t\t\t\treason = \"submodule\";\n \t\t\toutput(o, 1, \"CONFLICT (%s): Merge conflict in %s\",\n \t\t\t\t\treason, path);\n-\n-\t\t\tif (o->call_depth)\n-\t\t\t\tupdate_file(o, 0, mfi.sha, mfi.mode, path);\n-\t\t\telse\n-\t\t\t\tupdate_file_flags(o, mfi.sha, mfi.mode, path,\n-\t\t\t\t\t      0 /* update_cache */, 1 /* update_working_directory */);\n \t\t}\n+\t\tupdate_file(o, mfi.clean, mfi.sha, mfi.mode, path);\n \t} else if (!o_sha && !a_sha && !b_sha) {\n \t\t/*\n \t\t * this entry was deleted altogether. a_mode == 0 means\n-- \n1.6.2.1\n"},{"id":"110396","messageId":"7vljqfv3dl.fsf@gitster.siamese.dyndns.org","threadId":"18602","inReplyTo":"1238892420-721-4-git-send-email-drizzd@aon.at","subject":"Re: [PATCH 3/3] simplify output of conflicting merge","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-04-05T09:47:18Z","receivedAt":"2009-04-05T09:47:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Will queue, forking from maint.  Thanks.\n"},{"id":"110406","messageId":"alpine.DEB.1.00.0904051350350.10279@pacific.mpi-cbg.de","threadId":"18602","inReplyTo":"1238892420-721-1-git-send-email-drizzd@aon.at","subject":"Re: Segfault on merge with 1.6.2.1","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-04-05T11:50:48Z","receivedAt":"2009-04-05T11:50:48Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 5 Apr 2009, Clemens Buchacher wrote:\n\n> The segmentation fault is caused by a null pointer dereference which \n> happens during recursive merge with a submodule conflict between two \n> merge bases. This is fixed by the following patches.\n> \n> However, there are other problems with merging submodules. For example, \n> git diff aborts with \"fatal: read error 'sub'\" for conflicting \n> submodules. I have also added a test for this.\n> \n> Dscho has already started working on related issues. I have therefore \n> skipped t7404, which is already used in Dscho's work.\n\nThanks for working on this,\nDscho\n"},{"id":"110500","messageId":"op.urx07jgeso3nzr@sulidor.mdjohnson.us","threadId":"18602","inReplyTo":"1238892420-721-1-git-send-email-drizzd@aon.at","subject":"Re: Segfault on merge with 1.6.2.1","fromName":"Michael Johnson","fromEmail":"redbeard@mdjohnson.us","sentAt":"2009-04-06T02:29:33Z","receivedAt":"2009-04-06T02:29:33Z","isPatch":false,"sender":{"key":"redbeard@mdjohnson.us","avatar":"https://gravatar.com/avatar/3e1cc1194595b043db4cfecbc4fa9a094b93c909ca75ff5667380fab25daadc8?d=mp&s=160"},"body":"On Sat, 04 Apr 2009 19:46:57 -0500, Clemens Buchacher <drizzd@aon.at>  \nwrote:\n\n> The segmentation fault is caused by a null pointer dereference which  \n> happens during recursive merge with a submodule conflict between two\n> merge bases. This is fixed by the following patches.\n\nAmazingly I follow that. And the tracing I was doing now makes sense. I  \nsaw the null pointer dereference, but couldn't figure out why. The  \nsubmodule conflict explains some things about what was going on in the  \ntree.\n\n> +# history\n> +#\n> +#        a --- c\n> +#      /   \\ /\n> +# root      X\n> +#      \\   / \\\n> +#        b --- d\n\nThis also explains a lot. Is there any way to get this sort of simplified  \nrepresentation from the existing tools? I would think gitk would show it,  \nbut would I be able to recognize it.?\n\n> However, there are other problems with merging submodules. For example,  \n> git diff aborts with \"fatal: read error 'sub'\" for conflicting  \n> submodules.\n> I have also added a test for this.\n\nI believe there's a GSoC proposal that would help with this... from what I  \nread of it, it could prove very helpful to my workflow.\n\nAnyway, thanks for all the help. I'll merge the patches in locally and see  \nif they work for me when I get a bit of time. I'm sure they will... it's  \njust for my own peace of mind.\n\nThanks again,\nMichael\n\n-- \nMichael D Johnson   <redbeard@mdjohnson.us>    \nredbeardcreator.deviantart.com\n\n\"Marketing research...[has] shown that energy weapons that make sounds sell\n  better...\" - Kevin Siembieda (Rifts Game Master Guide, pg 111)\n"},{"id":"110521","messageId":"20090406064132.GA25503@localhost","threadId":"18602","inReplyTo":"op.urx07jgeso3nzr@sulidor.mdjohnson.us","subject":"Re: Segfault on merge with 1.6.2.1","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2009-04-06T06:41:32Z","receivedAt":"2009-04-06T06:41:32Z","isPatch":false,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"On Sun, Apr 05, 2009 at 09:29:33PM -0500, Michael Johnson wrote:\n>> +# history\n>> +#\n>> +#        a --- c\n>> +#      /   \\ /\n>> +# root      X\n>> +#      \\   / \\\n>> +#        b --- d\n>\n> This also explains a lot. Is there any way to get this sort of simplified \n> representation from the existing tools? I would think gitk would show it, \n> but would I be able to recognize it.?\n\nI simply tagged everything that showed up in \"git merge-base --all\" and then\nI did \"gitk --all --simplify-by-decoration\". That shows pretty much the\ngraph above.\n"}]}