threads / discuss / 12206

Solaris test failure -- FAIL 61: invalid bool (set)

Subject: Solaris test failure -- FAIL 61: invalid bool (set)

## tl;dr

9 messages between Feb 19, 2008 and Feb 20, 2008.

replies: 8people: 3as markdown or json

Whit Armstrong· Feb 19, 2008, 21:22 UTC · lore
Does anyone have experience with this test failure in t1300-repo-config.sh:
* FAIL 61: invalid bool (set)
                git config --bool bool.nobool foobar
*   ok 62: set --bool
* failed 1 among 70 test(s)
make[1]: *** [t1300-repo-config.sh] Error 1
make[1]: Leaving directory `/home/warmstro/download/git-1.5.4.2/t'
make: *** [test] Error 2

machine information: xs5-trd-p1.grn:warmstro> uname -a SunOS xs5-trd-p1 5.9 Generic_118558-38 sun4u sparc SUNW,Sun-Fire-V240 Solaris xs5-trd-p1.grn:warmstro>

Any suggestions would be much appreciated.

Thanks, Whit

Johannes Schindelin· Feb 19, 2008, 22:21 UTC · re: Whit Armstrong · lore

Re: Solaris test failure -- FAIL 61: invalid bool (set)

Hi,
On Tue, 19 Feb 2008, Whit Armstrong wrote:
Show 9 quoted lines
> Does anyone have experience with this test failure in t1300-repo-config.sh:
> 
> * FAIL 61: invalid bool (set)
> 
> 
>                 git config --bool bool.nobool foobar
> *   ok 62: set --bool
> 
> * failed 1 among 70 test(s)
That is not very instructive.  Can you call the test with
	$ sh t1300-repo-config.sh -i -v
?
> make[1]: Leaving directory `/home/warmstro/download/git-1.5.4.2/t'
Ah, I guess it is 1.5.4.2.

Ciao, Dscho

Whit Armstrong· Feb 19, 2008, 23:17 UTC · re: Johannes Schindelin · lore

Re: Solaris test failure -- FAIL 61: invalid bool (set)

Yes, it's git-1.5.4.2.  Sorry for the omission.

