Bug#470250: po4a spins on the cpu consuming ever more memory

2008-03-13 Thread Nicolas François
reassign 470250 libtext-wrapi18n-perl
tags 470250 patch
thanks

On Mon, Mar 10, 2008 at 09:23:24AM +, [EMAIL PROTECTED] wrote:
 Package: po4a
 Version: 0.33-1
 
 dpkg 1.15.1 (on the branch whose status is currently disputed) does
 not build on sid because po4a spins on the cpu consuming more and more
 memory.
 
 I reproduced the bug like this:
 
  really pbuilder --build --distribution sid --buildresult 
 /u/ian/an-things/Dpkg2/build/result dpkg_1.15.1.dsc 21 |tee log
 
 of which the important part is this:
 
  pbuilder --build --distribution sid dpkg_1.15.1.dsc
 
 At http://www.chiark.greenend.org.uk/~ian/2008-03-10-po4a-bug/ you can
 find dpkg 1.15.1 in Debian source package format, and the full log
 from the build (the file `log' from tee, above).

The infinite loop occurs in Text::WrapI18N when po4a tries to report an
error in the PO files.

This can be fixed currently in po4a by:
 * fixing the POs
 * setting COLUMNS to another (high) number
 * enlarging the terminal
 * removing libtext-wrapi18n-perl (it's only recommended).

I could reproduce the problem in WrapI18N::wrap() with the short test.pl
attached, and I also proposes the attached patch to WrapI18N::wrap().
(A word should be placed on the next line if it fits on this line, but the
leading header must be taken into account, thus $columns - $columns -
length $header)

Best Regards,
-- 
Nekral



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#470250: po4a spins on the cpu consuming ever more memory

2008-03-13 Thread Nicolas François
Here are the test script and the patch.

-- 
Nekral
#!/usr/bin/perl

use Text::WrapI18N;

print step 1\n;
print Text::WrapI18N::wrap('', '  ', '123 567 901 x');
print \n;
print step 2\n;
print Text::WrapI18N::wrap('', '  ', '123 567 901 xx');
print \n;
print step 3\n;
print Text::WrapI18N::wrap('', '  ', '123 567 901 xxx');
print \n;
print step 3\n;
print Text::WrapI18N::wrap('', '  ', '123 567 901 ');
print \n;
print step 3\n;
--- /usr/share/perl5/Text/WrapI18N.pm.org	2003-06-25 11:14:25.0 +0200
+++ /usr/share/perl5/Text/WrapI18N.pm	2008-03-13 02:04:02.628000837 +0100
@@ -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;


Bug#470250: po4a spins on the cpu consuming ever more memory

2008-03-10 Thread Ian Jackson
Package: po4a
Version: 0.33-1

dpkg 1.15.1 (on the branch whose status is currently disputed) does
not build on sid because po4a spins on the cpu consuming more and more
memory.

I reproduced the bug like this:

 really pbuilder --build --distribution sid --buildresult 
/u/ian/an-things/Dpkg2/build/result dpkg_1.15.1.dsc 21 |tee log

of which the important part is this:

 pbuilder --build --distribution sid dpkg_1.15.1.dsc

At http://www.chiark.greenend.org.uk/~ian/2008-03-10-po4a-bug/ you can
find dpkg 1.15.1 in Debian source package format, and the full log
from the build (the file `log' from tee, above).

I left it running since about 8pm last night and when I came in just
now it had used 450Mby and had produced no further output.  I sent it
a SIGTERM to get my computer back.  Here is the invocation command
line in context:

 make[3]: Entering directory `/tmp/buildd/dpkg-1.15.1/build-tree/origins'
 make[3]: Nothing to be done for `all'.
 make[3]: Leaving directory `/tmp/buildd/dpkg-1.15.1/build-tree/origins'
 Making all in man
 make[3]: Entering directory `/tmp/buildd/dpkg-1.15.1/build-tree/man'
 po4a --no-backups --variable srcdir=../../man \
 ../../man/po/po4a.cfg
 make[3]: *** [man.stamp] Terminated

It may be that there are some problems with the translations.  There
were many translation changes in the git tree which my package
inherited, which had not previously been released and had perhaps
therefore never been built in a clean sid chroot with recent po4a.
Even so, if it is due to a bad translation it would be good to have an
error message rather than this misbehaviour.

1.15.0 which you can find in the same directory built in a clean lenny
chroot.  I don't think I've run a formal test of 1.15.1 on lenny.

Thanks,
Ian.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]