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

Re: testsuite failures in mainline...

From
Alex Riesen <raa.lkml@gmail.com>
Date
Dec 14, 2007, 21:45 UTC
Message-ID
<20071214214533.GA4943@steel.home>
In-Reply-To
<20071214.111736.258936000.davem@davemloft.net>
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?

Maybe you could retry with a little bit instrumentation? (The program last failed (git-branch) is normally very benign...)

Something like this:
diff --git a/git-compat-util.h b/git-compat-util.h
index 79eb10e..a9cc249 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -230,7 +230,8 @@ static inline char* xstrdup(const char *str)
 	return ret;
 }
 
-static inline void *xmalloc(size_t size)
+#define xmalloc(size) xmalloc_((size),__FILE__,__LINE__)
+static inline void *xmalloc_(size_t size, const char *file, int line)
 {
 	void *ret = malloc(size);
 	if (!ret && !size)
@@ -241,7 +242,8 @@ static inline void *xmalloc(size_t size)
 		if (!ret && !size)
 			ret = malloc(1);
 		if (!ret)
-			die("Out of memory, malloc failed");
+			die("Out of memory, malloc(%u) at %s:%d failed",
+			    size, file, line);
 	}
 #ifdef XMALLOC_POISON
 	memset(ret, 0xA5, size);
@@ -263,7 +265,8 @@ static inline char *xstrndup(const char *str, size_t len)
 	return xmemdupz(str, p ? p - str : len);
 }
 
-static inline void *xrealloc(void *ptr, size_t size)
+#define xrealloc(ptr,size) xrealloc_((ptr),(size),__FILE__,__LINE__)
+static inline void *xrealloc_(void *ptr, size_t size, const char *file, int line)
 {
 	void *ret = realloc(ptr, size);
 	if (!ret && !size)
@@ -274,7 +277,8 @@ static inline void *xrealloc(void *ptr, size_t size)
 		if (!ret && !size)
 			ret = realloc(ptr, 1);
 		if (!ret)
-			die("Out of memory, realloc failed");
+			die("Out of memory, realloc(%u) at %s:%d failed",
+			    size, file, line);
 	}
 	return ret;
 }
Previous: Junio C HamanoNext: David Miller
Message 5 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.