output from $ sh t1300-repo-config.sh -i -v (had to use bash instead of sh, hope that's ok):

*   ok 60: invalid bool (--get)
* expecting failure:
        git config --bool bool.nobool foobar
t1300-repo-config.sh: line -176: 18181 Segmentation Fault      (core
dumped) git config --bool bool.nobool foobar
* FAIL 61: invalid bool (set)
                git config --bool bool.nobool foobar
xs5-trd-p1.grn:warmstro>

Thanks, Whit

On Feb 19, 2008 5:21 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 28 quoted lines
> Hi,
>
> On Tue, 19 Feb 2008, Whit Armstrong wrote:
>
> > Does anyone have experience with this test failure in t1300-repo-config.sh:
> >
> > * FAIL 61: invalid bool (set)
> >
> >
> >                 git config --bool bool.nobool foobar
> > *   ok 62: set --bool
> >
> > * failed 1 among 70 test(s)
>
> That is not very instructive.  Can you call the test with
>
>         $ sh t1300-repo-config.sh -i -v
>
> ?
>
> > make[1]: Leaving directory `/home/warmstro/download/git-1.5.4.2/t'
>
> Ah, I guess it is 1.5.4.2.
>
> Ciao,
> Dscho
>
>
Johannes Schindelin· Feb 19, 2008, 23:31 UTC · re: Whit Armstrong · lore

Re: Solaris test failure -- FAIL 61: invalid bool (set)

Hi,
On Tue, 19 Feb 2008, Whit Armstrong wrote:
Show 13 quoted lines
> Yes, it's git-1.5.4.2.  Sorry for the omission.
> 
> output from  $ sh t1300-repo-config.sh -i -v (had to use bash instead
> of sh, hope that's ok):
> 
> *   ok 60: invalid bool (--get)
> 
> * expecting failure:
> 
>         git config --bool bool.nobool foobar
> t1300-repo-config.sh: line -176: 18181 Segmentation Fault      (core
> dumped) git config --bool bool.nobool foobar
> * FAIL 61: invalid bool (set)

And? Did you actually start that command line with a debugger in t/trash/?

Hth, Dscho

Jeff King· Feb 19, 2008, 23:44 UTC · re: Whit Armstrong · lore

Re: Solaris test failure -- FAIL 61: invalid bool (set)

On Tue, Feb 19, 2008 at 06:17:42PM -0500, Whit Armstrong wrote:
>         git config --bool bool.nobool foobar
> t1300-repo-config.sh: line -176: 18181 Segmentation Fault      (core
> dumped) git config --bool bool.nobool foobar

Ah. The problem is that we use git_config_int() to parse the command line option which, upon failure, attempts to print a message with config_file_name, which is NULL (since we're not parsing a config file currently). On most systems, printf simply prints "(null)", but on Solaris, it segfaults. But we shouldn't be passing NULL anyway on any system, since it makes the message ugly.

This patch fixes it.

-- >8 -- git_config_*: don't assume we are parsing a config file

These functions get called by other code, including parsing config options from the command line. In that case, config_file_name is NULL, leading to an ugly message or even a segfault on some implementations of printf.

---
diff --git a/config.c b/config.c
index 8064cae..c105c13 100644
--- a/config.c
+++ b/config.c
@@ -280,11 +280,18 @@ int git_parse_ulong(const char *value, unsigned long *ret)
 	return 0;
 }
 
+static void die_bad_config(const char *name)
+{
+	if (config_file_name)
+		die("bad config value '%s' in %s", name, config_file_name);
+	die("bad config value for '%s'", name);
+}
+
 int git_config_int(const char *name, const char *value)
 {
 	long ret;
 	if (!git_parse_long(value, &ret))
-		die("bad config value for '%s' in %s", name, config_file_name);
+		die_bad_config(name);
 	return ret;
 }
 
@@ -292,7 +299,7 @@ unsigned long git_config_ulong(const char *name, const char *value)
 {
 	unsigned long ret;
 	if (!git_parse_ulong(value, &ret))
-		die("bad config value for '%s' in %s", name, config_file_name);
+		die_bad_config(name);
 	return ret;
 }
 
Jeff King· Feb 19, 2008, 23:49 UTC · re: Jeff King · lore

Re: Solaris test failure -- FAIL 61: invalid bool (set)

On Tue, Feb 19, 2008 at 06:44:22PM -0500, Jeff King wrote:
Show 5 quoted lines
> +static void die_bad_config(const char *name)
> +{
> +	if (config_file_name)
> +		die("bad config value '%s' in %s", name, config_file_name);
> +	die("bad config value for '%s'", name);
Oops. This first one should read:
  bad config value _for_ '%s'...

Otherwise, test t1300:58 fails when trying to match the text. It's just a typo in my previous patch.

-Peff
Jeff King· Feb 19, 2008, 23:52 UTC · re: Jeff King · lore

Re: Solaris test failure -- FAIL 61: invalid bool (set)

On Tue, Feb 19, 2008 at 06:49:45PM -0500, Jeff King wrote:
> Otherwise, test t1300:58 fails when trying to match the text. It's
> just a typo in my previous patch.

Bah, and there are even more errors at the end of the test (though I am not sure if they are related to the fix, or were there already). I don't have time to look at this anymore right now, but I will try to run the full test suite on Solaris later tonight.

-Peff
Whit Armstrong· Feb 20, 2008, 00:11 UTC · re: Jeff King · lore

Re: Solaris test failure -- FAIL 61: invalid bool (set)

Thanks for the quick patch, Jeff.
That certainly fixes t1300-repo-config.sh.
I must be seeing the same failures as you ( in t3404-rebase-interactive.sh ).
Thanks for your help, everyone.
-Whit
On Feb 19, 2008 6:52 PM, Jeff King <peff@peff.net> wrote:
Show 12 quoted lines
> On Tue, Feb 19, 2008 at 06:49:45PM -0500, Jeff King wrote:
>
> > Otherwise, test t1300:58 fails when trying to match the text. It's
> > just a typo in my previous patch.
>
> Bah, and there are even more errors at the end of the test (though I am
> not sure if they are related to the fix, or were there already). I don't
> have time to look at this anymore right now, but I will try to run the
> full test suite on Solaris later tonight.
>
> -Peff
>
Jeff King· Feb 20, 2008, 05:04 UTC · re: Whit Armstrong · lore

Re: Solaris test failure -- FAIL 61: invalid bool (set)

On Tue, Feb 19, 2008 at 07:11:01PM -0500, Whit Armstrong wrote:
> That certainly fixes t1300-repo-config.sh.
> 
> I must be seeing the same failures as you ( in t3404-rebase-interactive.sh ).

I actually was seeing errors later in t1300, but they were fixed by putting GNU coreutils at the front of my path (btw, we had discussed previously using "diff -u" to compare actual and expected output in many tests -- Solaris diff doesn't understand "-u").

I see the errors in t3404. They are caused by the Solaris /bin/sh not understanding $() syntax. We create a "fake-editor" script to simulate the editor during interactive rebase, and it is hard-coded to /bin/sh.

So we should probably do something like:
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index e5ed745..62e65d7 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -61,8 +61,8 @@ test_expect_success 'setup' '
 	git tag I
 '
 
-cat > fake-editor.sh <<\EOF
-#!/bin/sh
+echo "#!$SHELL" >fake-editor
+cat >> fake-editor.sh <<\EOF
 case "$1" in
 */COMMIT_EDITMSG)
 	test -z "$FAKE_COMMIT_MESSAGE" || echo "$FAKE_COMMIT_MESSAGE" > "$1"

There are probably more instances of this problem, but I haven't
checked. I had high hopes of running the testsuite to completion
tonight, but I am getting stuck now in t3900.

-Peff

← back to recent threads