Bug#413249: severity of 413249 is important, tagging 413249
clone 413249 -1
retitle 413249 "wrong returnvalue logic in config script"
tags 413249 -unreproducible
retitle -1 debconf: database communication does not work
reassign -1 debconf
thanks
Frank Küster <frank@kuesterei.ch> wrote:
> It is very well reproducible here, it occurred again today.
[...]
> The bug I found so far is
(this is going to stay 413249, package x11-common)
> while :; do
> run db_input low x11-common/xwrapper/nice_value
> # is the question going to be asked?
> if [ $? -eq 30 ]; then
> break # no; bail out of validation loop
> fi
>
> Because db_input is wrapped in the "run" function, the return value of
> db_input is no longer in $?, and the script will not break the loop. It
> is in $_retval, though:
>
> run () {
> [...]
> "$@" || _retval=$?
>
> if [ ${_retval:-0} -ne 0 ]; then
> observe "command \"$*\" exited with status $_retval"
> fi
>
> The patch for this would be
>
> while :; do
> run db_input low x11-common/xwrapper/nice_value
> # is the question going to be asked?
> + WILL_BE_ASKED=$_retval
> - if [ $? -eq 30 ]; then
> + if [ $WILL_BE_ASKED -eq 30 ]; then
> break # no; bail out of validation loop
> fi
>
> However, changing this doesn't fix my problem, and I got sceptical
> whether it originates in x11-common, since I get so many internal
> debconf errors.
This is why I reassign the other part of this to debconf. I'm quite
sure that what is going on on my system is not a general breakage of
debconf, but for sure it is something that needs investigation
[work on debconf snipped, see bug log]
> debconf (developer): <-- GET x11-common/xwrapper/nice_value
> debconf (developer): --> 0 0
> + IFS='
> '
> + read -r _db_internal_line
[...]
> Why on earth is "$RET" now "value set", where it should be "0"? Note
> that "value set" was the last answer that debconf communicated about
> that template, but not the last answer it communcated in that script
> (which was about allowed_users.
Now the debug output below adds to the confusion, but it might be easier
to debug. I have done
# dpkg --purge --force-depends x11-common
and then installed again, with "set -xv" in the maintainer scripts.
Things to observe:
- db_set returns with exit code "1". Is this okay? I think it
shouldn't, and it's a peculiarity of x11-common to not stop when this
happens. However, what does it indicate on the debconf side?
- after the skipped parts, the db_input part is not interesting, but
shows that that goes without errors
- db_go gives an internal debconf error (I have just "apt-get
--reinstall install"'ed the etch version, so the files should be okay)
- db_get returns *nothing*, although it was set to "0" earlier.
+ run db_set x11-common/xwrapper/nice_value 0
+ '[' 3 -lt 1 ']'
+ db_set x11-common/xwrapper/nice_value 0
+ _db_cmd 'SET x11-common/xwrapper/nice_value' 0
+ IFS=' '
+ printf '%s\n' 'SET x11-common/xwrapper/nice_value 0'
debconf (developer): <-- SET x11-common/xwrapper/nice_value 0
debconf (developer): --> 0 value set
+ IFS='
'
+ read -r _db_internal_line
+ RET='value set'
+ case ${_db_internal_line%%[ ]*} in
+ return 0
+ '[' 1 -ne 0 ']'
+ observe 'command "db_set x11-common/xwrapper/nice_value 0" exited with status 1'
+ '[' -n '' ']'
[... some parts skipped ...]
+ run db_input low x11-common/xwrapper/nice_value
+ '[' 3 -lt 1 ']'
+ db_input low x11-common/xwrapper/nice_value
+ _db_cmd 'INPUT low' x11-common/xwrapper/nice_value
+ IFS=' '
+ printf '%s\n' 'INPUT low x11-common/xwrapper/nice_value'
+ IFS='
'
+ read -r _db_internal_line
debconf (developer): <-- INPUT low x11-common/xwrapper/nice_value
debconf (developer): --> 30 question skipped
+ RET='30 question skipped'
+ case ${_db_internal_line%%[ ]*} in
+ return 30
+ _retval=30
+ '[' 30 -ne 0 ']'
+ observe 'command "db_input low x11-common/xwrapper/nice_value" exited with status 30'
+ '[' -n '' ']'
+ '[' 0 -eq 30 ']'
+ run db_go
+ '[' 1 -lt 1 ']'
+ db_go
+ _db_cmd 'GO '
+ IFS=' '
+ printf '%s\n' 'GO '
+ IFS='
'
+ read -r _db_internal_line
debconf (developer): <-- GO
Use of uninitialized value in join or string at /usr/share/perl5/Debconf/DbDriver/Stack.pm line 104, <GEN1> line 7.
debconf (developer): --> 0 ok
+ RET=ok
+ case ${_db_internal_line%%[ ]*} in
+ return 0
+ '[' 30 -ne 0 ']'
+ observe 'command "db_go" exited with status 30'
+ '[' -n '' ']'
+ RET=
+ db_get x11-common/xwrapper/nice_value
+ _db_cmd 'GET x11-common/xwrapper/nice_value'
+ IFS=' '
+ printf '%s\n' 'GET x11-common/xwrapper/nice_value'
+ IFS='
'
+ read -r _db_internal_line
debconf (developer): <-- GET x11-common/xwrapper/nice_value
debconf (developer): --> 0
+ RET=
Any idea what's going on?
Regards, Frank
--
Dr. Frank Küster
Single Molecule Spectroscopy, Protein Folding @ Inst. f. Biochemie, Univ. Zürich
Debian Developer (teTeX/TeXLive)
Reply to: