r10379 - /man-cgi/man.cgi
Author: jfs
Date: Tue Mar 4 20:14:25 2014
New Revision: 10379
URL: http://svn.debian.org/wsvn/?sc=1&rev=10379
Log:
- Fix error handling of invalid locale (it was generating error 500 instead of producing
a proper error page)
- (Temporary) block manpage generation of Japanese-localised manpages until the issue
with ja-encoded manpages is fixed (troff / grotty does not return and holds 100% of CPU)
It has been observed that glink had a pile of processes like this:
4334 www-data 20 0 14916 260 88 R 8.0 0.0 8h15:46 troff -mtty-char-mandoc -Tutf8
15410 www-data 20 0 14916 2004 0 R 8.0 0.0 7h36:13 troff -mtty-char-mandoc -Tutf8
31855 www-data 20 0 14916 264 96 R 8.0 0.0 9h03:21 troff -mtty-char-mandoc -Tutf8
9925 www-data 20 0 14916 268 92 R 8.0 0.0 7h51:41 troff -mtty-char-mandoc -Tutf8
16715 www-data 20 0 14920 268 28 R 8.0 0.0 7h33:21 troff -mtty-char-mandoc -Tutf8
16808 www-data 20 0 14920 316 0 R 8.0 0.0 7h33:17 troff -mtty-char-mandoc -Tutf8
17421 www-data 20 0 14920 2136 56 R 8.0 0.0 7h32:29 troff -mtty-char-mandoc -Tutf8
17604 www-data 20 0 14920 540 124 R 8.0 0.0 7h32:27 troff -mtty-char-mandoc -Tutf8
Each of them being part of a process tree that looks like this:
7525 ? S 0:00 /usr/bin/perl -T /srv/manpages.debian.org/cgi-bin/man.cgi
17526 ? S 0:24 \_ /usr/bin/man -M /srv/manpages.debian.org/extractor/manpages-dist
17538 ? S 0:00 \_ /bin/sh /usr/bin/nroff -mandoc -Tutf8
17556 ? S 0:00 | \_ groff -mtty-char -Tutf8 -mandoc
17604 ? R 452:48 | \_ troff -mtty-char -mandoc -Tutf8
17605 ? S 78:06 | \_ grotty
17539 ? S 1:09 \_ iconv -c -f UTF-8 -t EUC-JP//TRANSLIT
17540 ? S 0:00 \_ col -b -p -x
The issue is not easily reproducible (does not happen in the command line call to 'man')
and the timeout code introduced in previous versions does not prevent this from happening.
Modified:
man-cgi/man.cgi
Modified: man-cgi/man.cgi
URL: http://svn.debian.org/wsvn/man-cgi/man.cgi?rev=10379&op=diff
==============================================================================
--- man-cgi/man.cgi (original)
+++ man-cgi/man.cgi Tue Mar 4 20:14:25 2014
@@ -535,11 +535,18 @@
# Set encoding locale if we find it in the language -> encoding list
$encoding = $langenc{lc($language)};
} else {
- print "Sorry, locale $locale is not valid\n";
- return;
- }
- }
- #print "LANG $language and ENC $encoding\n";
+ &mydie("Sorry, locale '".qq{$locale}."' is not valid. Aborting.\n");
+ return 0;
+ }
+ }
+
+# Temporary block for 'Japanese' locales due to a timeout bug in man conversion
+ if ( $locale =~ /^ja/ ) {
+ &mydie("Sorry, there is an issue currently with manpages in $language (locale: '$locale'). They are temporarily disabled and will be re-enabled when the issue is fixed. Try searching using a different language instead.\n");
+ return 0;
+ }
+
+ print "X LANG $language and ENC $encoding\n x" if $debug;
$charset = '';
if ( $encoding && $encoding =~ /^[\w\_]+\.([\w\-]+)$/) {
# Find out our charset
@@ -637,6 +644,7 @@
}
$manPath{$manpath} = join(':', @locale_manpath);
}
+
print "X $manpath - $locale - $manPath{$manpath} x\n" if $debug;
if ($manpath) {
Reply to: