Hi,

I have had the same problem last couple of days, finally could track
what is happening:

- Exit.pm installs a handler for __DIE__

- Vendor.pm expects that eval will return an error message in $@ and
all the code below the eval that was supposed to use the default vendor
is never reached. The handler for __DIE__ is called instead and the
program terminates with exit code 127.

- As a result dpkg-source -b . dies with exit code 127 and no error
message is shown, which itself makes the problem very hard to track and
report.

I would suggest two things:

1) Fix the code in Vendor.pm to avoid the global handler around eval
and make the code work as initially planned (patch attached)

2) Add some error message/stack dump/whatever in Exit.pm, so that
another similar problem is diagnosed and reported in a more easy way. I
have no idea what would be the best format for this and that's why can
not propose a patch.

With best regards,
b.

--- Vendor.pm.orig	2020-07-23 03:01:40.528128860 +0300
+++ Vendor.pm	2020-07-23 03:01:56.272129613 +0300
@@ -187,11 +187,14 @@ sub get_vendor_object {
     push @names, $vendor, lc($vendor), ucfirst($vendor), ucfirst(lc($vendor));
 
     foreach my $name (@names) {
+        my $oldsig=@SIG{__DIE__};
+        @SIG{__DIE__}='DEFAULT';
         eval qq{
             pop \@INC if \$INC[-1] eq '.';
             require Dpkg::Vendor::$name;
             \$obj = Dpkg::Vendor::$name->new();
         };
+        @SIG{__DIE__}=$oldsig;
         unless ($@) {
             $OBJECT_CACHE{$vendor} = $obj;
             return $obj;

Reply via email to