diff options
author | Hugo van der Sanden <hv@crypt.org> | 2000-10-10 15:10:20 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-10 13:16:27 +0000 |
commit | d0e9ca0c9778f73ab66adada9b844daa075eb55f (patch) | |
tree | e2701d1bbba5088556b63689d98537e660ce7aa7 | |
parent | 5cdeb5a29a7453773772178576a0bd0a29f82539 (diff) | |
download | perl-d0e9ca0c9778f73ab66adada9b844daa075eb55f.tar.gz |
Re: [ID 20001009.004] SEGV from sprintf in a thread
Message-Id: <200010101310.OAA00953@hugo.hybyte.com>
p4raw-id: //depot/perl@7186
-rwxr-xr-x | t/lib/thr5005.t | 17 | ||||
-rw-r--r-- | util.c | 2 |
2 files changed, 17 insertions, 2 deletions
diff --git a/t/lib/thr5005.t b/t/lib/thr5005.t index 057a08fe7d..680e1af3e7 100755 --- a/t/lib/thr5005.t +++ b/t/lib/thr5005.t @@ -13,7 +13,7 @@ BEGIN { $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; } $| = 1; -print "1..21\n"; +print "1..22\n"; use Thread 'yield'; print "ok 1\n"; @@ -89,6 +89,18 @@ my $long = "This is short."; my $longe = " short."; my $thr1 = new Thread \&threaded, $short, $shorte, "19"; my $thr2 = new Thread \&threaded, $long, $longe, "20"; +my $thr3 = new Thread \&testsprintf, "21"; + +sub testsprintf { + my $testno = shift; + # this may coredump if thread vars are not properly initialised + my $same = sprintf "%.0f", $testno; + if ($testno eq $same) { + print "ok $testno\n"; + } else { + print "not ok $testno\t# '$testno' ne '$same'\n"; + } +} sub threaded { my ($string, $string_end, $testno) = @_; @@ -115,4 +127,5 @@ EOT } $thr1->join; $thr2->join; -print "ok 21\n"; +$thr3->join; +print "ok 22\n"; @@ -3589,6 +3589,8 @@ Perl_new_struct_thread(pTHX_ struct perl_thread *t) PL_dirty = 0; PL_localizing = 0; Zero(&PL_hv_fetch_ent_mh, 1, HE); + PL_efloatbuf = (char*)NULL; + PL_efloatsize = 0; #else Zero(thr, 1, struct perl_thread); #endif |