Debian Bug report logs - #638950
libtext-wrapi18n-perl: Fail to upload from stable to testing: Use of uninitialized value $text in concatenation

version graph

Package: libtext-wrapi18n-perl; Maintainer for libtext-wrapi18n-perl is Debian Perl Group <[email protected]>; Source for libtext-wrapi18n-perl is src:libtext-wrapi18n-perl (PTS, buildd, popcon).

Reported by: Simó Albert i Beltran <[email protected]>

Date: Tue, 23 Aug 2011 09:21:15 UTC

Severity: important

Tags: patch

Found in versions libtext-wrapi18n-perl/0.06-7, 0.06-7

Blocking fix for 641957: Infinite loop in /usr/share/debconf/frontend because of unitialized value in WrapI18N.pm

Reply or subscribe to this bug.

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


Report forwarded to [email protected], Anibal Monsalve Salazar <[email protected]>:
Bug#638950; Package libtext-wrapi18n-perl. (Tue, 23 Aug 2011 09:21:18 GMT) (full text, mbox, link).


Acknowledgement sent to Simó Albert i Beltran <[email protected]>:
New Bug report received and forwarded. Copy sent to Anibal Monsalve Salazar <[email protected]>. (Tue, 23 Aug 2011 09:21:24 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Simó Albert i Beltran <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: libtext-wrapi18n-perl: Fail to upload from stable to testing: Use of uninitialized value $text in concatenation
Date: Tue, 23 Aug 2011 11:27:36 +0200
Package: libtext-wrapi18n-perl
Version: 0.06-7
Severity: important

I'm trying to update from stable to testing with aptitude. During the packages preconfiguring stage,
the process goes into an infinite loop with the following message:

substr outside of string at /usr/share/perl5/Text/WrapI18N.pm line 130, <GEN187> line 8.
Use of uninitialized value $text in concatenation (.) or string at /usr/share/perl5/Text/WrapI18N.pm line 101, <GEN187> line 8.

I attach the full aptitude output. Obviously, I removed the last repeated lines :-)

Thanks for your work.

