Re: testsuite failures in mainline...

4 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: testsuite failures in mainline...

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:59

David Miller [off-list ref] writes:
I've been seeing this for I think a week or two, and I can't figure
out if it's some local problem of mine.  I even reran the testsuite
with "PATH=$(pwd):$PATH" just in case it was picking up my existing
1.5.3.7 installation for some reason, but it still fails even in that
case.

Is the following a known issue?
No, you are the first to report it here.  I do not push out the tip of
'master' and 'next' unless all tests pass in my primary repository on my
private machine and in a repository under my k.org account, so you can
at least assume all tests has passed for _some_ people.  It of course
does not guarantee there isn't timing related bugs I am not catching. 
*** t3200-branch.sh ***
...
* FAIL 20: test tracking setup via config
        git config branch.autosetupmerge true &&
             git config remote.local.url . &&
             git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
             (git show-ref -q refs/remotes/local/master || git-fetch local) &&
             git branch my3 local/master &&
             test $(git config branch.my3.remote) = local &&
             test $(git config branch.my3.merge) = refs/heads/master
When I can reproduce a breakage, in our tests, I'd run

	cd t && sh -x t3200-branch.sh -i -v

(replace "t3200-*" with the failing test) and see which one of the steps
chained with && is breaking first.

Re: testsuite failures in mainline...

From: David Miller <davem@davemloft.net>
Date: 2016-06-15 22:43:59

From: Junio C Hamano <redacted>
Date: Fri, 14 Dec 2007 11:15:01 -0800
When I can reproduce a breakage, in our tests, I'd run

	cd t && sh -x t3200-branch.sh -i -v

(replace "t3200-*" with the failing test) and see which one of the steps
chained with && is breaking first.
Looks like a malloc() failure:

+ test_expect_success 'test tracking setup via config' 'git config branch.autosetupmerge true &&
     git config remote.local.url . &&
     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
     (git show-ref -q refs/remotes/local/master || git-fetch local) &&
     git branch my3 local/master &&
     test $(git config branch.my3.remote) = local &&
     test $(git config branch.my3.merge) = refs/heads/master'
+ test 2 = 2
+ test_skip 'test tracking setup via config' 'git config branch.autosetupmerge true &&
     git config remote.local.url . &&
     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
     (git show-ref -q refs/remotes/local/master || git-fetch local) &&
     git branch my3 local/master &&
     test $(git config branch.my3.remote) = local &&
     test $(git config branch.my3.merge) = refs/heads/master'
++ expr ./t3200-branch.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t3200
++ expr 19 + 1
+ this_test=t3200.20
+ to_skip=
+ case "$to_skip" in
+ false
+ say 'expecting success: git config branch.autosetupmerge true &&
     git config remote.local.url . &&
     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
     (git show-ref -q refs/remotes/local/master || git-fetch local) &&
     git branch my3 local/master &&
     test $(git config branch.my3.remote) = local &&
     test $(git config branch.my3.merge) = refs/heads/master'
+ say_color info 'expecting success: git config branch.autosetupmerge true &&
     git config remote.local.url . &&
     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
     (git show-ref -q refs/remotes/local/master || git-fetch local) &&
     git branch my3 local/master &&
     test $(git config branch.my3.remote) = local &&
     test $(git config branch.my3.merge) = refs/heads/master'
+ test -z info
+ shift
+ echo '* expecting success: git config branch.autosetupmerge true &&
     git config remote.local.url . &&
     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
     (git show-ref -q refs/remotes/local/master || git-fetch local) &&
     git branch my3 local/master &&
     test $(git config branch.my3.remote) = local &&
     test $(git config branch.my3.merge) = refs/heads/master'
* expecting success: git config branch.autosetupmerge true &&
     git config remote.local.url . &&
     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
     (git show-ref -q refs/remotes/local/master || git-fetch local) &&
     git branch my3 local/master &&
     test $(git config branch.my3.remote) = local &&
     test $(git config branch.my3.merge) = refs/heads/master
+ test_run_ 'git config branch.autosetupmerge true &&
     git config remote.local.url . &&
     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
     (git show-ref -q refs/remotes/local/master || git-fetch local) &&
     git branch my3 local/master &&
     test $(git config branch.my3.remote) = local &&
     test $(git config branch.my3.merge) = refs/heads/master'
+ eval 'git config branch.autosetupmerge true &&
     git config remote.local.url . &&
     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
     (git show-ref -q refs/remotes/local/master || git-fetch local) &&
     git branch my3 local/master &&
     test $(git config branch.my3.remote) = local &&
     test $(git config branch.my3.merge) = refs/heads/master'
++ git config branch.autosetupmerge true
++ git config remote.local.url .
++ git config remote.local.fetch 'refs/heads/*:refs/remotes/local/*'
++ git show-ref -q refs/remotes/local/master
++ git branch my3 local/master
fatal: Out of memory, malloc failed
+ eval_ret=128
+ return 0
+ '[' 0 = 0 -a 128 = 0 ']'
+ test_failure_ 'test tracking setup via config' 'git config branch.autosetupmerge true &&
     git config remote.local.url . &&
     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
     (git show-ref -q refs/remotes/local/master || git-fetch local) &&
     git branch my3 local/master &&
     test $(git config branch.my3.remote) = local &&
     test $(git config branch.my3.merge) = refs/heads/master'
++ expr 19 + 1
+ test_count=20
++ expr 0 + 1
+ test_failure=1
+ say_color error 'FAIL 20: test tracking setup via config'
+ test -z error
+ shift
+ echo '* FAIL 20: test tracking setup via config'
* FAIL 20: test tracking setup via config
+ shift
+ echo 'git config branch.autosetupmerge true &&
     git config remote.local.url . &&
     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
     (git show-ref -q refs/remotes/local/master || git-fetch local) &&
     git branch my3 local/master &&
     test $(git config branch.my3.remote) = local &&
     test $(git config branch.my3.merge) = refs/heads/master'
+ sed -e 's/^/	/'
	git config branch.autosetupmerge true &&
	     git config remote.local.url . &&
	     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	     (git show-ref -q refs/remotes/local/master || git-fetch local) &&
	     git branch my3 local/master &&
	     test $(git config branch.my3.remote) = local &&
	     test $(git config branch.my3.merge) = refs/heads/master
+ test t = ''
+ trap - exit
+ exit 1

Re: testsuite failures in mainline...

From: Alex Riesen <hidden>
Date: 2016-06-15 22:43:59

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;
 }

Re: testsuite failures in mainline...

From: David Miller <davem@davemloft.net>
Date: 2016-06-15 22:43:59

From: Alex Riesen <redacted>
Date: Fri, 14 Dec 2007 22:45:33 +0100
David Miller, Fri, Dec 14, 2007 20:17:36 +0100:
quoted
++ 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help