Skip to content

Commit 0104479

Browse files
committed
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 https://github.com/Perl/perl5/commit/0d9e812de5885109532ec8bf484f165213ab97cb.patch
1 parent 867511f commit 0104479

File tree

8 files changed

+552
-0
lines changed

8 files changed

+552
-0
lines changed

Diff for: 5.026.003-main,threaded-buster/rt-perl-133295.patch

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
2+
From: David Mitchell <[email protected]>
3+
Date: Fri, 14 Dec 2018 16:54:42 +0000
4+
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
5+
6+
This script is supposed to exercise the error handling callback
7+
mechanism in gdbm, by triggering an error by surreptitiously closing
8+
the file handle which gdbm has opened.
9+
10+
However, this doesn't trigger an error in newer releases of the gdbm
11+
library, which uses mmap() rather than write() etc. In fact I can't see
12+
any way of triggering an error: so just skip the relevant tests if we
13+
can't trigger a failure.
14+
---
15+
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
16+
1 file changed, 26 insertions(+), 9 deletions(-)
17+
18+
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
19+
index 3ba66be598c..159916901a9 100644
20+
--- a/ext/GDBM_File/t/fatal.t
21+
+++ b/ext/GDBM_File/t/fatal.t
22+
@@ -1,4 +1,12 @@
23+
#!./perl -w
24+
+#
25+
+# Exercise the error handling callback mechanism in gdbm.
26+
+#
27+
+# Try to trigger an error by surreptitiously closing the file handle which
28+
+# gdbm has opened. Note that this won't trigger an error in newer
29+
+# releases of the gdbm library, which uses mmap() rather than write() etc:
30+
+# so skip in that case.
31+
+
32+
use strict;
33+
34+
use Test::More;
35+
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
36+
or diag("\$! = $!");
37+
isnt(close $fh, undef,
38+
"close fileno $fileno, out from underneath the GDBM_File");
39+
-is(eval {
40+
+
41+
+# store some data to a closed file handle
42+
+
43+
+my $res = eval {
44+
$h{Perl} = 'Rules';
45+
untie %h;
46+
- 1;
47+
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
48+
-
49+
-# Observed "File write error" and "lseek error" from two different systems.
50+
-# So there might be more variants. Important part was that we trapped the error
51+
-# via croak.
52+
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
53+
- 'expected error message from GDBM_File');
54+
+ 99;
55+
+};
56+
+
57+
+SKIP: {
58+
+ skip "Can't tigger failure", 2 if $res == 99;
59+
+
60+
+ is $res, undef, "eval should return undef";
61+
+
62+
+ # Observed "File write error" and "lseek error" from two different
63+
+ # systems. So there might be more variants. Important part was that
64+
+ # we trapped the error # via croak.
65+
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
66+
+ 'expected error message from GDBM_File');
67+
+}
68+
69+
unlink <fatal_dbmx*>;

Diff for: 5.026.003-main-buster/rt-perl-133295.patch

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
2+
From: David Mitchell <[email protected]>
3+
Date: Fri, 14 Dec 2018 16:54:42 +0000
4+
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
5+
6+
This script is supposed to exercise the error handling callback
7+
mechanism in gdbm, by triggering an error by surreptitiously closing
8+
the file handle which gdbm has opened.
9+
10+
However, this doesn't trigger an error in newer releases of the gdbm
11+
library, which uses mmap() rather than write() etc. In fact I can't see
12+
any way of triggering an error: so just skip the relevant tests if we
13+
can't trigger a failure.
14+
---
15+
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
16+
1 file changed, 26 insertions(+), 9 deletions(-)
17+
18+
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
19+
index 3ba66be598c..159916901a9 100644
20+
--- a/ext/GDBM_File/t/fatal.t
21+
+++ b/ext/GDBM_File/t/fatal.t
22+
@@ -1,4 +1,12 @@
23+
#!./perl -w
24+
+#
25+
+# Exercise the error handling callback mechanism in gdbm.
26+
+#
27+
+# Try to trigger an error by surreptitiously closing the file handle which
28+
+# gdbm has opened. Note that this won't trigger an error in newer
29+
+# releases of the gdbm library, which uses mmap() rather than write() etc:
30+
+# so skip in that case.
31+
+
32+
use strict;
33+
34+
use Test::More;
35+
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
36+
or diag("\$! = $!");
37+
isnt(close $fh, undef,
38+
"close fileno $fileno, out from underneath the GDBM_File");
39+
-is(eval {
40+
+
41+
+# store some data to a closed file handle
42+
+
43+
+my $res = eval {
44+
$h{Perl} = 'Rules';
45+
untie %h;
46+
- 1;
47+
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
48+
-
49+
-# Observed "File write error" and "lseek error" from two different systems.
50+
-# So there might be more variants. Important part was that we trapped the error
51+
-# via croak.
52+
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
53+
- 'expected error message from GDBM_File');
54+
+ 99;
55+
+};
56+
+
57+
+SKIP: {
58+
+ skip "Can't tigger failure", 2 if $res == 99;
59+
+
60+
+ is $res, undef, "eval should return undef";
61+
+
62+
+ # Observed "File write error" and "lseek error" from two different
63+
+ # systems. So there might be more variants. Important part was that
64+
+ # we trapped the error # via croak.
65+
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
66+
+ 'expected error message from GDBM_File');
67+
+}
68+
69+
unlink <fatal_dbmx*>;

