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

Re: git-merge segfault in 1.6.6 and master

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 20, 2010, 22:21 UTC
Message-ID
<7vtyugzabq.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4B577C3F.7040608@brooklynpenguin.com>
Tim Olsen <tim@brooklynpenguin.com> writes:
> At the beginning of merge_recursive(), the local mrtree appears to be
> set to some globally defined mrtree which is not null:

No; that "assignment" is just to squelch warning from gcc. mrtree at that point is uninitialized.

Show 20 quoted lines
> In merge_trees(), mrtree is the argument **result.  It is at line 1255
> that write_tree_from_memory nulls out the pointee of result:
> ...
> Then in write_tree_from_memory() we find the offending return NULL at
> line 210:
>
> Breakpoint 8, write_tree_from_memory (o=0x7fffffffd560) at
> merge-recursive.c:210
> (gdb) list
> 205				struct cache_entry *ce = active_cache[i];
> 206				if (ce_stage(ce))
> 207					output(o, 0, "%d %.*s", ce_stage(ce),
> 208					       (int)ce_namelen(ce), ce->name);
> 209			}
> 210			return NULL;
> 211		}
> 212	
> 213		if (!active_cache_tree)
> 214			active_cache_tree = cache_tree();
> (gdb)

Are you saying write_tree_from_memory() is returning NULL? That probably means that in the recursive (i.e. the step that first merges multiple common ancestors into one) case the merge is getting conflicts. Do you see these "There are unmerged index entries" output?

In the recursive case (i.e. o->call_depth is non-zero), process_renames() and process_entry() are supposed to be forcing the conflicts resolved, recording the contents with conflict markers if necessary, before the control gets to that point, so it clearly is a bug very specific to the recursive merge implementation.

Previous: Tim OlsenNext: Tim Olsen
Message 4 of 10 in “git-merge segfault in 1.6.6 and master”
  1. Tim OlsenJan 20, 2010
  2. Junio C HamanoJan 20, 2010
  3. Tim OlsenJan 20, 2010
  4. Junio C HamanoJan 20, 2010
  5. Tim OlsenJan 21, 2010
  6. Junio C HamanoJan 21, 2010
  7. Junio C HamanoJan 22, 2010
  8. Junio C HamanoJan 22, 2010
  9. Miklos VajnaJan 21, 2010
  10. Tim OlsenJan 21, 2010

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.