Bug#1014730: liburi-perl: Breaks apt-cacher with "Can't locate Regexp/IPv6.pm" error

Mark Hindley mark at hindley.org.uk
Tue Jul 12 13:33:10 BST 2022


Hi,

On Tue, Jul 12, 2022 at 07:31:48AM +0100, Mark Hindley wrote:
> > Corresponding untested patch against apt-cacher attached.
> 
> The problem with this approach is that errors from apt-cacher's own evals will
> be skipped as well.

I think the patch below might be a better approach. It preserves the logging
output which is an important function of die_handler().

Robert, are you able to test this?

Thanks.

Mark

>From ae98977a1747350ee6659408bc8b08c366a7116d Mon Sep 17 00:00:00 2001
From: Mark Hindley <mark at hindley.org.uk>
Date: Tue, 12 Jul 2022 13:25:37 +0100
Subject: [PATCH] Don't exit in die_handler() if called from eval.

$SIG{__DIE__} hook is called from evals.

Closes: #1014730
---
 apt-cacher | 1 +
 1 file changed, 1 insertion(+)

diff --git a/apt-cacher b/apt-cacher
index a8c00cb..56eccf8 100755
--- a/apt-cacher
+++ b/apt-cacher
@@ -1255,6 +1255,7 @@ sub write_error_log {
 sub die_handler {
     my ($msg) = @_;
     write_error_log("error [$$]: $msg");
+    return if $^S; # In eval block
     sendrsp(HTTP::Response->new(502, 'apt-cacher internal error (died)', ['Connection' => 'close'])) if $con;
     exit 1;
 }
-- 
2.35.1



More information about the pkg-perl-maintainers mailing list