From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id A389020248 for ; Tue, 2 Apr 2019 00:45:48 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] viewvcs: check for premature EOF from git-cat-file Date: Tue, 2 Apr 2019 00:45:48 +0000 Message-Id: <20190402004548.4784-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Not entirely sure what is causing this, but it appears to be causing infinite loops when attempting to display certain blobs. Fortunately, the fair scheduling of public-inbox-httpd prevented this from becoming a real problem aside from increasing CPU usage. --- lib/PublicInbox/ViewVCS.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/PublicInbox/ViewVCS.pm b/lib/PublicInbox/ViewVCS.pm index b90cd8c..962dc66 100644 --- a/lib/PublicInbox/ViewVCS.pm +++ b/lib/PublicInbox/ViewVCS.pm @@ -62,6 +62,10 @@ sub stream_large_blob ($$$$) { my $ct = 'text/plain; charset=UTF-8'; return [200, ['Content-Type', $ct, @cl] ]; } + if ($r == 0) { + warn "premature EOF on $oid $$logref\n"; + return html_page($ctx, 500, $logref); + } undef; # bref keeps growing } }); -- EW