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

Re: testsuite failures in mainline...

From
DMDavid Miller <davem@davemloft.net>
Date
Dec 14, 2007, 22:24 UTC
Message-ID
<20071214.142448.52660507.davem@davemloft.net>
In-Reply-To
<20071214214533.GA4943@steel.home>
From: Alex Riesen <raa.lkml@gmail.com>
Date: Fri, 14 Dec 2007 22:45:33 +0100
Show 7 quoted lines
> David Miller, Fri, Dec 14, 2007 20:17:36 +0100:
> > ++ git show-ref -q refs/remotes/local/master
> > ++ git branch my3 local/master
> > fatal: Out of memory, malloc failed
> 
> Something unusual about the system? Like a malloc debugger in
> LD_PRELOAD configuration?
No, I'm not doing anything fancy like that.
> Maybe you could retry with a little bit instrumentation?
> (The program last failed (git-branch) is normally very benign...)
> 
> Something like this:
Here is the output from the debugging patch:

++ git branch my3 local/master fatal: Out of memory, malloc(4293963242) at git-compat-util.h:256 failed

This bogus size value in hex is 0xfff0adea, FWIW.
I added similar diags to xmemdupz() and xstrndup() and that gives us:
fatal: Out of memory, xstrndup(0x103ebf:4293902657:4293902657) at remote.c:112 failed
(the first three values are xstrndup() vars 'str', 'len', and
 the computed second argument to xmemdupz).

That bogus length is being generated via the length argument passed to make_branch() by handle_config() in remote.c:

	if (!prefixcmp(key, "branch.")) {
		name = key + 7;
		subkey = strrchr(name, '.');
		branch = make_branch(name, subkey - name);
What if 'subkey' is NULL?  I bet that's what happening here.

I added a debugging check for this and indeed, subkey is NULL in handle_condig() and that's why 'subkey - name' generates that bogus negative length.

The string 'key' is "branch.autosetupmerge" in this case.
Previous: Alex RiesenNext: Junio C Hamano
Message 6 of 9 in “testsuite failures in mainline...”
  1. David MillerDec 14, 2007
  2. Junio C HamanoDec 14, 2007
  3. David MillerDec 14, 2007
  4. Junio C HamanoDec 14, 2007
  5. Alex RiesenDec 14, 2007
  6. David MillerDec 14, 2007
  7. Junio C HamanoDec 14, 2007
  8. David MillerDec 15, 2007
  9. Johannes SchindelinDec 15, 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.