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

9 messages from 2008-02-19 to 2008-02-20. Participants: Whit Armstrong, Johannes Schindelin, Jeff King.
Thread: https://gitlist.dev/t/12206

## Whit Armstrong, 2008-02-19 21:22

Subject: Solaris test failure -- FAIL 61: invalid bool (set)
Message-ID: <8ec76080802191322t2417ea48y1537011f1031dff8@mail.gmail.com>
URL: https://gitlist.dev/e/8ec76080802191322t2417ea48y1537011f1031dff8%40mail.gmail.com

```
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, 2008-02-19 22:21

Subject: Re: Solaris test failure -- FAIL 61: invalid bool (set)
Message-ID: <alpine.LSU.1.00.0802192220440.7826@racer.site>
URL: https://gitlist.dev/e/alpine.LSU.1.00.0802192220440.7826%40racer.site
In-Reply-To: <8ec76080802191322t2417ea48y1537011f1031dff8@mail.gmail.com>

```
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

```

## Whit Armstrong, 2008-02-19 23:17

Subject: Re: Solaris test failure -- FAIL 61: invalid bool (set)
Message-ID: <8ec76080802191517k5f070d45l497063d93e080272@mail.gmail.com>
URL: https://gitlist.dev/e/8ec76080802191517k5f070d45l497063d93e080272%40mail.gmail.com
In-Reply-To: <alpine.LSU.1.00.0802192220440.7826@racer.site>

```
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:
> 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, 2008-02-19 23:31

Subject: Re: Solaris test failure -- FAIL 61: invalid bool (set)
Message-ID: <alpine.LSU.1.00.0802200030390.8333@wbgn129.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/alpine.LSU.1.00.0802200030390.8333%40wbgn129.biozentrum.uni-wuerzburg.de
In-Reply-To: <8ec76080802191517k5f070d45l497063d93e080272@mail.gmail.com>

```
Hi,

On Tue, 19 Feb 2008, Whit Armstrong wrote:

> 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, 2008-02-19 23:44

Subject: Re: Solaris test failure -- FAIL 61: invalid bool (set)
Message-ID: <20080219234422.GA9987@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20080219234422.GA9987%40coredump.intra.peff.net
In-Reply-To: <8ec76080802191517k5f070d45l497063d93e080272@mail.gmail.com>

```
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, 2008-02-19 23:49

Subject: Re: Solaris test failure -- FAIL 61: invalid bool (set)
Message-ID: <20080219234945.GB9987@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20080219234945.GB9987%40coredump.intra.peff.net
In-Reply-To: <20080219234422.GA9987@coredump.intra.peff.net>

```
On Tue, Feb 19, 2008 at 06:44:22PM -0500, Jeff King wrote:

> +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, 2008-02-19 23:52

Subject: Re: Solaris test failure -- FAIL 61: invalid bool (set)
Message-ID: <20080219235250.GA12979@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20080219235250.GA12979%40coredump.intra.peff.net
In-Reply-To: <20080219234945.GB9987@coredump.intra.peff.net>

```
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, 2008-02-20 00:11

Subject: Re: Solaris test failure -- FAIL 61: invalid bool (set)
Message-ID: <8ec76080802191611s3348beb1icd0b24db8b0a9556@mail.gmail.com>
URL: https://gitlist.dev/e/8ec76080802191611s3348beb1icd0b24db8b0a9556%40mail.gmail.com
In-Reply-To: <20080219235250.GA12979@coredump.intra.peff.net>

```
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:
> 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, 2008-02-20 05:04

Subject: Re: Solaris test failure -- FAIL 61: invalid bool (set)
Message-ID: <20080220050420.GA16745@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20080220050420.GA16745%40coredump.intra.peff.net
In-Reply-To: <8ec76080802191611s3348beb1icd0b24db8b0a9556@mail.gmail.com>

```
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

```