-- System Information:
Debian Release: 6.0.2
  APT prefers testing
  APT policy: (800, 'testing'), (500, 'stable'), (300, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-vserver-686 (SMP w/2 CPU cores)
Locale: LANG=ca_ES.UTF-8, LC_CTYPE=ca_ES.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libtext-wrapi18n-perl depends on:
ii  libtext-charwidth-perl        0.04-6     get display widths of characters o

libtext-wrapi18n-perl recommends no packages.

libtext-wrapi18n-perl suggests no packages.

-- no debconf information




Information forwarded to [email protected], Anibal Monsalve Salazar <[email protected]>:
Bug#638950; Package libtext-wrapi18n-perl. (Mon, 05 Sep 2011 11:34:27 GMT) (full text, mbox, link).


Acknowledgement sent to [email protected]:
Extra info received and forwarded to list. Copy sent to Anibal Monsalve Salazar <[email protected]>. (Mon, 05 Sep 2011 11:35:01 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Rex Tsai <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: Fail to upload from stable to testing: Use of uninitialized value $text in concatenation
Date: Mon, 05 Sep 2011 18:52:06 +0800
[Message part 1 (text/plain, inline)]
It seems the issue of libtext-charwidth-perl, 
the mblen from Text::CharWidth always returns bad value.

When upgrading from squeeze, it always return 4294967297. After upgraded
to wheezy (with some tricks[1][2]) the problem is gone.

[1]
http://www.facepunch.com/threads/1116926-Error-when-trying-to-dist-upgrade
[2] debconf also dead when upgrading from squeeze to wheezy/sid, stops
at _db_internal_line in confmodule at every db_* commands.

Regards
-Rex

[mblen.pl (application/x-perl, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to [email protected], Anibal Monsalve Salazar <[email protected]>:
Bug#638950; Package libtext-wrapi18n-perl. (Mon, 05 Sep 2011 17:45:13 GMT) (full text, mbox, link).


Acknowledgement sent to Julien Cristau <[email protected]>:
Extra info received and forwarded to list. Copy sent to Anibal Monsalve Salazar <[email protected]>. (Mon, 05 Sep 2011 17:45:13 GMT) (full text, mbox, link).


Message #15 received at [email protected] (full text, mbox, reply):

From: Julien Cristau <[email protected]>
To: Simó Albert i Beltran <[email protected]>, [email protected]
Subject: Re: Bug#638950: libtext-wrapi18n-perl: Fail to upload from stable to testing: Use of uninitialized value $text in concatenation
Date: Mon, 5 Sep 2011 19:43:46 +0200
On Tue, Aug 23, 2011 at 11:27:36 +0200, Simó Albert i Beltran wrote:

> Package: libtext-wrapi18n-perl
> Version: 0.06-7
> Severity: important
> 
> I'm trying to update from stable to testing with aptitude. During the packages preconfiguring stage,
> the process goes into an infinite loop with the following message:
> 
> substr outside of string at /usr/share/perl5/Text/WrapI18N.pm line 130, <GEN187> line 8.
> Use of uninitialized value $text in concatenation (.) or string at /usr/share/perl5/Text/WrapI18N.pm line 101, <GEN187> line 8.
> 
> I attach the full aptitude output. Obviously, I removed the last repeated lines :-)
> 
You didn't actually attach anything?

Cheers,
Julien




Added indication that bug 638950 blocks 641957 Request was from Joey Hess <[email protected]> to [email protected]. (Sun, 18 Sep 2011 16:21:33 GMT) (full text, mbox, link).


Information forwarded to [email protected], Anibal Monsalve Salazar <[email protected]>:
Bug#638950; Package libtext-wrapi18n-perl. (Tue, 20 Sep 2011 19:09:06 GMT) (full text, mbox, link).


Acknowledgement sent to Joey Hess <[email protected]>:
Extra info received and forwarded to list. Copy sent to Anibal Monsalve Salazar <[email protected]>. (Tue, 20 Sep 2011 19:09:07 GMT) (full text, mbox, link).


Message #22 received at [email protected] (full text, mbox, reply):

From: Joey Hess <[email protected]>
To: Bernhard Schmidt <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: Bug#641957: Infinite loop in /usr/share/debconf/frontend
Date: Tue, 20 Sep 2011 15:07:20 -0400
[Message part 1 (text/plain, inline)]
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:
> 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.

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.

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

Information forwarded to [email protected], Anibal Monsalve Salazar <[email protected]>:
Bug#638950; Package libtext-wrapi18n-perl. (Tue, 20 Sep 2011 19:21:06 GMT) (full text, mbox, link).


Acknowledgement sent to Joey Hess <[email protected]>:
Extra info received and forwarded to list. Copy sent to Anibal Monsalve Salazar <[email protected]>. (Tue, 20 Sep 2011 19:21:06 GMT) (full text, mbox, link).


Message #27 received at [email protected] (full text, mbox, reply):

From: Joey Hess <[email protected]>
To: Bernhard Schmidt <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: Bug#641957: Infinite loop in /usr/share/debconf/frontend
Date: Tue, 20 Sep 2011 15:20:25 -0400
[Message part 1 (text/plain, inline)]
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.

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

Information forwarded to [email protected], Anibal Monsalve Salazar <[email protected]>:
Bug#638950; Package libtext-wrapi18n-perl. (Wed, 21 Sep 2011 21:27:03 GMT) (full text, mbox, link).


Acknowledgement sent to Bernhard Schmidt <[email protected]>:
Extra info received and forwarded to list. Copy sent to Anibal Monsalve Salazar <[email protected]>. (Wed, 21 Sep 2011 21:27:03 GMT) (full text, mbox, link).


Message #32 received at [email protected] (full text, mbox, reply):

From: Bernhard Schmidt <[email protected]>
To: Joey Hess <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: Bug#641957: Infinite loop in /usr/share/debconf/frontend
Date: Wed, 21 Sep 2011 23:10:32 +0200
On 20.09.2011 21:07, Joey Hess wrote:
> 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

Doesn't work here.

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




Information forwarded to [email protected], Anibal Monsalve Salazar <[email protected]>:
Bug#638950; Package libtext-wrapi18n-perl. (Thu, 22 Sep 2011 11:12:21 GMT) (full text, mbox, link).


Acknowledgement sent to "w.goesgens" <[email protected]>:
Extra info received and forwarded to list. Copy sent to Anibal Monsalve Salazar <[email protected]>. (Thu, 22 Sep 2011 11:12:28 GMT) (full text, mbox, link).


Message #37 received at [email protected] (full text, mbox, reply):

From: "w.goesgens" <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: Re: Fail to upload from stable to testing: Use of uninitialized value $text in concatenation
Date: Thu, 22 Sep 2011 13:07:59 +0200
Package: libtext-wrapi18n-perl
Version: 0.06-7
Severity: normal

I get 
Use of uninitialized value $text in concatenation (.) or string at /usr/share/perl5/Text/WrapI18N.pm line 101, <GEN1> line 4.
substr outside of string at /usr/share/perl5/Text/WrapI18N.pm line 130, <GEN1> line 4.

over and over on apt-get dist upgrade.

-- System Information:
Debian Release: 6.0.2
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.38 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libtext-wrapi18n-perl depends on:
ii  libtext-charwidth-perl        0.04-6     get display widths of characters o

libtext-wrapi18n-perl recommends no packages.

libtext-wrapi18n-perl suggests no packages.

-- no debconf information




Information forwarded to [email protected], [email protected], Anibal Monsalve Salazar <[email protected]>:
Bug#638950; Package libtext-wrapi18n-perl. (Fri, 23 Sep 2011 15:30:04 GMT) (full text, mbox, link).


Acknowledgement sent to David Arroyo Menéndez <[email protected]>:
Extra info received and forwarded to list. Copy sent to [email protected], Anibal Monsalve Salazar <[email protected]>. (Fri, 23 Sep 2011 15:30:04 GMT) (full text, mbox, link).


Message #42 received at [email protected] (full text, mbox, reply):

From: David Arroyo Menéndez <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: libtext-wrapi18n-perl: Attaching a possible patch. It's my first patch, I hope do it right.
Date: Fri, 23 Sep 2011 17:27:33 +0200
Package: libtext-wrapi18n-perl
Version: 0.06-7
Followup-For: Bug #638950

Dear Maintainer,
*** Please consider answering these questions, where appropiate ***

   * What led up to the situation? 

Upgrading from a clean squeeze to testing with apt-get -u dist-upgrade

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

IYou can see my solution with my diff -u between files:

--- WrapI18N.pm	2003-06-25 11:14:25.000000000 +0200
+++ /usr/share/perl5/Text/WrapI18N.pm	2011-09-23 14:21:25.000000000 +0200
@@ -88,7 +88,7 @@
 			$len = 0;
 			$text = $top2 . $text;
 			$word = ''; $wlen = 0;
-		} elsif ($wlen + $w <= $columns) {
+		} elsif ($wlen + $w <= $columns - length ($top2)) {
 			# the current word is sent to next line
 			$out .= $separator;
 			$len = 0;
@@ -98,7 +98,11 @@
 			# the current word is too long to fit a line
 			$out .= $word . $separator;
 			$len = 0;
-			$text = $top2 . $c . $text;
+			if ($text) {
+			    $text = $top2 . $c . $text;
+			} else {
+			    $text = $top2 . $c;
+			}
 			$word = ''; $wlen = 0;
 		}
 	}
@@ -127,7 +131,11 @@
 		return ('?', substr($string,1), 1, 0);
 	}
 	$c = substr($string, 0, $l);
