control: tag -1 pending Dear maintainer,
I have been able to reproduce the issue described by Santiago Vila on a machine provided by him. I have also been able to use that machine to produce two patches (different from what I provided above) that fix the issue. I have just NMU'd os-autoinst/4.5.1527308405.8b586d5-4.1 to DELAYED/5; please feel free to reschedule or cancel my upload as you see fit. The patches based on the current state of the debian/sid branch of the git repository at salsa.debian.org (180b0e19dfed3d2c7352144674844fa67b33f9d9) are attached to this mail. Cheers, -Hilko
>From 2baa6f6ab0ef62ef9b9ff4214f5470b323e84c6d Mon Sep 17 00:00:00 2001 From: Hilko Bengen <ben...@debian.org> Date: Mon, 25 Feb 2019 20:00:01 +0100 Subject: [PATCH 1/2] Add patch to avoid race condition in osutils::runcmd (Cloese: #921757) --- ...6-Eliminate-race-condition-in-runcmd.patch | 45 +++++++++++++++++++ ...eck-module-files-that-start-with-a-d.patch | 28 ++++++++++++ debian/patches/series | 2 + 3 files changed, 75 insertions(+) create mode 100644 debian/patches/0006-Eliminate-race-condition-in-runcmd.patch create mode 100644 debian/patches/0007-Do-not-syntax-check-module-files-that-start-with-a-d.patch diff --git a/debian/patches/0006-Eliminate-race-condition-in-runcmd.patch b/debian/patches/0006-Eliminate-race-condition-in-runcmd.patch new file mode 100644 index 00000000..c4d3e9bd --- /dev/null +++ b/debian/patches/0006-Eliminate-race-condition-in-runcmd.patch @@ -0,0 +1,45 @@ +From: Hilko Bengen <ben...@debian.org> +Date: Mon, 25 Feb 2019 09:47:35 +0100 +Subject: Eliminate race condition in runcmd + +--- + osutils.pm | 16 ++++++---------- + 1 file changed, 6 insertions(+), 10 deletions(-) + +diff --git a/osutils.pm b/osutils.pm +index b06a042..05423c3 100644 +--- a/osutils.pm ++++ b/osutils.pm +@@ -93,19 +93,10 @@ sub quote { + # Open a process to run external program and check its return status + sub runcmd { + diag "running " . join(' ', @_); +- my ($pid, $status); +- +- local $SIG{CHLD} = sub { +- local ($!, $?); +- while ((my $child = waitpid(-1, WNOHANG)) > 0) { +- diag "runcmd pid $pid returned $child"; +- $status = $?; +- } +- }; + + my ($wtr, $rdr, $err); + $err = gensym; +- $pid = open3($wtr, $rdr, $err, @_); ++ my $pid = open3($wtr, $rdr, $err, @_); + die "couldn't open: $!" unless defined $pid; + close($wtr) or die "couldn't close fh: $!"; + +@@ -125,6 +116,11 @@ sub runcmd { + close($rdr) or die "couldn't close fh: $!"; + close($err) or die "couldn't close fh: $!"; + ++ my $status; ++ waitpid $pid, 0; ++ $status = $?; ++ diag "runcmd pid $pid returned $status"; ++ + my $exit_code = $status >> 8; + die "runcmd failed with exit code $exit_code" unless ($exit_code == 0); + return $exit_code; diff --git a/debian/patches/0007-Do-not-syntax-check-module-files-that-start-with-a-d.patch b/debian/patches/0007-Do-not-syntax-check-module-files-that-start-with-a-d.patch new file mode 100644 index 00000000..3d90d791 --- /dev/null +++ b/debian/patches/0007-Do-not-syntax-check-module-files-that-start-with-a-d.patch @@ -0,0 +1,28 @@ +From: Hilko Bengen <ben...@debian.org> +Date: Mon, 25 Feb 2019 20:21:55 +0100 +Subject: Do not syntax-check module files that start with a dot (such as .pc) + +--- + t/00-compile-check-all.t | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/t/00-compile-check-all.t b/t/00-compile-check-all.t +index 41896f7..f344853 100755 +--- a/t/00-compile-check-all.t ++++ b/t/00-compile-check-all.t +@@ -36,6 +36,7 @@ my $test = Test::Compile->new(); + my @files = $test->all_pm_files("."); + + for my $file (@files) { ++ next if ($file =~ /^[.]/); + next if ($file =~ /main.pm/); + $file =~ s,^\./,,; + $test->ok($test->pm_file_compiles($file), "Compile test for $file"); +@@ -43,6 +44,7 @@ for my $file (@files) { + + @files = ('isotovideo', $test->all_pl_files(".")); + for my $file (@files) { ++ next if ($file =~ /^[.]/); + $test->ok($test->pl_file_compiles($file), "Compile test for $file"); + } + $test->done_testing(); diff --git a/debian/patches/series b/debian/patches/series index 9d5b44ef..23094b11 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,5 @@ 0003-adjust-to-avoid-ocr-test-failure.patch 0004-avoid-make-check-doc-failure.patch 0005-set-perl-path.patch +0006-Eliminate-race-condition-in-runcmd.patch +0007-Do-not-syntax-check-module-files-that-start-with-a-d.patch -- 2.20.1
>From 29c142a3ef51b12a7cf846a159c8a1a1797bad09 Mon Sep 17 00:00:00 2001 From: Hilko Bengen <ben...@debian.org> Date: Mon, 25 Feb 2019 20:02:15 +0100 Subject: [PATCH 2/2] release --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index a4357aad..c55467d0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +os-autoinst (4.5.1527308405.8b586d5-4.1) unstable; urgency=medium + + * Non-maintainer upload + * Add patch to avoid race condition in osutils::runcmd (Cloese: #921757) + + -- Hilko Bengen <ben...@debian.org> Mon, 25 Feb 2019 20:01:55 +0100 + os-autoinst (4.5.1527308405.8b586d5-4) unstable; urgency=medium * debian/control -- 2.20.1