{"thread":{"id":"14266","subject":"bug found (Re: git-fast-export SIGSEGV on solaris + backtrace)","startedAt":"2008-07-03T00:59:58Z","lastAt":"2008-07-03T12:50:39Z","messageCount":3,"participants":["SungHyun Nam","Junio C Hamano","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"82052","messageId":"486C248E.4060205@gmail.com","threadId":"14266","inReplyTo":"4869B91B.9000709@posdata.co.kr","subject":"bug found (Re: git-fast-export SIGSEGV on solaris + backtrace)","fromName":"SungHyun Nam","fromEmail":"goweol@gmail.com","sentAt":"2008-07-03T00:59:58Z","receivedAt":"2008-07-03T00:59:58Z","isPatch":false,"sender":{"key":"goweol@gmail.com","avatar":null},"body":"Hello,\n\n From the gdb trace:\n\n(gdb) p deco\n$1 = (struct object_decoration *) 0x193150\n(gdb) p idnums\n$3 = {name = 0x0, size = 1500, nr = 7, hash = 0x190270}\n\nIt was 'off-by-one' error.\n0x190270 + (1500 * 8) = 0x193150.\n\nAnd the code says it:\n         for (i = 0; i < idnums.size; ++i) {\n                 deco++;\n                 if (deco && deco->base && deco->base->type == 1) {\n\nThe 'deco' should be post-incremented? or\nChecking code should be  (i < idnums.size - 1)?\n\nRegards,\nnamsh\n\nAnd very minor cleanup:\n\ndiff --git a/decorate.c b/decorate.c\nindex 23f6b00..d8b428c 100644\n--- a/decorate.c\n+++ b/decorate.c\n@@ -36,7 +36,7 @@ static void *insert_decoration(struct decoration *n, \nstruct o>\n  static void grow_decoration(struct decoration *n)\n  {\n         int i;\n-       int old_size = n->size;\n+       int old_size;\n         struct object_decoration *old_hash;\n\n         old_size = n->size;\n\nSungHyun Nam wrote:\n> Hello,\n> \n> Because recent GIT test failed on t9301-fast-export.sh, I traced\n> it. And I found git-fast-export killed by SIGSEGV. I include a\n> gdb backtrace below.\n> If you want to me to check other things, please let me know.\n> \n> Regards,\n> namsh\n> \n> [marks] ~/srcs/git/t/trash directory[66]$ gdb ../../git-fast-export\n> GNU gdb 6.0\n> Copyright 2003 Free Software Foundation, Inc.\n> GDB is free software, covered by the GNU General Public License, and you \n> are\n> welcome to change it and/or distribute copies of it under certain \n> conditions.\n> Type \"show copying\" to see the conditions.\n> There is absolutely no warranty for GDB.  Type \"show warranty\" for details.\n> This GDB was configured as \"sparc-sun-solaris2.9\"...\n> (gdb) r --export-marks=tmp-marks HEAD\n> Starting program: /flyvo2/home/namsh/srcs/git/git-fast-export \n> --export-marks=tmp-marks HEAD\n> blob\n> mark :1\n> data 8\n> Wohlauf\n> \n> reset refs/heads/marks\n> commit refs/heads/marks\n> mark :2\n> author A U Thor <author@example.com> 1112911993 -0700\n> committer C O Mitter <committer@example.com> 1112911993 -0700\n> data 8\n> initial\n> M 100644 :1 file\n> \n> blob\n> mark :3\n> data 9\n> die Luft\n> \n> blob\n> mark :4\n> data 12\n> geht frisch\n> \n> commit refs/heads/marks\n> mark :5\n> author A U Thor <author@example.com> 1112912053 -0700\n> committer C O Mitter <committer@example.com> 1112912053 -0700\n> data 7\n> second\n> from :2\n> M 100644 :3 file\n> M 100644 :4 file2\n> \n> blob\n> mark :6\n> data 4\n> und\n> \n> commit refs/heads/marks\n> mark :7\n> author A U Thor <author@example.com> 1112912113 -0700\n> committer C O Mitter <committer@example.com> 1112912113 -0700\n> data 6\n> third\n> from :5\n> M 100644 :6 file2\n> \n> \n> Program received signal SIGSEGV, Segmentation fault.\n> 0x00043024 in export_marks (file=0xffbff0df \"tmp-marks\")\n>     at builtin-fast-export.c:384\n> 384                     if (deco && deco->base && deco->base->type == 1) {\n> (gdb) p deco\n> $1 = (struct object_decoration *) 0x193150\n> (gdb) p deco->base\n> $2 = (struct object *) 0x2009\n> (gdb) p *(struct object_decoration *) 0x193150\n> $5 = {base = 0x2009, decoration = 0x0}\n> (gdb) p idnums\n> $3 = {name = 0x0, size = 1500, nr = 7, hash = 0x190270}\n> (gdb) p *(struct object_decoration *) 0x190270\n> $6 = {base = 0x0, decoration = 0x0}\n> (gdb) p *(struct object_decoration *) 0x190280\n> $9 = {base = 0x0, decoration = 0x0}\n> (gdb) p *(struct object_decoration *) 0x190290\n> $10 = {base = 0x0, decoration = 0x0}\n> (gdb) p *(struct object_decoration *) 0x1902a0\n> $11 = {base = 0x0, decoration = 0x0}\n> (gdb) p *(struct object_decoration *) 0x1902b0\n> $12 = {base = 0x0, decoration = 0x0}\n> (gdb) p *(struct object_decoration *) 0x1902c0\n> $13 = {base = 0x0, decoration = 0x0}\n> (gdb) p *(struct object_decoration *) 0x193140\n> $14 = {base = 0x0, decoration = 0x0}\n> (gdb) p *(struct object_decoration *) 0x193160\n> $15 = {base = 0x35323962, decoration = 0x63613534}\n> (gdb)\n> \n"},{"id":"82106","messageId":"7vk5g32wve.fsf@gitster.siamese.dyndns.org","threadId":"14266","inReplyTo":"486C248E.4060205@gmail.com","subject":"Re: bug found (Re: git-fast-export SIGSEGV on solaris + backtrace)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-03T08:30:13Z","receivedAt":"2008-07-03T08:30:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"SungHyun Nam <goweol@gmail.com> writes:\n\n> And the code says it:\n>         for (i = 0; i < idnums.size; ++i) {\n>                 deco++;\n>                 if (deco && deco->base && deco->base->type == 1) {\n>\n> The 'deco' should be post-incremented? or\n> Checking code should be  (i < idnums.size - 1)?\n\nThe variable \"deco\" is a pointer that walks over a hashtable from its\noffset 0 to its end, so it can never be NULL (well, the code increments\nbefore it tests the variable for NULLness, so it is clear that the test is\nbogus).\n\nWhat was I smoking when I applied df6a7ff (builtin-fast-export: Add\nimporting and exporting of revision marks, 2008-06-11), I have to\nwonder...\n\nThanks for the fix.\n"},{"id":"82123","messageId":"alpine.DEB.1.00.0807031350050.9925@racer","threadId":"14266","inReplyTo":"7vk5g32wve.fsf@gitster.siamese.dyndns.org","subject":"Re: bug found (Re: git-fast-export SIGSEGV on solaris + backtrace)","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-03T12:50:39Z","receivedAt":"2008-07-03T12:50:39Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 3 Jul 2008, Junio C Hamano wrote:\n\n> What was I smoking when I applied df6a7ff (builtin-fast-export: Add \n> importing and exporting of revision marks, 2008-06-11), I have to \n> wonder...\n\nFWIW I missed it in my review, too...  Well, Junio, it seems we should \navoid smoking together for a while.\n\nCiao,\nDscho\n"}]}