#641957 Infinite loop in /usr/share/debconf/frontend because of unitialized value in WrapI18N.pm

Package:
debconf
Source:
debconf
Submitter:
Eric Buchlin
Date:
2011-09-21 21:21:17 UTC
Severity:
normal
Blocked By:
Bug Title
638950

  0

libtext-wrapi18n-perl: Fail to upload from stable to testing: Use of uninitialized value $text in concatenation

important stable testing unstable about 14 years ago

#641957#5
Date:
2011-09-18 08:14:52 UTC
From:
To:
I tried to upgrade to testing just after a fresh install of squeeze (netinst, KDE):
I changed squeeze to testing in /etc/apt/sources.list, and made an update and upgrade
within aptitude (interactive). During the installation of libc6,
/usr/share/debconf/frontend has an infinite loop (and takes 100% CPU), with messages
---
Use of uninitialized value $text in concatenation (.) or string at /usr/share/perl5/Text/WrapI18N.pm line 101, <GEN1> line 5.
substr outside of string at /usr/share/perl5/Text/WrapI18N.pm line 130, <GEN1> line 5.
---

The only way out is to kill frontend.

Then the same happens if I try with apt-get -f dist-upgrade (-f is needed
by apt-get, and the same happens with LANG=C).

As a result, the upgrade (here: of package libc6) cannot be done.
Messages after the kill are:
--- dpkg: error processing /var/cache/apt/archives/libc6_2.13-18_i386.deb (--unpack): subprocess new pre-installation script kill by signal (Terminated) configured to not write apport reports Errors were encountered while processing: /var/cache/apt/archives/libc6_2.13-18_i386.deb E: Sub-process /usr/bin/dpkg returned an error code (1) ---
#641957#10
Date:
2011-09-18 16:17:42 UTC
From:
To:
Eric Buchlin wrote:

Seems that you can reproduce the bug on demand. So can you please try
the following:

1. Install the attached Encoding.pm file as /usr/share/perl5/DebConf/Encoding.pm
   (This instruments the calls to WrapI18N so we can see what text is
   making it fail.)
2. Run the `script` command to take a typescript.
3. Run apt-get again to reproduce the problem.
4. Reply with the typescript.

#641957#17
Date:
2011-09-18 16:47:59 UTC
From:
To:
Also, since I can't reproduce this with an upgrade of a squeeze system
here, and it's apparently caused by a very specific combination of
versions of packages in the middle of an upgrade, it would be very
useful if you could send me a complete list of the versions of
packages installed on your system.
	dpkg -l > list

(Private email is ok if you don't want that information published.)

#641957#22
Date:
2011-09-19 08:39:58 UTC
From:
To:
Joey Hess <joeyh@debian.org> a écrit :

Hello,

Thanks for the reply, but now I have restarted the install of squeeze
from scratch, using the minimal installation, and I tried to do things
more properly, or at least I hope so (apt-get upgrade before
dist-upgrade). Then the problem did not appear, but this could be due
to either change (using the minimal install of squeeze, or doing an
apt-get upgrade first). Now I have a working installation of testing,
and this is my main work computer, so I can't go back and try to
reproduce the problem, sorry (I can only retry later on another
computer). However, even if I didn't do things properly first, it
still looks like a bug, and other people already had the problem, like:
http://www.facepunch.com/threads/1116926
(not much detail there, but same messages in same circumstances)

Best regards,
---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
#641957#27
Date:
2011-09-20 01:12:02 UTC
From:
To:
Hi,

I just experienced the same problem. Attached my typescript (with the
updated module from this bug) and the package list. I'm testing
upgrading Torrus to wheezy in a VM, thus the two unauthenticated
packages on my own server.

It's a plain minimum Squeeze i386 installation in KVM, then installed
torrus-apache2 (which installs quite a lot of packages, including
apache2 and mod_perl2), then dist-upgrade to wheezy.

Not sure whether the VM will boot tomorrow, I hope the attached
information helps.

Bernhard

#641957#32
Date:
2011-09-20 19:07:20 UTC
From:
To:
Note that those who experience this situation can get out by
pressing ctrl-c, and then run something like:

apt-get -o Immediate-Configure=false -f install

Bernhard Schmidt wrote:

Thanks, I was able to reproduce it too. I pressed ctrl-z just after
libc6 was upgraded (around where it would ask about upgrading with
debconf when not in a chroot), and running debconf reproduces the loop.

Confirmed that mblen is busted.

At this point, perl is half-configured; libtext-charwidth-perl is
still at the version from stable. After these two get upgraded,
the problem goes away. (libtext-wrapi18n-perl currently has the same version
in both suites so I don't know if apt would have partially upgraded it
to a newer version at this point. And debconf is still at the version
from stable.)

So apt breaks the old version of libtext-charwidth-perl's dependency on
the old version of perl, to resolve the upgrade. Then debconf-i18n tries
to use the module indirectly and it blows up. Note that debconf-i18n is
a Required package, and depends on libtext-charwidth-perl, so apt is
going to extreme lengths to break the cycle.

It would be possible to have debconf test for mblen being broken and
avoid doing multibyte aware word wrapping.. except debconf does not
get upgraded in time! Indeed, it's hard to see where to put a fix for
this at all, since only perl is (partially) upgraded yet.

#641957#37
Date:
2011-09-20 19:20:25 UTC
From:
To:
This seems to be caused by #640300, so once a libc6 2.13-19 that no longer
declares a Breaks on perl reaches testing, I *think* this will no longer
be a problem.

#641957#42
Date:
2011-09-21 21:10:32 UTC
From:
To:
root@torrustest:~# apt-get -o Immediate-Configure=false -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
   libdb4.7
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
   libberkeleydb-perl libc6-i686 libcrypt-des-perl libdb5.1
libdigest-sha1-perl libfont-freetype-perl liblocale-gettext-perl
libtext-charwidth-perl
   libtext-iconv-perl libxml-libxml-perl libxml-parser-perl
multiarch-support
The following NEW packages will be installed:
   libdb5.1 multiarch-support
The following packages will be upgraded:
   libberkeleydb-perl libc6-i686 libcrypt-des-perl libdigest-sha1-perl
libfont-freetype-perl liblocale-gettext-perl libtext-charwidth-perl
libtext-iconv-perl
   libxml-libxml-perl libxml-parser-perl
10 upgraded, 2 newly installed, 0 to remove and 210 not upgraded.
14 not fully installed or removed.
Need to get 0 B/3,226 kB of archives.
After this operation, 2,269 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
E: Could not perform immediate configuration on already unpacked 'perl'.
Please see man 5 apt.conf under APT::Immediate-Configure for details.

Bernhard