{"thread":{"id":"7853","subject":"git died","startedAt":"2007-04-26T09:52:49Z","lastAt":"2007-04-26T20:55:47Z","messageCount":5,"participants":["Christian","Julian Phillips","Linus Torvalds","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"40504","messageId":"46307671.3090109@beronet.com","threadId":"7853","inReplyTo":null,"subject":"git died","fromName":"Christian","fromEmail":"crich-ml@beronet.com","sentAt":"2007-04-26T09:52:49Z","receivedAt":"2007-04-26T09:52:49Z","isPatch":false,"sender":{"key":"crich-ml@beronet.com","avatar":null},"body":"hi list,\n\ni've got git-1.5.1 here and did a git push to a http based repository, i \ngot a segfault :(\n\nplease see the logs :\n\n\nroot@beroTester:/usr/src/mISDN# git push\nFetching remote heads...\n  refs/remotes/origin/\n  refs/remotes/\n  refs/tags/\n  refs/heads/\n  refs/\n'refs/remotes/origin/origin': up-to-date\n'refs/remotes/origin/mqueue': up-to-date\nupdating 'refs/remotes/origin/master'\n  from 943055277343bac48eed11ef6f2a9c8a4139e8bf\n  to   9fe4b6bc5eadbcec188cb0c91910a1b557a27478\n    done\n'refs/remotes/origin/mISDN_1_1': up-to-date\n'refs/remotes/origin/NEWCTRL_BRANCH': up-to-date\nupdating 'refs/remotes/origin/HEAD'\n  from 943055277343bac48eed11ef6f2a9c8a4139e8bf\n  to   9fe4b6bc5eadbcec188cb0c91910a1b557a27478\n    done\n'refs/tags/VERSION_0_1': up-to-date\n'refs/tags/mISDN_1_1_2': up-to-date\n'refs/tags/mISDN_1_0_2': up-to-date\n'refs/tags/mISDN_1_0_0': up-to-date\n'refs/tags/before_mISDN': up-to-date\n'refs/tags/mISDN_1_0_4': up-to-date\n'refs/tags/mISDN_1_1_1': up-to-date\n'refs/tags/mISDN_1_0_1': up-to-date\n'refs/tags/BEFORE_SKB': up-to-date\n'refs/tags/OLDCTRL': up-to-date\n'refs/tags/PRE_MQUEUE': up-to-date\n'refs/tags/mISDN_1_0_3': up-to-date\n'refs/tags/mISDN_1_1_0': up-to-date\n'refs/heads/mISDN_1_1': up-to-date\nupdating 'refs/heads/master'\n  from 9fe4b6bc5eadbcec188cb0c91910a1b557a27478\n  to   4c711e270dcddf90e634f312dbbc002f3c025fc5\nfatal: http-push died with strange error\n\n\n\nroot@beroTester:/usr/src/mISDN# gdb git core\nGNU gdb 6.0\nCopyright 2003 Free Software Foundation, Inc.\nGDB is free software, covered by the GNU General Public License, and you are\nwelcome to change it and/or distribute copies of it under certain \nconditions.\nType \"show copying\" to see the conditions.\nThere is absolutely no warranty for GDB.  Type \"show warranty\" for details.\nThis GDB was configured as \"i386-linux\"...\n\nwarning: core file may not match specified executable file.\nCore was generated by `/usr//bin/git-http-push \nhttp://git.misdn.org/git/mISDN.git/'.\nProgram terminated with signal 11, Segmentation fault.\n#0  0x0806c7ad in git_pack_config (k=0xbff51138 \n\"È\\023õ¿Í4\\005\\b@\\002\\r\\b\\224\\023õ¿Ø\\021õ¿\", v=0x80d0240 \"i\")\n    at builtin-pack-objects.c:1442\n1442            return git_default_config(k, v);\n(gdb) p k\n$1 = 0xbff51138 \"È\\023õ¿Í4\\005\\b@\\002\\r\\b\\224\\023õ¿Ø\\021õ¿\"\n(gdb) p v\n$2 = 0x80d0240 \"i\"\n(gdb) bt\n#0  0x0806c7ad in git_pack_config (k=0xbff51138 \n\"È\\023õ¿Í4\\005\\b@\\002\\r\\b\\224\\023õ¿Ø\\021õ¿\", v=0x80d0240 \"i\")\n    at builtin-pack-objects.c:1442\n#1  0x0804b9a8 in cmd_add (argc=135070272, argv=0xbff51394, \nprefix=0xbff511d8 \"(&\\017\\b\") at builtin-add.c:213\n#2  0x080534cd in find_origin (sb=0x0, parent=0xb7f0ecc0, \norigin=0xbff51428) at builtin-blame.c:337\n#3  0xb7c22eb0 in ?? ()\n(gdb) bt full\n#0  0x0806c7ad in git_pack_config (k=0xbff51138 \n\"È\\023õ¿Í4\\005\\b@\\002\\r\\b\\224\\023õ¿Ø\\021õ¿\", v=0x80d0240 \"i\")\n    at builtin-pack-objects.c:1442\nNo locals.\n#1  0x0804b9a8 in cmd_add (argc=135070272, argv=0xbff51394, \nprefix=0xbff511d8 \"(&\\017\\b\") at builtin-add.c:213\n        st = {st_dev = 0, __pad1 = 0, __st_ino = 0, st_mode = 0, \nst_nlink = 411, st_uid = 0, st_gid = 4096,\n  st_rdev = 8, __pad2 = 25220, st_size = 5057650701223280700, st_blksize \n= 827022072,\n  st_blocks = 3552032753487733380, st_atim = {tv_sec = 119235924, \ntv_nsec = 0}, st_mtim = {tv_sec = 2,\n    tv_nsec = -1074458392}, st_ctim = {tv_sec = 134573638, tv_nsec = 8}, \nst_ino = 13831980762889212616}\n        i = Variable \"i\" is not available.\n(gdb)\n"},{"id":"40505","messageId":"Pine.LNX.4.64.0704261126300.15751@reaper.quantumfyre.co.uk","threadId":"7853","inReplyTo":"46307671.3090109@beronet.com","subject":"Re: git died","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-04-26T10:28:32Z","receivedAt":"2007-04-26T10:28:32Z","isPatch":false,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Thu, 26 Apr 2007, Christian wrote:\n\n> hi list,\n>\n> i've got git-1.5.1 here and did a git push to a http based repository, i got \n> a segfault :(\n>\n> please see the logs :\n\n...\n\n> root@beroTester:/usr/src/mISDN# gdb git core\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 are\n> welcome to change it and/or distribute copies of it under certain 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 \"i386-linux\"...\n>\n> warning: core file may not match specified executable file.\n> Core was generated by `/usr//bin/git-http-push\n\ngit-http-push is a separate program.  You might want to try \"gdb \ngit-http-push core\"?\n\n-- \nJulian\n\n  ---\n"},{"id":"40511","messageId":"46309924.70401@beronet.com","threadId":"7853","inReplyTo":"Pine.LNX.4.64.0704261126300.15751@reaper.quantumfyre.co.uk","subject":"Re: git died","fromName":"Christian","fromEmail":"crich-ml@beronet.com","sentAt":"2007-04-26T12:20:52Z","receivedAt":"2007-04-26T12:20:52Z","isPatch":false,"sender":{"key":"crich-ml@beronet.com","avatar":null},"body":"Julian Phillips wrote:\n> On Thu, 26 Apr 2007, Christian wrote:\n>\n>> hi list,\n>>\n>> i've got git-1.5.1 here and did a git push to a http based \n>> repository, i got a segfault :(\n>>\n>> please see the logs :\n>\n> ...\n>\n>> root@beroTester:/usr/src/mISDN# gdb git core\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 \n>> you 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 \n>> details.\n>> This GDB was configured as \"i386-linux\"...\n>>\n>> warning: core file may not match specified executable file.\n>> Core was generated by `/usr//bin/git-http-push\n>\n> git-http-push is a separate program.  You might want to try \"gdb \n> git-http-push core\"?\n>\nLoaded symbols for /lib/tls/libnss_dns.so.2\n#0  decode_tree_entry (desc=0xbff5110c, buf=0x0, size=454) at tree-walk.c:10\n10              while ((c = *str++) != ' ') {\n(gdb) bt\n#0  decode_tree_entry (desc=0xbff5110c, buf=0x0, size=454) at tree-walk.c:10\n#1  0x0804b9a8 in mark_tree_uninteresting (tree=0x80d0240) at revision.c:65\n#2  0x080534cd in main (argc=2, argv=Cannot access memory at address 0x1ca\n) at http-push.c:1998\n(gdb)\n"},{"id":"40529","messageId":"alpine.LFD.0.98.0704261246270.9964@woody.linux-foundation.org","threadId":"7853","inReplyTo":"46309924.70401@beronet.com","subject":"Re: git died","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-04-26T19:51:52Z","receivedAt":"2007-04-26T19:51:52Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 26 Apr 2007, Christian wrote:\n\n> Julian Phillips wrote:\n> \n> Loaded symbols for /lib/tls/libnss_dns.so.2\n> #0  decode_tree_entry (desc=0xbff5110c, buf=0x0, size=454) at tree-walk.c:10\n> 10              while ((c = *str++) != ' ') {\n> (gdb) bt\n> #0  decode_tree_entry (desc=0xbff5110c, buf=0x0, size=454) at tree-walk.c:10\n> #1  0x0804b9a8 in mark_tree_uninteresting (tree=0x80d0240) at revision.c:65\n> #2  0x080534cd in main (argc=2, argv=Cannot access memory at address 0x1ca\n> ) at http-push.c:1998\n\nIt looks like some strange corruption in http-push.\n\nYou seem to have a NULL \"buf\" pointer (which certainly explains a \nSIGSEGV!), but mark_tree_uninteresting will have done\n\n\tif (parse_tree(tree) < 0)\n\t\tdie(\"bad tree %s\", sha1_to_hex(obj->sha1));\n\n\tinit_tree_desc(&desc, tree->buffer, tree->size);\n\twhile (tree_entry(&desc, &entry)) {\n\t\t..\n\n\nand tree_entry() does\n\n\t*entry = desc->entry;\n\tupdate_tree_entry(desc);\n\nand none of that sets \"entry->buf\" to NULL unless \"size\" was also zero.\n\nCan you run it under something like valgrind? You'd need to run \n\"git-http-push\" directly (as I don't think valgrind follows forks, and \neven if you can make it do so some way that would just be horribly slow \nand hard to debug).\n\n\t\tLinus\n"},{"id":"40531","messageId":"7vvefisvn0.fsf@assigned-by-dhcp.cox.net","threadId":"7853","inReplyTo":"alpine.LFD.0.98.0704261246270.9964@woody.linux-foundation.org","subject":"Re: git died","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-04-26T20:55:47Z","receivedAt":"2007-04-26T20:55:47Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@linux-foundation.org> writes:\n\n> On Thu, 26 Apr 2007, Christian wrote:\n>\n>> Julian Phillips wrote:\n>> \n>> Loaded symbols for /lib/tls/libnss_dns.so.2\n>> #0  decode_tree_entry (desc=0xbff5110c, buf=0x0, size=454) at tree-walk.c:10\n>> 10              while ((c = *str++) != ' ') {\n>> (gdb) bt\n>> #0  decode_tree_entry (desc=0xbff5110c, buf=0x0, size=454) at tree-walk.c:10\n>> #1  0x0804b9a8 in mark_tree_uninteresting (tree=0x80d0240) at revision.c:65\n>> #2  0x080534cd in main (argc=2, argv=Cannot access memory at address 0x1ca\n>> ) at http-push.c:1998\n>\n> It looks like some strange corruption in http-push.\n> \n> You seem to have a NULL \"buf\" pointer (which certainly explains a \n> SIGSEGV!), but mark_tree_uninteresting will have done\n>\n> \tif (parse_tree(tree) < 0)\n> \t\tdie(\"bad tree %s\", sha1_to_hex(obj->sha1));\n>\n> \tinit_tree_desc(&desc, tree->buffer, tree->size);\n> \twhile (tree_entry(&desc, &entry)) {\n> \t\t..\n>\n>\n> and tree_entry() does\n>\n> \t*entry = desc->entry;\n> \tupdate_tree_entry(desc);\n>\n> and none of that sets \"entry->buf\" to NULL unless \"size\" was also zero.\n\nThis has been bugging me for quite some time by now.\n\nThe call to parse_tree is coming from mark_edge_parents_uninteresting(),\nwhich in turn is called from mark_edges_uninteresting(), both in\nhttp-push.c\n\nHowever, I think these two functions are cut&paste from old rev-list.c,\nwhich we refactored into list-objects.c some time ago (list-objects.c\nhas almost identical looking functions).\n\nI admit that I do not care much about http-push, but I looked at\nthese two functions in list-objects.c; it is not clear why we do\nnot get the same error while running rev-list --objects-edge\n(aka \"thin pack transfer\").\n\nmark_edges_uninteresting calls mark_tree_uninteresting() on the\ntree associated with uninteresting edge commits.  I am\nreasonably sure that these commits have always been parsed when\nprepare_revision_walk() returns.  However, it also calls\nmark_edge_parents_uninteresting(), trying to make the parent\ncommit and its tree uninteresting.  I do not see how we are\nguaranteeing that the parents are parsed (and their trees are\navailable to us).\n\nWhile I think your analysis above is correct, which means that\nthe breakage Julian is seeing (which does not have NULL tree\nobject) has nothing to do with what I observed above, I'd sleep\nbetter if we had something like this patch:\n\n\n http-push.c    |    2 ++\n list-objects.c |    2 ++\n 2 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/http-push.c b/http-push.c\nindex e3f7675..156f42e 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -1995,6 +1995,8 @@ static void mark_edge_parents_uninteresting(struct commit *commit)\n \t\tstruct commit *parent = parents->item;\n \t\tif (!(parent->object.flags & UNINTERESTING))\n \t\t\tcontinue;\n+\t\tif (!parent->object.parsed)\n+\t\t\tparse_object(parent->object.sha1);\n \t\tmark_tree_uninteresting(parent->tree);\n \t}\n }\ndiff --git a/list-objects.c b/list-objects.c\nindex 310f8d3..c2e74f1 100644\n--- a/list-objects.c\n+++ b/list-objects.c\n@@ -109,6 +109,8 @@ static void mark_edge_parents_uninteresting(struct commit *commit,\n \t\tstruct commit *parent = parents->item;\n \t\tif (!(parent->object.flags & UNINTERESTING))\n \t\t\tcontinue;\n+\t\tif (!parent->object.parsed)\n+\t\t\tparse_object(parent->object.sha1);\n \t\tmark_tree_uninteresting(parent->tree);\n \t\tif (revs->edge_hint && !(parent->object.flags & SHOWN)) {\n \t\t\tparent->object.flags |= SHOWN;\n"}]}