From: Devin Heitmueller Date: Tue, 20 Feb 2007 16:38:20 +0000 (-0800) Subject: [perl #41560] [PATCH] crash in Perl_vmess when GvIOp is null X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=191f87d57c0c1de37eade12374d34b5d6bd6302a;p=p5sagit%2Fp5-mst-13.2.git [perl #41560] [PATCH] crash in Perl_vmess when GvIOp is null From: "Devin Heitmueller" (via RT) Message-ID: p4raw-id: //depot/perl@30398 --- diff --git a/util.c b/util.c index 3c55183..c2870ea 100644 --- a/util.c +++ b/util.c @@ -1154,7 +1154,10 @@ Perl_vmess(pTHX_ const char *pat, va_list *args) if (CopLINE(cop)) Perl_sv_catpvf(aTHX_ sv, " at %s line %"IVdf, OutCopFILE(cop), (IV)CopLINE(cop)); - if (GvIO(PL_last_in_gv) && IoLINES(GvIOp(PL_last_in_gv))) { + /* Seems that GvIO() can be untrustworthy during global destruction. */ + if (GvIO(PL_last_in_gv) && (SvTYPE(GvIOp(PL_last_in_gv)) == SVt_PVIO) + && IoLINES(GvIOp(PL_last_in_gv))) + { const bool line_mode = (RsSIMPLE(PL_rs) && SvCUR(PL_rs) == 1 && *SvPVX_const(PL_rs) == '\n'); Perl_sv_catpvf(aTHX_ sv, ", <%s> %s %"IVdf,