Debian Bug report logs - #522255
"/usr/share/debconf/confmodule: line 65: $@: unbound variable" with bash 4 and posh

version graph

Package: debconf; Maintainer for debconf is Debconf Developers <debconf-devel@lists.alioth.debian.org>; Source for debconf is src:debconf.

Reported by: Laurent Bonnaud <Laurent.Bonnaud@inpg.fr>

Date: Tue, 24 Mar 2009 14:51:01 UTC

Severity: serious

Found in version debconf/1.5.26

Done: Joey Hess <joeyh@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Firebird Group <pkg-firebird-general@lists.alioth.debian.org>:
Bug#521046; Package firebird2.1-classic. (Tue, 24 Mar 2009 14:51:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Laurent Bonnaud <Laurent.Bonnaud@inpg.fr>:
New Bug report received and forwarded. Copy sent to Debian Firebird Group <pkg-firebird-general@lists.alioth.debian.org>. (Tue, 24 Mar 2009 14:51:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Laurent Bonnaud <Laurent.Bonnaud@inpg.fr>
To: Debian BTS submission <submit@bugs.debian.org>
Subject: firebird2.1-classic: postinst failure
Date: Tue, 24 Mar 2009 15:44:57 +0100
Package: firebird2.1-classic
Version: 2.1.1.17910-release.ds1-3+b1
Justification: postinst script must not fail
Severity: serious


Hi,

here is the problem:

Setting up firebird2.1-classic (2.1.1.17910-release.ds1-3+b1) ...
/usr/share/debconf/confmodule: line 65: $@: unbound variable
dpkg: error processing firebird2.1-classic (--configure):


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.28-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages firebird2.1-classic depends on:
ii  debconf [de 1.5.26                       Debian configuration management sy
ii  firebird2.1 2.1.1.17910-release.ds1-3+b1 common files for firebird 2.1 serv
ii  firebird2.1 2.1.1.17910-release.ds1-3    copyright, licnesing anc changelog
ii  firebird2.1 2.1.1.17910-release.ds1-3+b1 common files for firebird 2.1 serv
ii  libc6       2.9-6                        GNU C Library: Shared libraries
ii  libedit2    2.11~20080614-1              BSD editline and history libraries
ii  libfbembed2 2.1.1.17910-release.ds1-3+b1 Firebird embedded client/server li
ii  libgcc1     1:4.4-20090317-1             GCC support library
ii  libstdc++6  4.4-20090317-1               The GNU Standard C++ Library v3
ii  netbase     4.34                         Basic TCP/IP networking system
ii  openbsd-ine 0.20080125-2                 The OpenBSD Internet Superserver

firebird2.1-classic recommends no packages.

Versions of packages firebird2.1-classic suggests:
ii  firebird2.1-do 2.1.1.17910-release.ds1-3 Documentation files for firebird d

-- debconf information:
  shared/firebird/sysdba_password/new_password: (password omitted)
* shared/firebird/sysdba_password/first_install: (password omitted)
  shared/firebird/sysdba_password/upgrade_reconfigure: (password omitted)
  shared/firebird/title:
  shared/firebird/enabled: false
  shared/firebird/purge_security: false
  shared/firebird/server_in_use:
  shared/firebird/purge_databases: false

-- 
Laurent Bonnaud.
http://www.lis.inpg.fr/pages_perso/bonnaud/






Information forwarded to debian-bugs-dist@lists.debian.org, Debian Firebird Group <pkg-firebird-general@lists.alioth.debian.org>:
Bug#521046; Package firebird2.1-classic. (Mon, 30 Mar 2009 15:15:03 GMT) Full text and rfc822 format available.

Message #8 received at 521046@bugs.debian.org (full text, mbox):

From: Damyan Ivanov <dmn@debian.org>
To: Laurent Bonnaud <Laurent.Bonnaud@inpg.fr>, 521046@bugs.debian.org
Subject: Re: Bug#521046: firebird2.1-classic: postinst failure
Date: Mon, 30 Mar 2009 18:12:22 +0300
severity 521046 normal
tags 521046 unreproducible moreinfo
thanks

-=| Laurent Bonnaud, Tue, Mar 24, 2009 at 03:44:57PM +0100 |=-
> here is the problem:
> 
> Setting up firebird2.1-classic (2.1.1.17910-release.ds1-3+b1) ...
> /usr/share/debconf/confmodule: line 65: $@: unbound variable
> dpkg: error processing firebird2.1-classic (--configure):

I am unable to reproduce the problem. It looks very strange as $@ is 
a shell-internal variable and is never "unbound":

  $ ( set -u; print $@ )
  $
(i.e. no errors)

Can you give me instructions how to reproduce that?

-- 
dam            JabberID: dam@jabber.minus273.org




Severity set to `normal' from `serious' Request was from Damyan Ivanov <dmn@debian.org> to control@bugs.debian.org. (Mon, 30 Mar 2009 15:15:04 GMT) Full text and rfc822 format available.

Tags added: unreproducible, moreinfo Request was from Damyan Ivanov <dmn@debian.org> to control@bugs.debian.org. (Mon, 30 Mar 2009 15:15:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Firebird Group <pkg-firebird-general@lists.alioth.debian.org>:
Bug#521046; Package firebird2.1-classic. (Mon, 30 Mar 2009 18:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Adam D. Barratt" <adam@adam-barratt.org.uk>:
Extra info received and forwarded to list. Copy sent to Debian Firebird Group <pkg-firebird-general@lists.alioth.debian.org>. (Mon, 30 Mar 2009 18:51:02 GMT) Full text and rfc822 format available.

Message #17 received at 521046@bugs.debian.org (full text, mbox):

From: "Adam D. Barratt" <adam@adam-barratt.org.uk>
To: Damyan Ivanov <dmn@debian.org>, 521046@bugs.debian.org
Cc: Laurent Bonnaud <Laurent.Bonnaud@inpg.fr>
Subject: Re: Bug#521046: firebird2.1-classic: postinst failure
Date: Mon, 30 Mar 2009 19:48:30 +0100
On Mon, 2009-03-30 at 18:12 +0300, Damyan Ivanov wrote:
> severity 521046 normal
> tags 521046 unreproducible moreinfo
> thanks
> 
> -=| Laurent Bonnaud, Tue, Mar 24, 2009 at 03:44:57PM +0100 |=-
> > here is the problem:
> > 
> > Setting up firebird2.1-classic (2.1.1.17910-release.ds1-3+b1) ...
> > /usr/share/debconf/confmodule: line 65: $@: unbound variable
> > dpkg: error processing firebird2.1-classic (--configure):
> 
> I am unable to reproduce the problem. It looks very strange as $@ is 
> a shell-internal variable and is never "unbound":

It is with bash 4.0 (and posh, apparently). :-/ Not sure if that's the
case here, but it's worth checking...

See http://lists.debian.org/debian-devel/2009/03/msg00432.html for a
related discussion.

Regards,

Adam




Tags removed: unreproducible Request was from Damyan Ivanov <dmn@debian.org> to control@bugs.debian.org. (Thu, 02 Apr 2009 06:51:03 GMT) Full text and rfc822 format available.

Severity set to `important' from `normal' Request was from Damyan Ivanov <dmn@debian.org> to control@bugs.debian.org. (Thu, 02 Apr 2009 06:51:04 GMT) Full text and rfc822 format available.

Bug 521046 cloned as bug 522255. Request was from Damyan Ivanov <dmn@debian.org> to control@bugs.debian.org. (Thu, 02 Apr 2009 06:51:05 GMT) Full text and rfc822 format available.

Bug reassigned from package `firebird2.1-classic' to `debconf'. Request was from Damyan Ivanov <dmn@debian.org> to control@bugs.debian.org. (Thu, 02 Apr 2009 06:51:06 GMT) Full text and rfc822 format available.

Bug no longer marked as found in version 2.1.1.17910-release.ds1-3+b1. Request was from Damyan Ivanov <dmn@debian.org> to control@bugs.debian.org. (Thu, 02 Apr 2009 06:51:07 GMT) Full text and rfc822 format available.

Bug marked as found in version 1.5.26. Request was from Damyan Ivanov <dmn@debian.org> to control@bugs.debian.org. (Thu, 02 Apr 2009 06:51:08 GMT) Full text and rfc822 format available.

Changed Bug title to `"/usr/share/debconf/confmodule: line 65: $@: unbound variable" with bash 4 and posh' from `firebird2.1-classic: postinst failure'. Request was from Damyan Ivanov <dmn@debian.org> to control@bugs.debian.org. (Thu, 02 Apr 2009 06:51:09 GMT) Full text and rfc822 format available.

Blocking bugs of 521046 added: 522255 Request was from Damyan Ivanov <dmn@debian.org> to control@bugs.debian.org. (Thu, 02 Apr 2009 10:06:12 GMT) Full text and rfc822 format available.

Tags removed: moreinfo Request was from Joey Hess <joeyh@debian.org> to control@bugs.debian.org. (Fri, 03 Apr 2009 18:45:03 GMT) Full text and rfc822 format available.

Blocking bugs of 522255 added: 519165 Request was from Joey Hess <joeyh@debian.org> to control@bugs.debian.org. (Fri, 03 Apr 2009 18:48:13 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debconf Developers <debconf-devel@lists.alioth.debian.org>:
Bug#522255; Package debconf. (Fri, 03 Apr 2009 18:51:10 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joey Hess <joeyh@debian.org>:
Extra info received and forwarded to list. Copy sent to Debconf Developers <debconf-devel@lists.alioth.debian.org>. (Fri, 03 Apr 2009 18:51:10 GMT) Full text and rfc822 format available.

Message #42 received at 522255@bugs.debian.org (full text, mbox):

From: Joey Hess <joeyh@debian.org>
To: 519165@bugs.debian.org
Cc: 522255@bugs.debian.org
Subject: also affects debconf
Date: Fri, 3 Apr 2009 14:47:49 -0400
[Message part 1 (text/plain, inline)]
Since debconf's confmodule uses $@, to support being called
from set -u maintainer scripts it would need to either
set +u (not very nice since that would also affect its caller),
or use ${@:+}. But this bug prevents the latter; so debconf's bug,
#522255, is effectively blocked by this bug in bash.

-- 
see shy jo
[signature.asc (application/pgp-signature, inline)]

Blocking bugs of 525965 added: 522255 Request was from martin f krafft <madduck@debian.org> to control@bugs.debian.org. (Wed, 29 Apr 2009 09:45:13 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debconf Developers <debconf-devel@lists.alioth.debian.org>:
Bug#522255; Package debconf. (Wed, 29 Apr 2009 09:51:22 GMT) Full text and rfc822 format available.

Acknowledgement sent to martin f krafft <madduck@debian.org>:
Extra info received and forwarded to list. Copy sent to Debconf Developers <debconf-devel@lists.alioth.debian.org>. (Wed, 29 Apr 2009 09:51:40 GMT) Full text and rfc822 format available.

Message #49 received at 522255@bugs.debian.org (full text, mbox):

From: martin f krafft <madduck@debian.org>
To: Joey Hess <joeyh@debian.org>, 519165@bugs.debian.org
Cc: 522255@bugs.debian.org
Subject: Re: Bug#519165: also affects debconf
Date: Wed, 29 Apr 2009 11:42:23 +0200
[Message part 1 (text/plain, inline)]
also sprach Joey Hess <joeyh@debian.org> [2009.04.03.2047 +0200]:
> Since debconf's confmodule uses $@, to support being called
> from set -u maintainer scripts it would need to either
> set +u (not very nice since that would also affect its caller),
> or use ${@:+}. But this bug prevents the latter; so debconf's bug,
> #522255, is effectively blocked by this bug in bash.

As a workaround, you want to use ${@:-}, not ${@:+}.

-- 
 .''`.   martin f. krafft <madduck@d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
[digital_signature_gpg.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debconf Developers <debconf-devel@lists.alioth.debian.org>:
Bug#522255; Package debconf. (Wed, 29 Apr 2009 11:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to martin f krafft <madduck@debian.org>:
Extra info received and forwarded to list. Copy sent to Debconf Developers <debconf-devel@lists.alioth.debian.org>. (Wed, 29 Apr 2009 11:06:02 GMT) Full text and rfc822 format available.

Message #54 received at 522255@bugs.debian.org (full text, mbox):

From: martin f krafft <madduck@debian.org>
To: Joey Hess <joeyh@debian.org>
Cc: 522255@bugs.debian.org
Subject: Re: Bug#519165: also affects debconf
Date: Wed, 29 Apr 2009 12:59:16 +0200
[Message part 1 (text/plain, inline)]
also sprach martin f krafft <madduck@debian.org> [2009.04.29.1142 +0200]:
> also sprach Joey Hess <joeyh@debian.org> [2009.04.03.2047 +0200]:
> > Since debconf's confmodule uses $@, to support being called
> > from set -u maintainer scripts it would need to either
> > set +u (not very nice since that would also affect its caller),
> > or use ${@:+}. But this bug prevents the latter; so debconf's bug,
> > #522255, is effectively blocked by this bug in bash.
> 
> As a workaround, you want to use ${@:-}, not ${@:+}.

I am wrong, see my message to 519165:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=519165#45

-- 
 .''`.   martin f. krafft <madduck@d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
[digital_signature_gpg.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debconf Developers <debconf-devel@lists.alioth.debian.org>:
Bug#522255; Package debconf. (Mon, 06 Jul 2009 13:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thorsten Glaser <t.glaser@tarent.de>:
Extra info received and forwarded to list. Copy sent to Debconf Developers <debconf-devel@lists.alioth.debian.org>. (Mon, 06 Jul 2009 13:45:02 GMT) Full text and rfc822 format available.

Message #59 received at 522255@bugs.debian.org (full text, mbox):

From: Thorsten Glaser <t.glaser@tarent.de>
To: 522255@bugs.debian.org
Cc: control@bugs.debian.org, 522255-subscribe@bugs.debian.org
Subject: set -u vs $@, posh, bash4, mksh, …
Date: Mon, 6 Jul 2009 15:36:54 +0200 (CEST)
severity 522255 serious
thanks

Hi,

as some already have noticed, using mksh as /bin/sh errors out
there too – mdadm 2.6.7.2-3 is uninstallable in Lenny because
of this error, and debconf 1.5.26 from Sid still contains it.
Thus I’m tentatively raising the severity (YMMV though).


--- /usr/share/debconf/confmodule.a	2009-07-06 15:17:07.000000000 +0200
+++ /usr/share/debconf/confmodule.b	2009-07-06 15:17:01.000000000 +0200
@@ -62,7 +62,7 @@ db_title ()	{ _db_cmd "TITLE $@"; }
 db_input ()	{ _db_cmd "INPUT $@"; }
 db_beginblock () { _db_cmd "BEGINBLOCK $@"; }
 db_endblock () 	{ _db_cmd "ENDBLOCK $@"; }
-db_go ()	{ _db_cmd "GO $@"; }
+db_go ()	{ _db_cmd "GO ${1+$@}"; }
 db_get ()	{ _db_cmd "GET $@"; }
 db_register ()	{ _db_cmd "REGISTER $@"; }
 db_unregister () { _db_cmd "UNREGISTER $@"; }


This works with mksh as /bin/sh at the very least¹. As it has
already been posted, erroring out has been traditional behaviour
for Bourne, Korn and some POSIX shells for ages.

$ mksh -uc 'echo $@'
mksh: @: parameter not set


① It should probably be mechanically applied to all the “$@”
  occurences²³ in there.
② The correct change is 「"$@"」 → 「${1+"$@"}」 as explained
  by the GNU autoconf texinfo documentaion, especially for zsh,
  where “$@” has a totally different, nōn-POSIX meaning
③ What are these doing anywat, "GO $@", don’t they really mean
  to use "GO $*" instead?


I wonder if the easier thing would be to change mdadm (and others)
to not use set -u _at least_ for Lenny until a consensus has been
reached. (I hope that we can at least agree to disagree, and not
depend on having to fix all shells except dash – and, maybe, zsh,
which was mentioned but is not really a /bin/sh suitable shell.)

I personally do not like to use set -u; I could live with people
using it for debugging their own shell code, or with CGIs they
maintain for themselves, but using it in maintainer scripts that
are widely deployed and for a wide range of shells (bash2/3/4,
dash, posh, mksh, AT&T ksh93, maybe others) it’s disagreeable.
Nevertheless, maybe the debconf scripts _could_ be adapted.


Sincerely,
//mirabilos – Debian Maintainer
-- 
tarent Gesellschaft für Softwareentwicklung und IT-Beratung mbH

Heilsbachstr. 24, 53123 Bonn  |  Weigandufer 45, 12059 Berlin
fon: +49(0)228 / 52675-0      |  fon: +49(0)30 / 5682943-30
fax: +49(0)228 / 52675-25     |  fax: +49(0)228 / 52675-25

Schützenstr. 18, 10117 Berlin
fon: +49(0)30 / 27594853
fax: +49(0)30 / 78709617

Geschäftsführer: Boris Esser, Elmar Geese
HRB AG Bonn 5168 - Ust-ID: DE122264941




Severity set to `serious' from `important' Request was from Thorsten Glaser <t.glaser@tarent.de> to control@bugs.debian.org. (Mon, 06 Jul 2009 13:45:05 GMT) Full text and rfc822 format available.

Bug 522255 cloned as bug 539538. Request was from Thorsten Glaser <tg@mirbsd.de> to control@bugs.debian.org. (Sat, 01 Aug 2009 19:06:03 GMT) Full text and rfc822 format available.

Reply sent to Joey Hess <joeyh@debian.org>:
You have taken responsibility. (Sun, 30 Aug 2009 23:30:04 GMT) Full text and rfc822 format available.

Notification sent to Laurent Bonnaud <Laurent.Bonnaud@inpg.fr>:
Bug acknowledged by developer. (Sun, 30 Aug 2009 23:30:04 GMT) Full text and rfc822 format available.

Message #68 received at 522255-done@bugs.debian.org (full text, mbox):

From: Joey Hess <joeyh@debian.org>
To: 522255-done@bugs.debian.org
Subject: fixed in bash
Date: Sun, 30 Aug 2009 19:21:10 -0400
[Message part 1 (text/plain, inline)]
bash (4.0-4) unstable; urgency=low

  * Apply upstream patches 024 - 028.
    - patch 028 closes: #519165. bash-4.0 reverted to the historical
      shell behavior of raising an error when $@ or $* was expanded
      after `set -u' had been executed and there were no positional
      parameters.  The Posix working group has since clarified the
      standard's position on the issue, and $@ and $* are now the only
      variables, parameters, or special parameters that do not raise an
      error when unset if set -u is enabled.

-- 
see shy jo
[signature.asc (application/pgp-signature, inline)]

Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Mon, 28 Sep 2009 07:35:37 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 17 19:08:09 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.