Add patch for GDBM_File on 5.26/5.28 Debian buster builds
This patch backports some test skips on GDBM_File against the newer
libgdbm on Debian 10 (buster) from Perl 5.30.
https://rt.perl.org/Public/Bug/Display.html?id=133295
0d9e812de5
.patch
This commit is contained in:
parent
867511fdf1
commit
0104479194
8 changed files with 552 additions and 0 deletions
69
5.026.003-main,threaded-buster/rt-perl-133295.patch
Normal file
69
5.026.003-main,threaded-buster/rt-perl-133295.patch
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Mitchell <davem@iabyn.com>
|
||||||
|
Date: Fri, 14 Dec 2018 16:54:42 +0000
|
||||||
|
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
|
||||||
|
|
||||||
|
This script is supposed to exercise the error handling callback
|
||||||
|
mechanism in gdbm, by triggering an error by surreptitiously closing
|
||||||
|
the file handle which gdbm has opened.
|
||||||
|
|
||||||
|
However, this doesn't trigger an error in newer releases of the gdbm
|
||||||
|
library, which uses mmap() rather than write() etc. In fact I can't see
|
||||||
|
any way of triggering an error: so just skip the relevant tests if we
|
||||||
|
can't trigger a failure.
|
||||||
|
---
|
||||||
|
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
|
||||||
|
1 file changed, 26 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
|
||||||
|
index 3ba66be598c..159916901a9 100644
|
||||||
|
--- a/ext/GDBM_File/t/fatal.t
|
||||||
|
+++ b/ext/GDBM_File/t/fatal.t
|
||||||
|
@@ -1,4 +1,12 @@
|
||||||
|
#!./perl -w
|
||||||
|
+#
|
||||||
|
+# Exercise the error handling callback mechanism in gdbm.
|
||||||
|
+#
|
||||||
|
+# Try to trigger an error by surreptitiously closing the file handle which
|
||||||
|
+# gdbm has opened. Note that this won't trigger an error in newer
|
||||||
|
+# releases of the gdbm library, which uses mmap() rather than write() etc:
|
||||||
|
+# so skip in that case.
|
||||||
|
+
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
use Test::More;
|
||||||
|
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
|
||||||
|
or diag("\$! = $!");
|
||||||
|
isnt(close $fh, undef,
|
||||||
|
"close fileno $fileno, out from underneath the GDBM_File");
|
||||||
|
-is(eval {
|
||||||
|
+
|
||||||
|
+# store some data to a closed file handle
|
||||||
|
+
|
||||||
|
+my $res = eval {
|
||||||
|
$h{Perl} = 'Rules';
|
||||||
|
untie %h;
|
||||||
|
- 1;
|
||||||
|
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
|
||||||
|
-
|
||||||
|
-# Observed "File write error" and "lseek error" from two different systems.
|
||||||
|
-# So there might be more variants. Important part was that we trapped the error
|
||||||
|
-# via croak.
|
||||||
|
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
|
||||||
|
- 'expected error message from GDBM_File');
|
||||||
|
+ 99;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+SKIP: {
|
||||||
|
+ skip "Can't tigger failure", 2 if $res == 99;
|
||||||
|
+
|
||||||
|
+ is $res, undef, "eval should return undef";
|
||||||
|
+
|
||||||
|
+ # Observed "File write error" and "lseek error" from two different
|
||||||
|
+ # systems. So there might be more variants. Important part was that
|
||||||
|
+ # we trapped the error # via croak.
|
||||||
|
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
|
||||||
|
+ 'expected error message from GDBM_File');
|
||||||
|
+}
|
||||||
|
|
||||||
|
unlink <fatal_dbmx*>;
|
69
5.026.003-main-buster/rt-perl-133295.patch
Normal file
69
5.026.003-main-buster/rt-perl-133295.patch
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Mitchell <davem@iabyn.com>
|
||||||
|
Date: Fri, 14 Dec 2018 16:54:42 +0000
|
||||||
|
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
|
||||||
|
|
||||||
|
This script is supposed to exercise the error handling callback
|
||||||
|
mechanism in gdbm, by triggering an error by surreptitiously closing
|
||||||
|
the file handle which gdbm has opened.
|
||||||
|
|
||||||
|
However, this doesn't trigger an error in newer releases of the gdbm
|
||||||
|
library, which uses mmap() rather than write() etc. In fact I can't see
|
||||||
|
any way of triggering an error: so just skip the relevant tests if we
|
||||||
|
can't trigger a failure.
|
||||||
|
---
|
||||||
|
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
|
||||||
|
1 file changed, 26 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
|
||||||
|
index 3ba66be598c..159916901a9 100644
|
||||||
|
--- a/ext/GDBM_File/t/fatal.t
|
||||||
|
+++ b/ext/GDBM_File/t/fatal.t
|
||||||
|
@@ -1,4 +1,12 @@
|
||||||
|
#!./perl -w
|
||||||
|
+#
|
||||||
|
+# Exercise the error handling callback mechanism in gdbm.
|
||||||
|
+#
|
||||||
|
+# Try to trigger an error by surreptitiously closing the file handle which
|
||||||
|
+# gdbm has opened. Note that this won't trigger an error in newer
|
||||||
|
+# releases of the gdbm library, which uses mmap() rather than write() etc:
|
||||||
|
+# so skip in that case.
|
||||||
|
+
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
use Test::More;
|
||||||
|
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
|
||||||
|
or diag("\$! = $!");
|
||||||
|
isnt(close $fh, undef,
|
||||||
|
"close fileno $fileno, out from underneath the GDBM_File");
|
||||||
|
-is(eval {
|
||||||
|
+
|
||||||
|
+# store some data to a closed file handle
|
||||||
|
+
|
||||||
|
+my $res = eval {
|
||||||
|
$h{Perl} = 'Rules';
|
||||||
|
untie %h;
|
||||||
|
- 1;
|
||||||
|
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
|
||||||
|
-
|
||||||
|
-# Observed "File write error" and "lseek error" from two different systems.
|
||||||
|
-# So there might be more variants. Important part was that we trapped the error
|
||||||
|
-# via croak.
|
||||||
|
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
|
||||||
|
- 'expected error message from GDBM_File');
|
||||||
|
+ 99;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+SKIP: {
|
||||||
|
+ skip "Can't tigger failure", 2 if $res == 99;
|
||||||
|
+
|
||||||
|
+ is $res, undef, "eval should return undef";
|
||||||
|
+
|
||||||
|
+ # Observed "File write error" and "lseek error" from two different
|
||||||
|
+ # systems. So there might be more variants. Important part was that
|
||||||
|
+ # we trapped the error # via croak.
|
||||||
|
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
|
||||||
|
+ 'expected error message from GDBM_File');
|
||||||
|
+}
|
||||||
|
|
||||||
|
unlink <fatal_dbmx*>;
|
69
5.026.003-slim,threaded-buster/rt-perl-133295.patch
Normal file
69
5.026.003-slim,threaded-buster/rt-perl-133295.patch
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Mitchell <davem@iabyn.com>
|
||||||
|
Date: Fri, 14 Dec 2018 16:54:42 +0000
|
||||||
|
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
|
||||||
|
|
||||||
|
This script is supposed to exercise the error handling callback
|
||||||
|
mechanism in gdbm, by triggering an error by surreptitiously closing
|
||||||
|
the file handle which gdbm has opened.
|
||||||
|
|
||||||
|
However, this doesn't trigger an error in newer releases of the gdbm
|
||||||
|
library, which uses mmap() rather than write() etc. In fact I can't see
|
||||||
|
any way of triggering an error: so just skip the relevant tests if we
|
||||||
|
can't trigger a failure.
|
||||||
|
---
|
||||||
|
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
|
||||||
|
1 file changed, 26 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
|
||||||
|
index 3ba66be598c..159916901a9 100644
|
||||||
|
--- a/ext/GDBM_File/t/fatal.t
|
||||||
|
+++ b/ext/GDBM_File/t/fatal.t
|
||||||
|
@@ -1,4 +1,12 @@
|
||||||
|
#!./perl -w
|
||||||
|
+#
|
||||||
|
+# Exercise the error handling callback mechanism in gdbm.
|
||||||
|
+#
|
||||||
|
+# Try to trigger an error by surreptitiously closing the file handle which
|
||||||
|
+# gdbm has opened. Note that this won't trigger an error in newer
|
||||||
|
+# releases of the gdbm library, which uses mmap() rather than write() etc:
|
||||||
|
+# so skip in that case.
|
||||||
|
+
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
use Test::More;
|
||||||
|
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
|
||||||
|
or diag("\$! = $!");
|
||||||
|
isnt(close $fh, undef,
|
||||||
|
"close fileno $fileno, out from underneath the GDBM_File");
|
||||||
|
-is(eval {
|
||||||
|
+
|
||||||
|
+# store some data to a closed file handle
|
||||||
|
+
|
||||||
|
+my $res = eval {
|
||||||
|
$h{Perl} = 'Rules';
|
||||||
|
untie %h;
|
||||||
|
- 1;
|
||||||
|
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
|
||||||
|
-
|
||||||
|
-# Observed "File write error" and "lseek error" from two different systems.
|
||||||
|
-# So there might be more variants. Important part was that we trapped the error
|
||||||
|
-# via croak.
|
||||||
|
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
|
||||||
|
- 'expected error message from GDBM_File');
|
||||||
|
+ 99;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+SKIP: {
|
||||||
|
+ skip "Can't tigger failure", 2 if $res == 99;
|
||||||
|
+
|
||||||
|
+ is $res, undef, "eval should return undef";
|
||||||
|
+
|
||||||
|
+ # Observed "File write error" and "lseek error" from two different
|
||||||
|
+ # systems. So there might be more variants. Important part was that
|
||||||
|
+ # we trapped the error # via croak.
|
||||||
|
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
|
||||||
|
+ 'expected error message from GDBM_File');
|
||||||
|
+}
|
||||||
|
|
||||||
|
unlink <fatal_dbmx*>;
|
69
5.026.003-slim-buster/rt-perl-133295.patch
Normal file
69
5.026.003-slim-buster/rt-perl-133295.patch
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Mitchell <davem@iabyn.com>
|
||||||
|
Date: Fri, 14 Dec 2018 16:54:42 +0000
|
||||||
|
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
|
||||||
|
|
||||||
|
This script is supposed to exercise the error handling callback
|
||||||
|
mechanism in gdbm, by triggering an error by surreptitiously closing
|
||||||
|
the file handle which gdbm has opened.
|
||||||
|
|
||||||
|
However, this doesn't trigger an error in newer releases of the gdbm
|
||||||
|
library, which uses mmap() rather than write() etc. In fact I can't see
|
||||||
|
any way of triggering an error: so just skip the relevant tests if we
|
||||||
|
can't trigger a failure.
|
||||||
|
---
|
||||||
|
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
|
||||||
|
1 file changed, 26 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
|
||||||
|
index 3ba66be598c..159916901a9 100644
|
||||||
|
--- a/ext/GDBM_File/t/fatal.t
|
||||||
|
+++ b/ext/GDBM_File/t/fatal.t
|
||||||
|
@@ -1,4 +1,12 @@
|
||||||
|
#!./perl -w
|
||||||
|
+#
|
||||||
|
+# Exercise the error handling callback mechanism in gdbm.
|
||||||
|
+#
|
||||||
|
+# Try to trigger an error by surreptitiously closing the file handle which
|
||||||
|
+# gdbm has opened. Note that this won't trigger an error in newer
|
||||||
|
+# releases of the gdbm library, which uses mmap() rather than write() etc:
|
||||||
|
+# so skip in that case.
|
||||||
|
+
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
use Test::More;
|
||||||
|
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
|
||||||
|
or diag("\$! = $!");
|
||||||
|
isnt(close $fh, undef,
|
||||||
|
"close fileno $fileno, out from underneath the GDBM_File");
|
||||||
|
-is(eval {
|
||||||
|
+
|
||||||
|
+# store some data to a closed file handle
|
||||||
|
+
|
||||||
|
+my $res = eval {
|
||||||
|
$h{Perl} = 'Rules';
|
||||||
|
untie %h;
|
||||||
|
- 1;
|
||||||
|
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
|
||||||
|
-
|
||||||
|
-# Observed "File write error" and "lseek error" from two different systems.
|
||||||
|
-# So there might be more variants. Important part was that we trapped the error
|
||||||
|
-# via croak.
|
||||||
|
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
|
||||||
|
- 'expected error message from GDBM_File');
|
||||||
|
+ 99;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+SKIP: {
|
||||||
|
+ skip "Can't tigger failure", 2 if $res == 99;
|
||||||
|
+
|
||||||
|
+ is $res, undef, "eval should return undef";
|
||||||
|
+
|
||||||
|
+ # Observed "File write error" and "lseek error" from two different
|
||||||
|
+ # systems. So there might be more variants. Important part was that
|
||||||
|
+ # we trapped the error # via croak.
|
||||||
|
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
|
||||||
|
+ 'expected error message from GDBM_File');
|
||||||
|
+}
|
||||||
|
|
||||||
|
unlink <fatal_dbmx*>;
|
69
5.028.002-main,threaded-buster/rt-perl-133295.patch
Normal file
69
5.028.002-main,threaded-buster/rt-perl-133295.patch
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Mitchell <davem@iabyn.com>
|
||||||
|
Date: Fri, 14 Dec 2018 16:54:42 +0000
|
||||||
|
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
|
||||||
|
|
||||||
|
This script is supposed to exercise the error handling callback
|
||||||
|
mechanism in gdbm, by triggering an error by surreptitiously closing
|
||||||
|
the file handle which gdbm has opened.
|
||||||
|
|
||||||
|
However, this doesn't trigger an error in newer releases of the gdbm
|
||||||
|
library, which uses mmap() rather than write() etc. In fact I can't see
|
||||||
|
any way of triggering an error: so just skip the relevant tests if we
|
||||||
|
can't trigger a failure.
|
||||||
|
---
|
||||||
|
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
|
||||||
|
1 file changed, 26 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
|
||||||
|
index 3ba66be598c..159916901a9 100644
|
||||||
|
--- a/ext/GDBM_File/t/fatal.t
|
||||||
|
+++ b/ext/GDBM_File/t/fatal.t
|
||||||
|
@@ -1,4 +1,12 @@
|
||||||
|
#!./perl -w
|
||||||
|
+#
|
||||||
|
+# Exercise the error handling callback mechanism in gdbm.
|
||||||
|
+#
|
||||||
|
+# Try to trigger an error by surreptitiously closing the file handle which
|
||||||
|
+# gdbm has opened. Note that this won't trigger an error in newer
|
||||||
|
+# releases of the gdbm library, which uses mmap() rather than write() etc:
|
||||||
|
+# so skip in that case.
|
||||||
|
+
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
use Test::More;
|
||||||
|
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
|
||||||
|
or diag("\$! = $!");
|
||||||
|
isnt(close $fh, undef,
|
||||||
|
"close fileno $fileno, out from underneath the GDBM_File");
|
||||||
|
-is(eval {
|
||||||
|
+
|
||||||
|
+# store some data to a closed file handle
|
||||||
|
+
|
||||||
|
+my $res = eval {
|
||||||
|
$h{Perl} = 'Rules';
|
||||||
|
untie %h;
|
||||||
|
- 1;
|
||||||
|
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
|
||||||
|
-
|
||||||
|
-# Observed "File write error" and "lseek error" from two different systems.
|
||||||
|
-# So there might be more variants. Important part was that we trapped the error
|
||||||
|
-# via croak.
|
||||||
|
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
|
||||||
|
- 'expected error message from GDBM_File');
|
||||||
|
+ 99;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+SKIP: {
|
||||||
|
+ skip "Can't tigger failure", 2 if $res == 99;
|
||||||
|
+
|
||||||
|
+ is $res, undef, "eval should return undef";
|
||||||
|
+
|
||||||
|
+ # Observed "File write error" and "lseek error" from two different
|
||||||
|
+ # systems. So there might be more variants. Important part was that
|
||||||
|
+ # we trapped the error # via croak.
|
||||||
|
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
|
||||||
|
+ 'expected error message from GDBM_File');
|
||||||
|
+}
|
||||||
|
|
||||||
|
unlink <fatal_dbmx*>;
|
69
5.028.002-main-buster/rt-perl-133295.patch
Normal file
69
5.028.002-main-buster/rt-perl-133295.patch
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Mitchell <davem@iabyn.com>
|
||||||
|
Date: Fri, 14 Dec 2018 16:54:42 +0000
|
||||||
|
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
|
||||||
|
|
||||||
|
This script is supposed to exercise the error handling callback
|
||||||
|
mechanism in gdbm, by triggering an error by surreptitiously closing
|
||||||
|
the file handle which gdbm has opened.
|
||||||
|
|
||||||
|
However, this doesn't trigger an error in newer releases of the gdbm
|
||||||
|
library, which uses mmap() rather than write() etc. In fact I can't see
|
||||||
|
any way of triggering an error: so just skip the relevant tests if we
|
||||||
|
can't trigger a failure.
|
||||||
|
---
|
||||||
|
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
|
||||||
|
1 file changed, 26 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
|
||||||
|
index 3ba66be598c..159916901a9 100644
|
||||||
|
--- a/ext/GDBM_File/t/fatal.t
|
||||||
|
+++ b/ext/GDBM_File/t/fatal.t
|
||||||
|
@@ -1,4 +1,12 @@
|
||||||
|
#!./perl -w
|
||||||
|
+#
|
||||||
|
+# Exercise the error handling callback mechanism in gdbm.
|
||||||
|
+#
|
||||||
|
+# Try to trigger an error by surreptitiously closing the file handle which
|
||||||
|
+# gdbm has opened. Note that this won't trigger an error in newer
|
||||||
|
+# releases of the gdbm library, which uses mmap() rather than write() etc:
|
||||||
|
+# so skip in that case.
|
||||||
|
+
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
use Test::More;
|
||||||
|
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
|
||||||
|
or diag("\$! = $!");
|
||||||
|
isnt(close $fh, undef,
|
||||||
|
"close fileno $fileno, out from underneath the GDBM_File");
|
||||||
|
-is(eval {
|
||||||
|
+
|
||||||
|
+# store some data to a closed file handle
|
||||||
|
+
|
||||||
|
+my $res = eval {
|
||||||
|
$h{Perl} = 'Rules';
|
||||||
|
untie %h;
|
||||||
|
- 1;
|
||||||
|
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
|
||||||
|
-
|
||||||
|
-# Observed "File write error" and "lseek error" from two different systems.
|
||||||
|
-# So there might be more variants. Important part was that we trapped the error
|
||||||
|
-# via croak.
|
||||||
|
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
|
||||||
|
- 'expected error message from GDBM_File');
|
||||||
|
+ 99;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+SKIP: {
|
||||||
|
+ skip "Can't tigger failure", 2 if $res == 99;
|
||||||
|
+
|
||||||
|
+ is $res, undef, "eval should return undef";
|
||||||
|
+
|
||||||
|
+ # Observed "File write error" and "lseek error" from two different
|
||||||
|
+ # systems. So there might be more variants. Important part was that
|
||||||
|
+ # we trapped the error # via croak.
|
||||||
|
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
|
||||||
|
+ 'expected error message from GDBM_File');
|
||||||
|
+}
|
||||||
|
|
||||||
|
unlink <fatal_dbmx*>;
|
69
5.028.002-slim,threaded-buster/rt-perl-133295.patch
Normal file
69
5.028.002-slim,threaded-buster/rt-perl-133295.patch
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Mitchell <davem@iabyn.com>
|
||||||
|
Date: Fri, 14 Dec 2018 16:54:42 +0000
|
||||||
|
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
|
||||||
|
|
||||||
|
This script is supposed to exercise the error handling callback
|
||||||
|
mechanism in gdbm, by triggering an error by surreptitiously closing
|
||||||
|
the file handle which gdbm has opened.
|
||||||
|
|
||||||
|
However, this doesn't trigger an error in newer releases of the gdbm
|
||||||
|
library, which uses mmap() rather than write() etc. In fact I can't see
|
||||||
|
any way of triggering an error: so just skip the relevant tests if we
|
||||||
|
can't trigger a failure.
|
||||||
|
---
|
||||||
|
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
|
||||||
|
1 file changed, 26 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
|
||||||
|
index 3ba66be598c..159916901a9 100644
|
||||||
|
--- a/ext/GDBM_File/t/fatal.t
|
||||||
|
+++ b/ext/GDBM_File/t/fatal.t
|
||||||
|
@@ -1,4 +1,12 @@
|
||||||
|
#!./perl -w
|
||||||
|
+#
|
||||||
|
+# Exercise the error handling callback mechanism in gdbm.
|
||||||
|
+#
|
||||||
|
+# Try to trigger an error by surreptitiously closing the file handle which
|
||||||
|
+# gdbm has opened. Note that this won't trigger an error in newer
|
||||||
|
+# releases of the gdbm library, which uses mmap() rather than write() etc:
|
||||||
|
+# so skip in that case.
|
||||||
|
+
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
use Test::More;
|
||||||
|
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
|
||||||
|
or diag("\$! = $!");
|
||||||
|
isnt(close $fh, undef,
|
||||||
|
"close fileno $fileno, out from underneath the GDBM_File");
|
||||||
|
-is(eval {
|
||||||
|
+
|
||||||
|
+# store some data to a closed file handle
|
||||||
|
+
|
||||||
|
+my $res = eval {
|
||||||
|
$h{Perl} = 'Rules';
|
||||||
|
untie %h;
|
||||||
|
- 1;
|
||||||
|
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
|
||||||
|
-
|
||||||
|
-# Observed "File write error" and "lseek error" from two different systems.
|
||||||
|
-# So there might be more variants. Important part was that we trapped the error
|
||||||
|
-# via croak.
|
||||||
|
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
|
||||||
|
- 'expected error message from GDBM_File');
|
||||||
|
+ 99;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+SKIP: {
|
||||||
|
+ skip "Can't tigger failure", 2 if $res == 99;
|
||||||
|
+
|
||||||
|
+ is $res, undef, "eval should return undef";
|
||||||
|
+
|
||||||
|
+ # Observed "File write error" and "lseek error" from two different
|
||||||
|
+ # systems. So there might be more variants. Important part was that
|
||||||
|
+ # we trapped the error # via croak.
|
||||||
|
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
|
||||||
|
+ 'expected error message from GDBM_File');
|
||||||
|
+}
|
||||||
|
|
||||||
|
unlink <fatal_dbmx*>;
|
69
5.028.002-slim-buster/rt-perl-133295.patch
Normal file
69
5.028.002-slim-buster/rt-perl-133295.patch
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Mitchell <davem@iabyn.com>
|
||||||
|
Date: Fri, 14 Dec 2018 16:54:42 +0000
|
||||||
|
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
|
||||||
|
|
||||||
|
This script is supposed to exercise the error handling callback
|
||||||
|
mechanism in gdbm, by triggering an error by surreptitiously closing
|
||||||
|
the file handle which gdbm has opened.
|
||||||
|
|
||||||
|
However, this doesn't trigger an error in newer releases of the gdbm
|
||||||
|
library, which uses mmap() rather than write() etc. In fact I can't see
|
||||||
|
any way of triggering an error: so just skip the relevant tests if we
|
||||||
|
can't trigger a failure.
|
||||||
|
---
|
||||||
|
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
|
||||||
|
1 file changed, 26 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
|
||||||
|
index 3ba66be598c..159916901a9 100644
|
||||||
|
--- a/ext/GDBM_File/t/fatal.t
|
||||||
|
+++ b/ext/GDBM_File/t/fatal.t
|
||||||
|
@@ -1,4 +1,12 @@
|
||||||
|
#!./perl -w
|
||||||
|
+#
|
||||||
|
+# Exercise the error handling callback mechanism in gdbm.
|
||||||
|
+#
|
||||||
|
+# Try to trigger an error by surreptitiously closing the file handle which
|
||||||
|
+# gdbm has opened. Note that this won't trigger an error in newer
|
||||||
|
+# releases of the gdbm library, which uses mmap() rather than write() etc:
|
||||||
|
+# so skip in that case.
|
||||||
|
+
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
use Test::More;
|
||||||
|
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
|
||||||
|
or diag("\$! = $!");
|
||||||
|
isnt(close $fh, undef,
|
||||||
|
"close fileno $fileno, out from underneath the GDBM_File");
|
||||||
|
-is(eval {
|
||||||
|
+
|
||||||
|
+# store some data to a closed file handle
|
||||||
|
+
|
||||||
|
+my $res = eval {
|
||||||
|
$h{Perl} = 'Rules';
|
||||||
|
untie %h;
|
||||||
|
- 1;
|
||||||
|
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
|
||||||
|
-
|
||||||
|
-# Observed "File write error" and "lseek error" from two different systems.
|
||||||
|
-# So there might be more variants. Important part was that we trapped the error
|
||||||
|
-# via croak.
|
||||||
|
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
|
||||||
|
- 'expected error message from GDBM_File');
|
||||||
|
+ 99;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+SKIP: {
|
||||||
|
+ skip "Can't tigger failure", 2 if $res == 99;
|
||||||
|
+
|
||||||
|
+ is $res, undef, "eval should return undef";
|
||||||
|
+
|
||||||
|
+ # Observed "File write error" and "lseek error" from two different
|
||||||
|
+ # systems. So there might be more variants. Important part was that
|
||||||
|
+ # we trapped the error # via croak.
|
||||||
|
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
|
||||||
|
+ 'expected error message from GDBM_File');
|
||||||
|
+}
|
||||||
|
|
||||||
|
unlink <fatal_dbmx*>;
|
Loading…
Add table
Reference in a new issue