Control: block 923829 by -1
Hi,
While infestigating a random FTBFS in starlet (#923829), it appeared to me that
the problem is actually in perl. To reproduce te issue, t/12bad_request_line.t
needs to be run in a loop with the following change:
(starlet packaging repo is at
ssh://git@salsa.debian.org/perl-team/modules/packages/starlet.git)
-------------------------------------------
diff --git a/t/12bad_request_line.t b/t/12bad_request_line.t
index 61b4e7b..bdc8368 100644
--- a/t/12bad_request_line.t
+++ b/t/12bad_request_line.t
@@ -22,7 +22,7 @@ test_tcp(
my $port = shift;
local $SIG{__WARN__} = sub {
ok 0, "No warnings";
- diag @_;
+ diag Carp::longmess(@_);
};
my $loader = Plack::Loader->load('Starlet', port => $port);
$loader->run(sub { [200, ['Content-Type' => 'text/plain'], ['OK']] });
-------------------------------------------
A sample loop is this:
while prove -l t/12bad_request_line.t; do date; done
Running this simultaneously in several terminals may help triggering the
failure.
Eventually it fails with:
# 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
# main::__ANON__(33415) called at /usr/share/perl5/Test/TCP.pm line 100
# Test::TCP::start(Test::TCP=HASH(0x55cd8562aed8)) called at /usr/share/perl5/Test/TCP.pm line 82
# Test::TCP::new("Test::TCP", "code", CODE(0x55cd8562aab8)) called at /usr/share/perl5/Test/TCP.pm line 28
# Test::TCP::test_tcp("client", CODE(0x55cd854306b0), "server", CODE(0x55cd8562aab8)) called at t/12bad_request_line.t line 31
# Looks like you failed 1 test of 2.
t/12bad_request_line.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests
The lines in Parallel::Prefork where the warning comes from are:
https://salsa.debian.org/perl-team/modules/packages/libparallel-prefork-perl/-/blob/master/lib/Parallel/Prefork.pm#L71
...
68 unless ($pid) {
69 # child process
70 $self->{in_child} = 1;
71 $SIG{$_} = 'DEFAULT' for keys %{$self->trap_signals};
72 $SIG{CHLD} = 'DEFAULT'; # revert to original
73 exit 0 if $self->signal_received;
...
Seems perfectly normal to me - signal handlers are reset in the forked child.
The only plausible source I find is line 3522 of mg.c:
https://salsa.debian.org/perl-team/interpreter/perl/-/blob/debian-5.34/mg.c#L3522
and here my idea of what is going on vanishes. I hope this is enough as a clue.