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 242582141F for ; Wed, 30 Jan 2019 04:44:32 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 06/11] viewvcs: avoid segfault with highlight.pm at shutdown Date: Wed, 30 Jan 2019 04:44:25 +0000 Message-Id: <20190130044430.28189-7-e@80x24.org> In-Reply-To: <20190130044430.28189-1-e@80x24.org> References: <20190130044430.28189-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Proper ordering of destruction seems required to avoid segfaults at shutdown. --- lib/PublicInbox/ViewVCS.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/PublicInbox/ViewVCS.pm b/lib/PublicInbox/ViewVCS.pm index 63e503d..85edf22 100644 --- a/lib/PublicInbox/ViewVCS.pm +++ b/lib/PublicInbox/ViewVCS.pm @@ -26,6 +26,11 @@ my $hl = eval { PublicInbox::HlMod->new; }; +# we need to trigger highlight::CodeGenerator::deleteInstance +# in HlMod::DESTROY before the rest of Perl shuts down to avoid +# a segfault at shutdown +END { $hl = undef }; + my %QP_MAP = ( A => 'oid_a', B => 'oid_b', a => 'path_a', b => 'path_b' ); my $max_size = 1024 * 1024; # TODO: configurable my $enc_utf8 = find_encoding('UTF-8'); -- EW