Comment 0 for bug 615045

After running "sudo catman" to update the man page cache, the display of some man pages will be corrupted. Deleting the corresponding entries in /var/cache/man/cat[1-8]/ will bring back the original man pages.

I can reproduce this problem with man-db 2.5.7-3, but not with previous 2.5.6-2. I feel that it can be related to the following change in 2.5.7-1:

> - Always save cat pages in UTF-8 (closes: #446741).

I see the following pipe being run:

/usr/bin/zsoelim | /usr/lib/man-db/manconv -f UTF-8:ISO-8859-1 -t ANSI_X3.4-1968//IGNORE | tbl | nroff -mandoc -Tascii | gzip -c7 | iconv -c -f ANSI_X3.4-1968 -t UTF-8//TRANSLIT

This is very wrong because it tries to convert gzip-compressed data from ASCII to UTF-8! Oh noes!

Original question by Thinboy00:

Some man pages are appearing corrupt (i.e. if I type man foo at the terminal, I get a bunch of caret escaped characters and a few ascii characters). It looks as if man is reading the compressed data in /usr/share/man instead of uncompressing it first. I will soon attach a screenshot of the problem. The really confusing part, though, is that some man pages consistently appear corrupt and the others consistently appear correctly. I've tried the following, to no avail:
mandb -t
mandb -c
And yes, I did remember to use sudo on those. mandb -t said "whatis parse for /usr/share/man/[etc]:whatis parse for foo(x) failed" about some pages, but not every broken page (most of them appeared to be related to perl, but not all of them). Since whatis is working correctly, I find it hard to believe that's the problem. I also tried this:
zcat /usr/man/man6/nethack.6.gz | less
and it gave unformatted but readable output, even though man nethack doesn't work. I tried the same trick with slashem, which does work correctly for man, and the zcat trick worked too. I'm surprised their man pages behave differently since the pages themselves are practically identical.
Is my copy of man broken?