Diff for: 5.026.003-slim,threaded-buster/rt-perl-133295.patch

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
2+
From: David Mitchell <[email protected]>
3+
Date: Fri, 14 Dec 2018 16:54:42 +0000
4+
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
5+
6+
This script is supposed to exercise the error handling callback
7+
mechanism in gdbm, by triggering an error by surreptitiously closing
8+
the file handle which gdbm has opened.
9+
10+
However, this doesn't trigger an error in newer releases of the gdbm
11+
library, which uses mmap() rather than write() etc. In fact I can't see
12+
any way of triggering an error: so just skip the relevant tests if we
13+
can't trigger a failure.
14+
---
15+
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
16+
1 file changed, 26 insertions(+), 9 deletions(-)
17+
18+
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
19+
index 3ba66be598c..159916901a9 100644
20+
--- a/ext/GDBM_File/t/fatal.t
21+
+++ b/ext/GDBM_File/t/fatal.t
22+
@@ -1,4 +1,12 @@
23+
#!./perl -w
24+
+#
25+
+# Exercise the error handling callback mechanism in gdbm.
26+
+#
27+
+# Try to trigger an error by surreptitiously closing the file handle which
28+
+# gdbm has opened. Note that this won't trigger an error in newer
29+
+# releases of the gdbm library, which uses mmap() rather than write() etc:
30+
+# so skip in that case.
31+
+
32+
use strict;
33+
34+
use Test::More;
35+
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
36+
or diag("\$! = $!");
37+
isnt(close $fh, undef,
38+
"close fileno $fileno, out from underneath the GDBM_File");
39+
-is(eval {
40+
+
41+
+# store some data to a closed file handle
42+
+
43+
+my $res = eval {
44+
$h{Perl} = 'Rules';
45+
untie %h;
46+
- 1;
47+
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
48+
-
49+
-# Observed "File write error" and "lseek error" from two different systems.
50+
-# So there might be more variants. Important part was that we trapped the error
51+
-# via croak.
52+
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
53+
- 'expected error message from GDBM_File');
54+
+ 99;
55+
+};
56+
+
57+
+SKIP: {
58+
+ skip "Can't tigger failure", 2 if $res == 99;
59+
+
60+
+ is $res, undef, "eval should return undef";
61+
+
62+
+ # Observed "File write error" and "lseek error" from two different
63+
+ # systems. So there might be more variants. Important part was that
64+
+ # we trapped the error # via croak.
65+
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
66+
+ 'expected error message from GDBM_File');
67+
+}
68+
69+
unlink <fatal_dbmx*>;

