{"thread":{"id":"64344","subject":"BUG: commit-graph + objects/alternate -> SIGSEGV","startedAt":"2025-10-17T09:47:44Z","lastAt":"2025-10-17T09:54:53Z","messageCount":2,"participants":["Philipp Hahn","Kristoffer Haugsbakk"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"529051","messageId":"20251017094717.626300-1-phahn-oss@avm.de","threadId":"64344","inReplyTo":null,"subject":"BUG: commit-graph + objects/alternate -> SIGSEGV","fromName":"Philipp Hahn","fromEmail":"phahn-oss@avm.de","sentAt":"2025-10-17T09:47:11Z","receivedAt":"2025-10-17T09:47:44Z","isPatch":false,"sender":{"key":"phahn-oss@avm.de","avatar":null},"body":"Thank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\n\n\tgit config --global fetch.writeCommitGraph true\n\n\tSOME_REPO='git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git'\n\tgit clone \"$SOME_REPO\" 1st\n\tgit clone --reference base/.git/objects/ \"$SOME_REPO\" 2nd\n\n\tsleep 14d  # lots of changes upstream happen\n\n\tcat  1st/.git/objects/info/commit-graphs/commit-graph-chain\n\tgit -C 1st fetch origin\n\tcat  1st/.git/objects/info/commit-graphs/commit-graph-chain\n\n\tcat  2nd/.git/objects/info/commit-graphs/commit-graph-chain\n\tgit -C 2nd fetch origin\n\tcat  2nd/.git/objects/info/commit-graphs/commit-graph-chain\n\nWhat did you expect to happen? (Expected behavior)\n\n\tshould work\n\nWhat happened instead? (Actual behavior)\n\n\t`git fetch` crashes with a SIGSEGV respective complains about \"missing commit-graphs\":\n\t> Warnung: konnte nicht alle Commit-Graph-Dateien finden\n\n\t(gdb) bt\n\t#0  __memcpy_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:342\n\t#1  0x000063f176070f97 in hashwrite (f=0x63f1ad38c3b0, buf=0x0, count=20) at ./csum-file.c:126\n\t#2  0x000063f17604b43d in write_graph_chunk_data (f=0x63f1ad38c3b0, data=0x63f1ad7e7f20) at ./commit-graph.c:1240\n\t#3  0x000063f176235dc2 in write_chunkfile (cf=0x63f1ad38c070, data=0x63f1ad7e7f20) at ./chunk-format.c:85\n\t#4  0x000063f17604df55 in write_commit_graph_file (ctx=0x63f1ad7e7f20) at ./commit-graph.c:2132\n\t#5  0x000063f17604f9eb in write_commit_graph (odb=0x63f1ad05d130, pack_indexes=0x0, commits=0x7ffd0f657160, flags=(COMMIT_GRAPH_WRITE_PROGRESS | COMMIT_GRAPH_WRITE_SPLIT), opts=0x0)\n\t    at ./commit-graph.c:2630\n\t#6  0x000063f17604d0d3 in write_commit_graph_reachable (odb=0x63f1ad05d130, flags=(COMMIT_GRAPH_WRITE_PROGRESS | COMMIT_GRAPH_WRITE_SPLIT), opts=0x0) at ./commit-graph.c:1874\n\t#7  0x000063f175f58cdd in cmd_fetch (argc=1, argv=0x7ffd0f658638, prefix=0x0) at builtin/fetch.c:2471\n\t#8  0x000063f175efadda in run_builtin (p=0x63f176349b98 <commands+984>, argc=4, argv=0x7ffd0f658630) at ./git.c:469\n\t#9  0x000063f175efb240 in handle_builtin (argc=4, argv=0x7ffd0f658630) at ./git.c:723\n\t#10 0x000063f175efb4c2 in run_argv (argcp=0x7ffd0f65847c, argv=0x7ffd0f658470) at ./git.c:787\n\t#11 0x000063f175efba9e in cmd_main (argc=4, argv=0x7ffd0f658630) at ./git.c:922\n\t#12 0x000063f176007a64 in main (argc=5, argv=0x7ffd0f658628) at ./common-main.c:62\n\t(gdb) up\n\t#2  0x000063f17604b43d in write_graph_chunk_data (f=0x63f1ad38c3b0, data=0x63f1ad7e7f20) at ./commit-graph.c:1240\n\t1240\t\t\thashwrite(f, tree->hash, the_hash_algo->rawsz);\n\t(gdb) p tree\n\t$7 = (struct object_id *) 0x0\n\t(gdb) l\n\t1235\t\n\t1236\t\t\tif (repo_parse_commit_no_graph(ctx->r, *list))\n\t1237\t\t\t\tdie(_(\"unable to parse commit %s\"),\n\t1238\t\t\t\t\toid_to_hex(&(*list)->object.oid));\n\t1239\t\t\ttree = get_commit_tree_oid(*list);\n\t1240\t\t\thashwrite(f, tree->hash, the_hash_algo->rawsz);\n\t1241\t\n\t1242\t\t\tparent = (*list)->parents;\n\t1243\t\n\t1244\t\t\tif (!parent)\n\nWhat's different between what you expected and what actually happened?\n\n\t`git` should not crash but detect, that the referenced commit-graphs from the\n\talternate repository are no longer there, ignore them and build a new complete\n\tgraph on its own.\n\nAnything else you want to add:\n\n\tMay `git` should detect, that \"alternate repositories\" don't work well with\n\t\"commit graphs\" and should warn about that.\n\n\tOr recomment to disabble `fetch.writeCommitGraph` in repositories, which are used as alternates.\n\n\t2nd/.git/objects/info/commit-graphs/:\n\t\tcommit-graph-chain\n\t\tgraph-eaf006965bd96cbfaea3127fe6faded17e337d81.graph\n\n\t2nd/.git/objects/info/commit-graphs/commit-graph-chain:\n\t\t947ca043c9d5c054195bff874e37bfed738607b3\n\t\t087b52e4f21a976a00a96d80fc10329066c87267\n\t\tc28bc2ddb938daffda137d8847dff685dc361ebf\n\t\teaf006965bd96cbfaea3127fe6faded17e337d81\n\n\t1st/.git/objects/info/commit-graphs/:\n\t\tcommit-graph-chain\n\t\tgraph-00ab433b37dfb9c3a3b2930a68b55005c39fdd1a.graph\n\t\tgraph-7c2471bbb8d6980cbe716b8ffdc0a171c8d12ea9.graph\n\t\tgraph-947ca043c9d5c054195bff874e37bfed738607b3.graph\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.43.0\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Linux 6.8.0-85-generic #85-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 18 15:26:59 UTC 2025 x86_64\ncompiler info: gnuc: 12.2\nlibc info: glibc: 2.39\n$SHELL (typically, interactive shell): /bin/bash\n\n\n[Enabled Hooks]\n"},{"id":"529054","messageId":"68e5557c-3981-4378-bc76-2a986567a699@app.fastmail.com","threadId":"64344","inReplyTo":"20251017094717.626300-1-phahn-oss@avm.de","subject":"Re: BUG: commit-graph + objects/alternate -> SIGSEGV","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2025-10-17T09:54:32Z","receivedAt":"2025-10-17T09:54:53Z","isPatch":false,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"On Fri, Oct 17, 2025, at 11:47, Philipp Hahn wrote:\n>[snip]\n> What happened instead? (Actual behavior)\n>\n> \t`git fetch` crashes with a SIGSEGV respective complains about \"missing\n> commit-graphs\":\n> \t> Warnung: konnte nicht alle Commit-Graph-Dateien finden\n\nThe English translation for that on Git 2.43.0 is\n\n    unable to find all commit-graph files\n"}]}