From: Jarkko Hietaniemi Date: Tue, 16 Jan 2001 03:42:55 +0000 (+0000) Subject: Under 5.005 threads and debugging crashed in Debian 2.2 Linux/x86 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7d3de3d540c289e16b68f6cc341028f48c070231;p=p5sagit%2Fp5-mst-13.2.git Under 5.005 threads and debugging crashed in Debian 2.2 Linux/x86 at the setting of the ofs_sv in new_struct_thread() as the thr->Tofs_sv (PL_ofs_sv) was still 0xabab.... (this is what uninitialized fields are, uh, initialized with), SvREFCNT_inc()ing that invited a core dump. p4raw-id: //depot/perl@8449 --- diff --git a/util.c b/util.c index 27c6953..b163b05 100644 --- a/util.c +++ b/util.c @@ -3645,9 +3645,9 @@ Perl_new_struct_thread(pTHX_ struct perl_thread *t) PL_tainted = t->Ttainted; PL_curpm = t->Tcurpm; /* XXX No PMOP ref count */ PL_nrs = newSVsv(t->Tnrs); - PL_rs = SvREFCNT_inc(PL_nrs); + PL_rs = t->Tnrs ? SvREFCNT_inc(PL_nrs) : Nullsv; PL_last_in_gv = Nullgv; - PL_ofs_sv = SvREFCNT_inc(PL_ofs_sv); + PL_ofs_sv = t->Tofs_sv ? SvREFCNT_inc(PL_ofs_sv) : Nullsv; PL_defoutgv = (GV*)SvREFCNT_inc(t->Tdefoutgv); PL_chopset = t->Tchopset; PL_bodytarget = newSVsv(t->Tbodytarget);