{"thread":{"id":"43603","subject":"Re: git-merge-recursive segmentation error","startedAt":"2006-12-20T01:10:04Z","lastAt":"2006-12-20T02:39:45Z","messageCount":4,"participants":["Luben Tuikov","Shawn Pearce","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"298707","messageId":"Pine.LNX.4.64.0612191709320.6766@woody.osdl.org","threadId":"43603","inReplyTo":"693577.67723.qm@web31813.mail.mud.yahoo.com","subject":"Re: git-merge-recursive segmentation error","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-12-20T01:10:04Z","receivedAt":"2006-12-20T01:10:04Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 19 Dec 2006, Luben Tuikov wrote:\n>\n> /home/luben/bin/git-merge: line 394: 12030 Segmentation fault      git-merge-$strategy $common -- \"$head_arg\" \"$@\"\n> Merge with strategy recursive failed.\n\nCan you run that by hand under gdb and get a backtrace?\n\n"},{"id":"295833","messageId":"929899.78332.qm@web31809.mail.mud.yahoo.com","threadId":"43603","inReplyTo":"Pine.LNX.4.64.0612191709320.6766@woody.osdl.org","subject":"Re: git-merge-recursive segmentation error","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-12-20T02:15:20Z","receivedAt":"2006-12-20T02:15:20Z","isPatch":false,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Linus Torvalds <torvalds@osdl.org> wrote:\n> Can you run that by hand under gdb and get a backtrace?\n\nLinus,\n\nAuto-merging init/Kconfig\nAuto-merging init/version.c\n\nProgram received signal SIGSEGV, Segmentation fault.\nxdl_merge (orig=Variable \"orig\" is not available.\n) at xdiff/xmerge.c:200\n200                     t2.ptr = (char *)xe2->xdf2.recs[m->i2]->ptr;\n(gdb) bt\n#0  xdl_merge (orig=Variable \"orig\" is not available.\n) at xdiff/xmerge.c:200\n#1  0x000000000040322c in merge_file (o=0x7fffd4f762f0, a=0x7fffd4f76270, b=0x7fffd4f762b0,\nbranch1=0x7fffd4f77976 \"HEAD\", \n    branch2=0x7fffd4f7797b \"cc016448b0bf0764928275d034e367753bde8162\") at merge-recursive.c:667\n#2  0x0000000000404e87 in merge_trees (head=0x12e4a00, merge=0x555328, common=0x555350,\nbranch1=Variable \"branch1\" is not available.\n) at merge-recursive.c:1074\n#3  0x0000000000405376 in merge (h1=0x5452f0, h2=0x545370, branch1=0x7fffd4f77976 \"HEAD\",\nbranch2=0x7fffd4f7797b \"cc016448b0bf0764928275d034e367753bde8162\", call_depth=0, \n    ancestor=0x5453f0, result=0x7fffd4f764e0) at merge-recursive.c:1245\n#4  0x00000000004056a5 in main (argc=Variable \"argc\" is not available.\n) at merge-recursive.c:1312\n\nI also ran git-bisect twice over two well known but overlapping\ngood-bad regions and I get the same commit as being the culprit.\nIt seems to be commit 1510fea781cb0517eeba8c378964f7bc4f9577ab.\n\n    Luben\n"},{"id":"296116","messageId":"20061220023223.GC27638@spearce.org","threadId":"43603","inReplyTo":"929899.78332.qm@web31809.mail.mud.yahoo.com","subject":"Re: git-merge-recursive segmentation error","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-12-20T02:32:23Z","receivedAt":"2006-12-20T02:32:23Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Luben Tuikov <ltuikov@yahoo.com> wrote:\n> --- Linus Torvalds <torvalds@osdl.org> wrote:\n> > Can you run that by hand under gdb and get a backtrace?\n> \n> Linus,\n> \n> Auto-merging init/Kconfig\n> Auto-merging init/version.c\n> \n> Program received signal SIGSEGV, Segmentation fault.\n> xdl_merge (orig=Variable \"orig\" is not available.\n> ) at xdiff/xmerge.c:200\n> 200                     t2.ptr = (char *)xe2->xdf2.recs[m->i2]->ptr;\n> (gdb) bt\n> #0  xdl_merge (orig=Variable \"orig\" is not available.\n> ) at xdiff/xmerge.c:200\n> #1  0x000000000040322c in merge_file (o=0x7fffd4f762f0, a=0x7fffd4f76270, b=0x7fffd4f762b0,\n> branch1=0x7fffd4f77976 \"HEAD\", \n>     branch2=0x7fffd4f7797b \"cc016448b0bf0764928275d034e367753bde8162\") at merge-recursive.c:667\n> #2  0x0000000000404e87 in merge_trees (head=0x12e4a00, merge=0x555328, common=0x555350,\n> branch1=Variable \"branch1\" is not available.\n> ) at merge-recursive.c:1074\n> #3  0x0000000000405376 in merge (h1=0x5452f0, h2=0x545370, branch1=0x7fffd4f77976 \"HEAD\",\n> branch2=0x7fffd4f7797b \"cc016448b0bf0764928275d034e367753bde8162\", call_depth=0, \n>     ancestor=0x5453f0, result=0x7fffd4f764e0) at merge-recursive.c:1245\n> #4  0x00000000004056a5 in main (argc=Variable \"argc\" is not available.\n> ) at merge-recursive.c:1312\n> \n> I also ran git-bisect twice over two well known but overlapping\n> good-bad regions and I get the same commit as being the culprit.\n> It seems to be commit 1510fea781cb0517eeba8c378964f7bc4f9577ab.\n\nOww, the finger points at me!  :-)\n\nHmm.  1510fe does not look right to me.  That return 0 should only\nbe activating when FAST_WORKING_DIRECTORY == 0, so you really want\nthis patch below.  Normally NO_FAST_WORKING_DIRECTORY is _not_\ndefined, which means FAST_WORKING_DIRECTORY == 1, and in that case\nthe if should always be false and the compiler should be stripping\nthe code out entirely.\n\nWhat's odd is that the xdl_merge routine is crashing out because\nthis code activated.  It really should not have, so more work is\nstill required...\n\ndiff --git a/diff.c b/diff.c\nindex 77ba641..1c1de11 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1194,7 +1194,7 @@ static int reuse_worktree_file(const char *name, const unsigned char *sha1, int\n \t * objects however would tend to be slower as they need\n \t * to be individually opened and inflated.\n \t */\n-\tif (FAST_WORKING_DIRECTORY && !want_file && has_sha1_pack(sha1, NULL))\n+\tif (!FAST_WORKING_DIRECTORY && !want_file && has_sha1_pack(sha1, NULL))\n \t\treturn 0;\n \n"},{"id":"298076","messageId":"289759.11706.qm@web31808.mail.mud.yahoo.com","threadId":"43603","inReplyTo":"20061220023223.GC27638@spearce.org","subject":"Re: git-merge-recursive segmentation error","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-12-20T02:39:45Z","receivedAt":"2006-12-20T02:39:45Z","isPatch":false,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Shawn Pearce <spearce@spearce.org> wrote:\n\n> Luben Tuikov <ltuikov@yahoo.com> wrote:\n> > --- Linus Torvalds <torvalds@osdl.org> wrote:\n> > > Can you run that by hand under gdb and get a backtrace?\n> > \n> > Linus,\n> > \n> > Auto-merging init/Kconfig\n> > Auto-merging init/version.c\n> > \n> > Program received signal SIGSEGV, Segmentation fault.\n> > xdl_merge (orig=Variable \"orig\" is not available.\n> > ) at xdiff/xmerge.c:200\n> > 200                     t2.ptr = (char *)xe2->xdf2.recs[m->i2]->ptr;\n> > (gdb) bt\n> > #0  xdl_merge (orig=Variable \"orig\" is not available.\n> > ) at xdiff/xmerge.c:200\n> > #1  0x000000000040322c in merge_file (o=0x7fffd4f762f0, a=0x7fffd4f76270, b=0x7fffd4f762b0,\n> > branch1=0x7fffd4f77976 \"HEAD\", \n> >     branch2=0x7fffd4f7797b \"cc016448b0bf0764928275d034e367753bde8162\") at\n> merge-recursive.c:667\n> > #2  0x0000000000404e87 in merge_trees (head=0x12e4a00, merge=0x555328, common=0x555350,\n> > branch1=Variable \"branch1\" is not available.\n> > ) at merge-recursive.c:1074\n> > #3  0x0000000000405376 in merge (h1=0x5452f0, h2=0x545370, branch1=0x7fffd4f77976 \"HEAD\",\n> > branch2=0x7fffd4f7797b \"cc016448b0bf0764928275d034e367753bde8162\", call_depth=0, \n> >     ancestor=0x5453f0, result=0x7fffd4f764e0) at merge-recursive.c:1245\n> > #4  0x00000000004056a5 in main (argc=Variable \"argc\" is not available.\n> > ) at merge-recursive.c:1312\n> > \n> > I also ran git-bisect twice over two well known but overlapping\n> > good-bad regions and I get the same commit as being the culprit.\n> > It seems to be commit 1510fea781cb0517eeba8c378964f7bc4f9577ab.\n> \n> Oww, the finger points at me!  :-)\n> \n> Hmm.  1510fe does not look right to me.  That return 0 should only\n> be activating when FAST_WORKING_DIRECTORY == 0, so you really want\n> this patch below.  Normally NO_FAST_WORKING_DIRECTORY is _not_\n> defined, which means FAST_WORKING_DIRECTORY == 1, and in that case\n> the if should always be false and the compiler should be stripping\n> the code out entirely.\n> \n> What's odd is that the xdl_merge routine is crashing out because\n> this code activated.  It really should not have, so more work is\n> still required...\n\nThanks.  It is good to see that the solution patches are identical.\nThat fixes the problem.\n\n   Luben\n\n\n> \n> diff --git a/diff.c b/diff.c\n> index 77ba641..1c1de11 100644\n> --- a/diff.c\n> +++ b/diff.c\n> @@ -1194,7 +1194,7 @@ static int reuse_worktree_file(const char *name, const unsigned char\n> *sha1, int\n>  \t * objects however would tend to be slower as they need\n>  \t * to be individually opened and inflated.\n>  \t */\n> -\tif (FAST_WORKING_DIRECTORY && !want_file && has_sha1_pack(sha1, NULL))\n> +\tif (!FAST_WORKING_DIRECTORY && !want_file && has_sha1_pack(sha1, NULL))\n>  \t\treturn 0;\n>  \n>  \tlen = strlen(name);\n> \n"}]}