git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: SEGV in git-merge recursive:

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 29, 2007, 19:34 UTC
Message-ID
<Pine.LNX.4.64.0703291232190.6730@woody.linux-foundation.org>
In-Reply-To
<20070329183237.GB2809@steel.home>
On Thu, 29 Mar 2007, Alex Riesen wrote:
> 
> tree == 0x0? Strange, I don't get why it is NULL, the initial commit
> definitely hase a tree (git cat-file -p initial-commit shows a tree
> name and there is a tree with that object name).

It's not the initial commit. It's a criss-cross merge, and it's a virtual commit created by a previous level of merging.

Apply this patch to see it blow up much earlier, when that bogus commit with a NULL tree is created.

(I didn't debug *why* that happens, but maybe this gets somebody further)
		Linus
---
 merge-recursive.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index c96e1a7..28f0c30 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -34,6 +34,7 @@ static struct commit *make_virtual_commit(struct tree *tree, const char *comment
 {
 	struct commit *commit = xcalloc(1, sizeof(struct commit));
 	static unsigned virtual_id = 1;
+	assert(tree);
 	commit->tree = tree;
 	commit->util = (void*)comment;
 	*(int*)commit->object.sha1 = virtual_id++;
Previous: Alex RiesenNext: Linus Torvalds
Message 16 of 31 in “SEGV in git-merge recursive:”
  1. Tom PrinceMar 29, 2007
  2. Alex RiesenMar 29, 2007
  3. Tom PrinceMar 29, 2007
  4. Alex RiesenMar 29, 2007
  5. Tom PrinceMar 29, 2007
  6. Alex RiesenMar 29, 2007
  7. Tom PrinceMar 29, 2007
  8. Alex RiesenMar 29, 2007
  9. Alex RiesenMar 29, 2007
  10. Tom PrinceMar 29, 2007
  11. Alex RiesenMar 29, 2007
  12. Alex RiesenMar 29, 2007
  13. Alex RiesenMar 29, 2007
  14. An attempt to resolve a rename/rename conflict in recursive mergeAlex Riesen, Mar 29, 2007
  15. Alex RiesenMar 29, 2007
  16. Linus TorvaldsMar 29, 2007
  17. Linus TorvaldsMar 29, 2007
  18. Alex RiesenMar 29, 2007
  19. Johannes SchindelinMar 30, 2007
  20. Linus TorvaldsMar 31, 2007
  21. Linus TorvaldsMar 31, 2007
  22. Alex RiesenMar 31, 2007
  23. Keep rename/rename conflicts of intermediate merges while doing recursive mergeAlex Riesen, Mar 31, 2007
  24. Jakub NarebskiMar 31, 2007
  25. Johannes SchindelinMar 31, 2007
  26. Johannes SchindelinMar 31, 2007
  27. Linus TorvaldsMar 31, 2007
  28. Alex RiesenMar 31, 2007
  29. Junio C HamanoMar 31, 2007
  30. Johannes SchindelinMar 31, 2007
  31. Tom PrinceMar 29, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.