Bug#562518: Bug#562503: Bug#562518: zlib1g 1:1.2.3.4.dfsg-1 hangs(?)

2010-01-01 Thread Colin Watson
On Fri, Dec 25, 2009 at 03:05:13PM +, Mark Brown wrote:
 On Fri, Dec 25, 2009 at 11:33:05AM +0100, Lucas Nussbaum wrote:
  If, in a clean minimal chroot, I install zlib1g from testing first, then
  install man-db, it works fine.
 
  My guess is that it is related to the fixing of #301283.
 
 As far as I can tell zlib is performing correctly here, the man-db
 process doing the decompression exits correctly having detected EOF and
 closed the file, then exits.  The read() that's spinning with zero bytes
 is certainly not a zlib one, it reads data in 16384 byte chunks but
 that's a read of 65535 bytes (and the man-db debug output says the
 process that's spinning is a manconv one.
 
 That said, I can't immediately spot a problem in the man-db code and
 reverting the explict reporting of EOF in zlib makes man-db stop falling
 over so I'll upload a package just now.

Thanks to those who worked on tracking this down and mitigating it. I
was away over Christmas and so didn't see this report until today.

The core problem was zlib sometimes truncating output by reporting EOF
too early, which Mark fixed in 1:1.2.3.4.dfsg-3. This in turn exposed an
infinite loop bug in manconv when it sees an incomplete multibyte
character at the end of an input file. This only happened with multibyte
legacy encodings, hence why a number of people reported this happening
with Japanese pages.

I've uploaded a fix for this in man-db 2.5.6-5. Here are the upstream
changelog entries, for the record (I made a slight mistake in the first
attempt, caught during testing):

Fri Jan  1 13:26:21 GMT 2010  Colin Watson  cjwat...@debian.org

* src/manconv.c (try_iconv): Only handle iconv errors when iconv
  returned -1.

Fri Jan  1 11:37:13 GMT 2010  Colin Watson  cjwat...@debian.org

* src/manconv.c (try_iconv): Handle iconv errors when attempting to
  convert the last input encoding to UTF-8 (Debian bug #562503).
* src/tests/manconv-3: Add test for this.
* src/tests/Makefile.am (TESTS): Add manconv-3.

Mark, as far as I can see, you can drop the workaround in zlib
1:1.2.3.4.dfsg-2. The fix in 1:1.2.3.4.dfsg-3 is sufficient even without
the fix in man-db 2.5.6-5.

-- 
Colin Watson   [cjwat...@debian.org]



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#562518: Bug#562503: Bug#562518: zlib1g 1:1.2.3.4.dfsg-1 hangs(?)

2009-12-29 Thread Stefano Zacchiroli
severity 562518 normal
thanks

On Fri, Dec 25, 2009 at 07:12:25PM +, Mark Brown wrote:
  That said, I can't immediately spot a problem in the man-db code and
  reverting the explict reporting of EOF in zlib makes man-db stop falling
  over so I'll upload a package just now.
 
 Having looked further there was a problem with zlib truncating output
 which should now be fixed with the change I made, however this shouldn't
 explain the spin in man-db so there may still be a latent bug there
 that's worth looking into.

Agreed, but this is anyhow no longer RC. I'm hence downgrading severity
to normal, leaving up to the maintainer investigation or closure.

Thanks for your feedback,
Cheers.

-- 
Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7
z...@{upsilon.cc,pps.jussieu.fr,debian.org} -- http://upsilon.cc/zack/
Dietro un grande uomo c'è ..|  .  |. Et ne m'en veux pas si je te tutoie
sempre uno zaino ...| ..: | Je dis tu à tous ceux que j'aime



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org