Bug#1012073: perl: restoring default signal handler may warn with 'SIGTERM handler "DEFAULT" not defined'
Damyan Ivanov
dmn at debian.org
Wed Jun 1 20:46:44 BST 2022
-=| Niko Tyni, 30.05.2022 09:27:40 +0100 |=-
> On Sun, May 29, 2022 at 05:38:40PM +0000, Damyan Ivanov wrote:
> > Package: perl
> > Version: 5.34.0-4
> > Severity: normal
>
> > While infestigating a random FTBFS in starlet (#923829), it appeared to me that
> > the problem is actually in perl.
>
> > # Failed test 'No warnings'
> > # at t/12bad_request_line.t line 24.
> > # SIGTERM handler "DEFAULT" not defined.
> > # at /usr/share/perl5/Parallel/Prefork.pm line 71.
> > # Parallel::Prefork::start(Parallel::Prefork=HASH(0x55cd856355b8)) called at .../lib/Plack/Handler/Starlet.pm line 78
> > # Plack::Handler::Starlet::run(Plack::Handler::Starlet=HASH(0x55cd849b0ad8), CODE(0x55cd8562ac98)) called at t/12bad_request_line.t line 28
>
> Just a quick reply that a smaller reproducer would obviously help.
Yeah. Sorry about that. When I posted this I was already a bit tired
chasing where the warning comes from.
Here's a cleaner reproducer:
$ cat <<'EOF' > default-signal.pl
use strict;
use warnings;
use Carp::Always; # to get a line number for the warning
$SIG{TERM} = sub{};
while() {
my $pid = fork();
defined($pid) or die 0;
if ($pid) {
sleep(0.1);
kill TERM => $pid;
wait;
}
else {
$SIG{TERM} = "DEFAULT";
exit(0);
}
}
EOF
$ perl default-signal.pl
SIGTERM handler "DEFAULT" not defined.
at default-signal.pl line 16.
…
On my laptop the warnings start to pour in a second or two.
If I comment out that sleep(), no warnings are shown.
> FWIW this looks somewhat similar to
>
> https://github.com/perl/perl5/issues/10913
>
> but I assume the 'prefork' references mean threads are not involved
> here. So perhaps unrelated after all.
This is what I looked at too and came to the same conclusion (threads
≠ forks).
-- Damyan
More information about the Perl-maintainers
mailing list