summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-12-31 12:07:37 +0000
committerNicholas Clark <nick@ccl4.org>2006-12-31 12:07:37 +0000
commitdb4997f00d6b1ad267e4fec6a272e72e29719dd1 (patch)
tree9b20cf182c515f776a2512797f6b6f5a5b670b78 /t
parent1cb9cd5016282146cd55ab904078500def5f5754 (diff)
downloadperl-db4997f00d6b1ad267e4fec6a272e72e29719dd1.tar.gz
PL_linestr needs to survive until the end of scope, not just the next
FREETMPS. Fixes the underlying cause of the thread cloning SEGV reported in http://www.nntp.perl.org/group/perl.perl5.porters/63123 p4raw-id: //depot/perl@29643
Diffstat (limited to 't')
-rw-r--r--t/op/threads.t9
-rw-r--r--t/op/threads_create.pl2
2 files changed, 10 insertions, 1 deletions
diff --git a/t/op/threads.t b/t/op/threads.t
index f699fc26df..165c542bc0 100644
--- a/t/op/threads.t
+++ b/t/op/threads.t
@@ -18,7 +18,7 @@ BEGIN {
print "1..0 # Skip: no dynamic loading on miniperl, no threads\n";
exit 0;
}
- plan(5);
+ plan(6);
}
use threads;
@@ -106,3 +106,10 @@ $SIG{__WARN__} = sub{};
async sub {};
print "ok";
EOI
+
+# From a test case by Tim Bunce in
+# http://www.nntp.perl.org/group/perl.perl5.porters/63123
+fresh_perl_is(<<'EOI', 'ok', { }, 'Ensure PL_linestr can be cloned');
+use threads;
+print do 'op/threads_create.pl';
+EOI
diff --git a/t/op/threads_create.pl b/t/op/threads_create.pl
new file mode 100644
index 0000000000..34251632cf
--- /dev/null
+++ b/t/op/threads_create.pl
@@ -0,0 +1,2 @@
+threads->create( sub { } )->join;
+"ok\n";