threads / discuss / 2793

Latest cogito broken with bash-3.1

Subject: Latest cogito broken with bash-3.1

## tl;dr

10 messages between Dec 10, 2005 and Dec 12, 2005.

replies: 9people: 4as markdown or json

Marcel Holtmann· Dec 10, 2005, 13:18 UTC · lore
Hi Petr,

I have a Ubuntu Dapper running and since their update to the latest bash version the cg-commit command (and maybe others) is broken. It reports:

GNU bash, version 3.1.0(1)-release (x86_64-pc-linux-gnu) Copyright (C) 2005 Free Software Foundation, Inc.

The cogito is the latest from kernel.org and when calling cg-commit it fails with this message:

cg-commit: line 200: syntax error near unexpected token `(' cg-commit: line 200: ` eval commitfiles=($(cat $filter | path_xargs git-diff-index -r -m HEAD -- | \'

I played a little bit with it and it seems all the eval statements are broken with this bash version. I have no clue how to fix this, but maybe you do.

Regards
Marcel
Petr Baudis· Dec 11, 2005, 00:11 UTC · re: Marcel Holtmann · lore

Re: Latest cogito broken with bash-3.1

  Hello,

Dear diary, on Sat, Dec 10, 2005 at 02:18:44PM CET, I got a letter where Marcel Holtmann <marcel@holtmann.org> said that...

Show 9 quoted lines
> The cogito is the latest from kernel.org and when calling cg-commit it
> fails with this message:
> 
> cg-commit: line 200: syntax error near unexpected token `('
> cg-commit: line 200: `       eval commitfiles=($(cat $filter | path_xargs git-diff-index -r -m HEAD -- | \'
> 
> I played a little bit with it and it seems all the eval statements are
> broken with this bash version. I have no clue how to fix this, but maybe
> you do.
  it seems like the newer bash is stricter than the older versions in
some obscure regards. Quoting the eval arguments (which is the proper
thing to do anyway) fixed that particular problem; I've hit another
problem during a test commit wrt. whitespace separators - I've fixed
that too, and pushed out.
  Thanks,
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.
Marcel Holtmann· Dec 11, 2005, 08:31 UTC · re: Petr Baudis · lore

Re: Latest cogito broken with bash-3.1

Hi Petr,
Show 15 quoted lines
> > The cogito is the latest from kernel.org and when calling cg-commit it
> > fails with this message:
> > 
> > cg-commit: line 200: syntax error near unexpected token `('
> > cg-commit: line 200: `       eval commitfiles=($(cat $filter | path_xargs git-diff-index -r -m HEAD -- | \'
> > 
> > I played a little bit with it and it seems all the eval statements are
> > broken with this bash version. I have no clue how to fix this, but maybe
> > you do.
> 
>   it seems like the newer bash is stricter than the older versions in
> some obscure regards. Quoting the eval arguments (which is the proper
> thing to do anyway) fixed that particular problem; I've hit another
> problem during a test commit wrt. whitespace separators - I've fixed
> that too, and pushed out.

it's now working again. Thanks. What do you think about another release? I haven't checked the other distributions yet, but I just saw that Debian unstable also moved to version 3.1 of bash.

There exists also another problem with the new bash. It is the broken pipe error from cg-log.

cg-log: line 141: echo: write error: Broken pipe

The line number varies depending how much you scrolled and when you scrolled to the end no broken pipe error comes up. Do you have any idea on how to deal with this. I saw your comment about that bash is broken and the extra trap command, but it doesn't help. I never saw that problem with older versions of bash.

Regards
Marcel
Petr Baudis· Dec 12, 2005, 00:26 UTC · re: Marcel Holtmann · lore

Re: Latest cogito broken with bash-3.1

  Hello,

Dear diary, on Sun, Dec 11, 2005 at 09:31:07AM CET, I got a letter where Marcel Holtmann <marcel@holtmann.org> said that...

> it's now working again. Thanks. What do you think about another release?
> I haven't checked the other distributions yet, but I just saw that
> Debian unstable also moved to version 3.1 of bash.
  yes, I was planning 0.16.1 on Sunday anyway. Going to tag it now.
Show 10 quoted lines
> There exists also another problem with the new bash. It is the broken
> pipe error from cg-log.
> 
> cg-log: line 141: echo: write error: Broken pipe
> 
> The line number varies depending how much you scrolled and when you
> scrolled to the end no broken pipe error comes up. Do you have any idea
> on how to deal with this. I saw your comment about that bash is broken
> and the extra trap command, but it doesn't help. I never saw that
> problem with older versions of bash.
  Then that's quite funny, one-line broken pipe message has been always
there (in the past it looked much worse, we thankfully managed to bring
it down to this at least).
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.
Martin Langhoff· Dec 12, 2005, 00:58 UTC · re: Petr Baudis · lore

Re: Latest cogito broken with bash-3.1

On 12/12/05, Petr Baudis <pasky@suse.cz> wrote:
>   Then that's quite funny, one-line broken pipe message has been always
> there (in the past it looked much worse, we thankfully managed to bring
> it down to this at least).

I assume there's no reasonable workaround to that then? What would take to get rid of that (say, if I had a boring weekend ;)?

cheers,
m
Petr Baudis· Dec 12, 2005, 00:59 UTC · re: Martin Langhoff · lore

Re: Latest cogito broken with bash-3.1

Dear diary, on Mon, Dec 12, 2005 at 01:58:00AM CET, I got a letter where Martin Langhoff <martin.langhoff@gmail.com> said that...

Show 6 quoted lines
> On 12/12/05, Petr Baudis <pasky@suse.cz> wrote:
> >   Then that's quite funny, one-line broken pipe message has been always
> > there (in the past it looked much worse, we thankfully managed to bring
> > it down to this at least).
> 
> I assume there's no reasonable workaround to that then?

The trapping is apparently the best we can do - at least I know of nothing better.

> What would take to get rid of that (say, if I had a boring weekend ;)?

Fixing bash, IIRC - and more importantly, convincing its maintainers to take the patch. ;-) Sometime in the spring someone even posted the exact location in bash where this is broken.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.
Marcel Holtmann· Dec 12, 2005, 09:30 UTC · re: Petr Baudis · lore

Re: Latest cogito broken with bash-3.1

Hi Petr,
Show 14 quoted lines
> > There exists also another problem with the new bash. It is the broken
> > pipe error from cg-log.
> > 
> > cg-log: line 141: echo: write error: Broken pipe
> > 
> > The line number varies depending how much you scrolled and when you
> > scrolled to the end no broken pipe error comes up. Do you have any idea
> > on how to deal with this. I saw your comment about that bash is broken
> > and the extra trap command, but it doesn't help. I never saw that
> > problem with older versions of bash.
> 
>   Then that's quite funny, one-line broken pipe message has been always
> there (in the past it looked much worse, we thankfully managed to bring
> it down to this at least).

I have some machines where I stopped installing the latest bash version and they don't have this problem. With bash-2.05b.0 and bash-3.00.16 I never (and really mean never) saw this problem.

It is not related to this, but the make-3.81beta3 breaks all my Debian package rules and I don't have the slightest idea why. It seems that they try to fix some Posix issues and make it worse then any better :(

Regards
Marcel
Petr Baudis· Dec 12, 2005, 10:40 UTC · re: Marcel Holtmann · lore

Re: Latest cogito broken with bash-3.1

  Hi,

Dear diary, on Mon, Dec 12, 2005 at 10:30:01AM CET, I got a letter where Marcel Holtmann <marcel@holtmann.org> said that...

Show 18 quoted lines
> > > There exists also another problem with the new bash. It is the broken
> > > pipe error from cg-log.
> > > 
> > > cg-log: line 141: echo: write error: Broken pipe
> > > 
> > > The line number varies depending how much you scrolled and when you
> > > scrolled to the end no broken pipe error comes up. Do you have any idea
> > > on how to deal with this. I saw your comment about that bash is broken
> > > and the extra trap command, but it doesn't help. I never saw that
> > > problem with older versions of bash.
> > 
> >   Then that's quite funny, one-line broken pipe message has been always
> > there (in the past it looked much worse, we thankfully managed to bring
> > it down to this at least).
> 
> I have some machines where I stopped installing the latest bash version
> and they don't have this problem. With bash-2.05b.0 and bash-3.00.16 I
> never (and really mean never) saw this problem.
  this might be some Debian patches then. Indeed, with bash-3.00.16 on
both systems, the line is shown on my home Gentoo system but not on my
Debian machine at work. On RHEL at kernel.org the line is not printed
either. Hmm. So either it's not really bash what emits this (but what
then?) or most of the distributions override that stupid bash behaviour
with a patch already. And Debian didn't foreport the patch to bash-3.1.
Well, this would make the weekend research more interesting, at least.
;-)
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.
Marcel Holtmann· Dec 12, 2005, 11:02 UTC · re: Petr Baudis · lore

Re: Latest cogito broken with bash-3.1

Hi Petr,
Show 25 quoted lines
> > > > There exists also another problem with the new bash. It is the broken
> > > > pipe error from cg-log.
> > > > 
> > > > cg-log: line 141: echo: write error: Broken pipe
> > > > 
> > > > The line number varies depending how much you scrolled and when you
> > > > scrolled to the end no broken pipe error comes up. Do you have any idea
> > > > on how to deal with this. I saw your comment about that bash is broken
> > > > and the extra trap command, but it doesn't help. I never saw that
> > > > problem with older versions of bash.
> > > 
> > >   Then that's quite funny, one-line broken pipe message has been always
> > > there (in the past it looked much worse, we thankfully managed to bring
> > > it down to this at least).
> > 
> > I have some machines where I stopped installing the latest bash version
> > and they don't have this problem. With bash-2.05b.0 and bash-3.00.16 I
> > never (and really mean never) saw this problem.
> 
>   this might be some Debian patches then. Indeed, with bash-3.00.16 on
> both systems, the line is shown on my home Gentoo system but not on my
> Debian machine at work. On RHEL at kernel.org the line is not printed
> either. Hmm. So either it's not really bash what emits this (but what
> then?) or most of the distributions override that stupid bash behaviour
> with a patch already. And Debian didn't foreport the patch to bash-3.1.

I just verified that on my Ubuntu Dapper system where I had a copy of the old bash package lying around. The bash-3.0 works fine, but the bash-3.1 produces this error. So it is definitely bash related.

Regards
Marcel
Linus Torvalds· Dec 12, 2005, 15:32 UTC · re: Marcel Holtmann · lore

Re: Latest cogito broken with bash-3.1

On Mon, 12 Dec 2005, Marcel Holtmann wrote:
> 
> I just verified that on my Ubuntu Dapper system where I had a copy of
> the old bash package lying around. The bash-3.0 works fine, but the
> bash-3.1 produces this error. So it is definitely bash related.

It's been around forever, and it's a bash default installation issue. It's just that all sane distributions will change the default.

Sounds like debian forgot to do that when upgrading to bash-3.1.
The magic incantation is hidden in the bash FAQ (E2):
	You can build a version of bash that will not report SIGPIPE errors
	by uncommenting the definition of DONT_REPORT_SIGPIPE in the file
	config-top.h.
and I still don't understand why it's not the default. Oh, well.
		Linus

← back to recent threads