mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-24 06:48:18 -07:00
Text::WrapI18N has a bug that causes an infinite loop. The following
program demonstrates the issue:
> use Text::WrapI18N qw($columns);
> use Text::WrapI18N qw(wrap);
> $columns = 78;
>
> my $a="po/pod.cfg:1: ";
> my $b=" ";
> my $c="No PO files found in '/var/tmp/portage/app-text/po4a-0.74-r1/work/po4a-0.74'/'po/pod'.";
>
> print wrap($a, $b, $c);
This program will hang indefinitely until OOM. However, if change $columns to
any value greater than 78, it finishes quickly.
In po4a, $columns is set from $ENV{COLUMNS} ( see
https://github.com/mquinson/po4a/blob/master/lib/Locale/Po4a/Common.pm#L68),
so if your terminal width is <= 78, emerge will hang.
This is a very old bug that Debian found and fixed in 2008. See
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=470250
and upstream issue:
https://rt.cpan.org/Public/Bug/Display.html?id=42102
Closes: https://bugs.gentoo.org/959830
Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/44680
Closes: https://github.com/gentoo/gentoo/pull/44680
Signed-off-by: Sam James <sam@gentoo.org>