git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Riesen <raa.lkml@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: gitster@pobox.com, git@vger.kernel.org
Subject: Re: testsuite failures in mainline...
Date: Fri, 14 Dec 2007 22:45:33 +0100	[thread overview]
Message-ID: <20071214214533.GA4943@steel.home> (raw)
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;
 }

  parent reply	other threads:[~2007-12-14 21:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-14 18:43 testsuite failures in mainline David Miller
2007-12-14 19:15 ` Junio C Hamano
2007-12-14 19:17   ` David Miller
2007-12-14 20:10     ` Junio C Hamano
2007-12-14 21:45     ` Alex Riesen [this message]
2007-12-14 22:24       ` David Miller
2007-12-14 23:18         ` Junio C Hamano
2007-12-15  0:08           ` David Miller
2007-12-15  1:18             ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071214214533.GA4943@steel.home \
    --to=raa.lkml@gmail.com \
    --cc=davem@davemloft.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).