Diff for: 5.026.003-slim-buster/rt-perl-133295.patch

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
2+
From: David Mitchell <[email protected]>
3+
Date: Fri, 14 Dec 2018 16:54:42 +0000
4+
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
5+
6+
This script is supposed to exercise the error handling callback
7+
mechanism in gdbm, by triggering an error by surreptitiously closing
8+
the file handle which gdbm has opened.
9+
10+
However, this doesn't trigger an error in newer releases of the gdbm
11+
library, which uses mmap() rather than write() etc. In fact I can't see
12+
any way of triggering an error: so just skip the relevant tests if we
13+
can't trigger a failure.
14+
---
15+
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
16+
1 file changed, 26 insertions(+), 9 deletions(-)
17+
18+
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
19+
index 3ba66be598c..159916901a9 100644
20+
--- a/ext/GDBM_File/t/fatal.t
21+
+++ b/ext/GDBM_File/t/fatal.t
22+
@@ -1,4 +1,12 @@
23+
#!./perl -w
24+
+#
25+
+# Exercise the error handling callback mechanism in gdbm.
26+
+#
27+
+# Try to trigger an error by surreptitiously closing the file handle which
28+
+# gdbm has opened. Note that this won't trigger an error in newer
29+
+# releases of the gdbm library, which uses mmap() rather than write() etc:
30+
+# so skip in that case.
31+
+
32+
use strict;
33+
34+
use Test::More;
35+
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
36+
or diag("\$! = $!");
37+
isnt(close $fh, undef,
38+
"close fileno $fileno, out from underneath the GDBM_File");
39+
-is(eval {
40+
+
41+
+# store some data to a closed file handle
42+
+
43+
+my $res = eval {
44+
$h{Perl} = 'Rules';
45+
untie %h;
46+
- 1;
47+
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
48+
-
49+
-# Observed "File write error" and "lseek error" from two different systems.
50+
-# So there might be more variants. Important part was that we trapped the error
51+
-# via croak.
52+
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
53+
- 'expected error message from GDBM_File');
54+
+ 99;
55+
+};
56+
+
57+
+SKIP: {
58+
+ skip "Can't tigger failure", 2 if $res == 99;
59+
+
60+
+ is $res, undef, "eval should return undef";
61+
+
62+
+ # Observed "File write error" and "lseek error" from two different
63+
+ # systems. So there might be more variants. Important part was that
64+
+ # we trapped the error # via croak.
65+
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
66+
+ 'expected error message from GDBM_File');
67+
+}
68+
69+
unlink <fatal_dbmx*>;

Diff for: 5.028.002-main,threaded-buster/rt-perl-133295.patch

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
2+
From: David Mitchell <[email protected]>
3+
Date: Fri, 14 Dec 2018 16:54:42 +0000
4+
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
5+
6+
This script is supposed to exercise the error handling callback
7+
mechanism in gdbm, by triggering an error by surreptitiously closing
8+
the file handle which gdbm has opened.
9+
10+
However, this doesn't trigger an error in newer releases of the gdbm
11+
library, which uses mmap() rather than write() etc. In fact I can't see
12+
any way of triggering an error: so just skip the relevant tests if we
13+
can't trigger a failure.
14+
---
15+
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
16+
1 file changed, 26 insertions(+), 9 deletions(-)
17+
18+
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
19+
index 3ba66be598c..159916901a9 100644
20+
--- a/ext/GDBM_File/t/fatal.t
21+
+++ b/ext/GDBM_File/t/fatal.t
22+
@@ -1,4 +1,12 @@
23+
#!./perl -w
24+
+#
25+
+# Exercise the error handling callback mechanism in gdbm.
26+
+#
27+
+# Try to trigger an error by surreptitiously closing the file handle which
28+
+# gdbm has opened. Note that this won't trigger an error in newer
29+
+# releases of the gdbm library, which uses mmap() rather than write() etc:
30+
+# so skip in that case.
31+
+
32+
use strict;
33+
34+
use Test::More;
35+
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
36+
or diag("\$! = $!");
37+
isnt(close $fh, undef,
38+
"close fileno $fileno, out from underneath the GDBM_File");
39+
-is(eval {
40+
+
41+
+# store some data to a closed file handle
42+
+
43+
+my $res = eval {
44+
$h{Perl} = 'Rules';
45+
untie %h;
46+
- 1;
47+
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
48+
-
49+
-# Observed "File write error" and "lseek error" from two different systems.
50+
-# So there might be more variants. Important part was that we trapped the error
51+
-# via croak.
52+
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
53+
- 'expected error message from GDBM_File');
54+
+ 99;
55+
+};
56+
+
57+
+SKIP: {
58+
+ skip "Can't tigger failure", 2 if $res == 99;
59+
+
60+
+ is $res, undef, "eval should return undef";
61+
+
62+
+ # Observed "File write error" and "lseek error" from two different
63+
+ # systems. So there might be more variants. Important part was that
64+
+ # we trapped the error # via croak.
65+
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
66+
+ 'expected error message from GDBM_File');
67+
+}
68+
69+
unlink <fatal_dbmx*>;

0 commit comments

Comments
 (0)