-	$r = substr($string, $l);
+	if substr($string, $l) {
+	    $r = substr($string, $l);
+	} else {
+	    $r = '';
+	}
 	$w = mbswidth($c);
 
 	if (!defined($charmap)) {


   * What was the outcome of this action?

The package was installed successfully

   * What outcome did you expect instead?

*** End of the template - remove these lines ***


-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.0.0-1-686-pae (SMP w/2 CPU cores)
Locale: LANG=es_ES.utf8, LC_CTYPE=es_ES.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libtext-wrapi18n-perl depends on:
ii  libtext-charwidth-perl  0.04-7

libtext-wrapi18n-perl recommends no packages.

libtext-wrapi18n-perl suggests no packages.

-- no debconf information




Information forwarded to [email protected], Anibal Monsalve Salazar <[email protected]>:
Bug#638950; Package libtext-wrapi18n-perl. (Fri, 04 Nov 2011 15:27:11 GMT) (full text, mbox, link).


Acknowledgement sent to Mathias Chapuis <[email protected]>:
Extra info received and forwarded to list. Copy sent to Anibal Monsalve Salazar <[email protected]>. (Fri, 04 Nov 2011 15:27:11 GMT) (full text, mbox, link).


Message #47 received at [email protected] (full text, mbox, reply):

From: Mathias Chapuis <[email protected]>
To: [email protected]
Subject: perl loop error
Date: Fri, 4 Nov 2011 16:24:27 +0100
[Message part 1 (text/plain, inline)]
I also had this perl loop error while trying to upgrade from squeeze to
wheezy, and found what i think could be a workaround.

after forcing a remove with :

"dpkg -r --force-all libtext-charwidth-perl"

The upgrade ran without errors.
[Message part 2 (text/html, inline)]

Added tag(s) patch. Request was from Axel Beckert <[email protected]> to [email protected]. (Sat, 18 Feb 2012 22:48:07 GMT) (full text, mbox, link).


Information forwarded to [email protected], Anibal Monsalve Salazar <[email protected]>:
Bug#638950; Package libtext-wrapi18n-perl. (Fri, 15 Jun 2012 04:30:05 GMT) (full text, mbox, link).


Acknowledgement sent to Aníbal Monsalve Salazar <[email protected]>:
Extra info received and forwarded to list. Copy sent to Anibal Monsalve Salazar <[email protected]>. (Fri, 15 Jun 2012 04:30:05 GMT) (full text, mbox, link).


Message #54 received at [email protected] (full text, mbox, reply):

From: Aníbal Monsalve Salazar <[email protected]>
To: Tomohiro KUBOTA <[email protected]>
Cc: David Arroyo Menéndez <[email protected]>, [email protected]
Subject: Re: Bug#638950: libtext-wrapi18n-perl: Attaching a possible patch. It's my first patch, I hope do it right.
Date: Fri, 15 Jun 2012 14:26:12 +1000
Hello Tomohiro,

Could you please review the patch in the message below?

The bug report is at http://bugs.debian.org/638950

Thank you,

Anibal

On Fri, Sep 23, 2011 at 05:27:33PM +0200, David Arroyo Menéndez wrote:
>Package: libtext-wrapi18n-perl
>Version: 0.06-7
>Followup-For: Bug #638950
>
>Dear Maintainer,
>*** Please consider answering these questions, where appropiate ***
>
>   * What led up to the situation? 
>
>Upgrading from a clean squeeze to testing with apt-get -u dist-upgrade
>
>   * What exactly did you do (or not do) that was effective (or
>     ineffective)?
>
>IYou can see my solution with my diff -u between files:
>
>--- WrapI18N.pm	2003-06-25 11:14:25.000000000 +0200
>+++ /usr/share/perl5/Text/WrapI18N.pm	2011-09-23 14:21:25.000000000 +0200
>@@ -88,7 +88,7 @@
> 			$len = 0;
> 			$text = $top2 . $text;
> 			$word = ''; $wlen = 0;
>-		} elsif ($wlen + $w <= $columns) {
>+		} elsif ($wlen + $w <= $columns - length ($top2)) {
> 			# the current word is sent to next line
> 			$out .= $separator;
> 			$len = 0;
>@@ -98,7 +98,11 @@
> 			# the current word is too long to fit a line
> 			$out .= $word . $separator;
> 			$len = 0;
>-			$text = $top2 . $c . $text;
>+			if ($text) {
>+			    $text = $top2 . $c . $text;
>+			} else {
>+			    $text = $top2 . $c;
>+			}
> 			$word = ''; $wlen = 0;
> 		}
> 	}
>@@ -127,7 +131,11 @@
> 		return ('?', substr($string,1), 1, 0);
> 	}
> 	$c = substr($string, 0, $l);
>-	$r = substr($string, $l);
>+	if substr($string, $l) {
>+	    $r = substr($string, $l);
>+	} else {
>+	    $r = '';
>+	}
> 	$w = mbswidth($c);
> 
> 	if (!defined($charmap)) {
>
>
>   * What was the outcome of this action?
>
>The package was installed successfully
>
>   * What outcome did you expect instead?
>
>*** End of the template - remove these lines ***
>
>
>-- System Information:
>Debian Release: wheezy/sid
>  APT prefers testing
>  APT policy: (500, 'testing')
>Architecture: i386 (i686)
>
>Kernel: Linux 3.0.0-1-686-pae (SMP w/2 CPU cores)
>Locale: LANG=es_ES.utf8, LC_CTYPE=es_ES.utf8 (charmap=UTF-8)
>Shell: /bin/sh linked to /bin/dash
>
>Versions of packages libtext-wrapi18n-perl depends on:
>ii  libtext-charwidth-perl  0.04-7
>
>libtext-wrapi18n-perl recommends no packages.
>
>libtext-wrapi18n-perl suggests no packages.
>
>-- no debconf information




Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Fri May 16 09:36:35 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.