Change 25477 by [EMAIL PROTECTED] on 2005/09/18 22:57:20
Integrate:
[ 21009]
Subject: Re: [EMAIL PROTECTED] or before broke mp2 ithreads test
From: "Marcus Holland-Moritz" <[EMAIL PROTECTED]>
Date: Wed, 3 Sep 2003 06:07:54 +0200
Message-ID: <[EMAIL PROTECTED]>
[ 24451]
SvUPGRADE doesn't return false.
[ 24455]
make join.t threadsafe!
tests 13 and 14 could output in reverse order. Add a lock to stop
this.
[ 24469]
avoid leaked scalar in BEGIN { threads->new(...) }
[ 24475]
$! might contain "unknown" if strerror(3) says so
Affected files ...
... //depot/maint-5.8/perl/ext/threads/t/join.t#18 edit
... //depot/maint-5.8/perl/sv.c#154 integrate
... //depot/maint-5.8/perl/t/op/mkdir.t#6 integrate
... //depot/maint-5.8/perl/toke.c#76 integrate
Differences ...
==== //depot/maint-5.8/perl/ext/threads/t/join.t#18 (text) ====
Index: perl/ext/threads/t/join.t
--- perl/ext/threads/t/join.t#17~23463~ Mon Nov 1 07:28:24 2004
+++ perl/ext/threads/t/join.t Sun Sep 18 15:57:20 2005
@@ -14,7 +14,7 @@
use ExtUtils::testlib;
use strict;
-BEGIN { print "1..12\n" };
+BEGIN { print "1..14\n" };
use threads;
use threads::shared;
@@ -25,6 +25,8 @@
sub ok {
my ($ok, $name) = @_;
+ lock $test_id; # make print and increment atomic
+
# You have to do it this way or VMS will get confused.
print $ok ? "ok $test_id - $name\n" : "not ok $test_id - $name\n";
@@ -144,4 +146,11 @@
ok($ok, "Double join works");
}
-
+{
+ # The "use IO" is not actually used for anything; its only purpose is to
+ # incite a lot of calls to newCONSTSUB. See the p5p archives for
+ # the thread "[EMAIL PROTECTED] or before broke mp2 ithreads test".
+ use IO;
+ # this coredumped between #20930 and #21000
+ $_->join for map threads->new(sub{ok($_, "stress newCONSTSUB")}), 1..2;
+}
==== //depot/maint-5.8/perl/sv.c#154 (text) ====
Index: perl/sv.c
--- perl/sv.c#153~25473~ Sun Sep 18 09:12:05 2005
+++ perl/sv.c Sun Sep 18 15:57:20 2005
@@ -11678,6 +11678,12 @@
SvREFCNT_dec(param->stashes);
+ /* orphaned? eg threads->new inside BEGIN or use */
+ if (PL_compcv && ! SvREFCNT(PL_compcv)) {
+ SvREFCNT_inc(PL_compcv);
+ SAVEFREESV(PL_compcv);
+ }
+
return my_perl;
}
==== //depot/maint-5.8/perl/t/op/mkdir.t#6 (xtext) ====
Index: perl/t/op/mkdir.t
--- perl/t/op/mkdir.t#5~25407~ Tue Sep 13 14:31:42 2005
+++ perl/t/op/mkdir.t Sun Sep 18 15:57:20 2005
@@ -17,11 +17,11 @@
ok(mkdir('blurfl',0777));
ok(!mkdir('blurfl',0777));
-like($!, qr/cannot move|exist|denied/);
+like($!, qr/cannot move|exist|denied|unknown/i);
ok(-d 'blurfl');
ok(rmdir('blurfl'));
ok(!rmdir('blurfl'));
-like($!, qr/cannot find|such|exist|not found|not a directory/i);
+like($!, qr/cannot find|such|exist|not found|not a directory|unknown/i);
ok(mkdir('blurfl'));
ok(rmdir('blurfl'));
==== //depot/maint-5.8/perl/toke.c#76 (text) ====
Index: perl/toke.c
--- perl/toke.c#75~25472~ Sun Sep 18 08:52:39 2005
+++ perl/toke.c Sun Sep 18 15:57:20 2005
@@ -2135,8 +2135,7 @@
PL_rsfp_filters = newAV();
if (!datasv)
datasv = NEWSV(255,0);
- if (!SvUPGRADE(datasv, SVt_PVIO))
- Perl_die(aTHX_ "Can't upgrade filter_add data to SVt_PVIO");
+ (void)SvUPGRADE(datasv, SVt_PVIO);
u.filter = funcp;
IoANY(datasv) = u.iop; /* stash funcp into spare field */
IoFLAGS(datasv) |= IOf_FAKE_DIRP;
End of Patch.