develooper Front page | perl.perl5.porters | Postings from April 2003

Re: [perl #21347] segfault in UNIVERSAL::AUTOLOAD

Thread Previous | Thread Next
From:
Enache Adrian
Date:
April 19, 2003 16:45
Subject:
Re: [perl #21347] segfault in UNIVERSAL::AUTOLOAD
Message ID:
20030419234548.GA849@ratsnest.hole
On Sat, Apr 19, 2003 at 10:58:08PM +0200, Rafael Garcia-Suarez wrote:
> Er, you fix doesn't work for me, or at least it ceased to work,
> since I remember it worked.
> 
> That would be this test :
> 
> > +runperl(prog => 'sub UNIVERSAL::DESTROY { warn } bless \$a, A', stderr => 1);
> > +ok ($? == 0, 'warn called inside UNIVERSAL::DESTROY { }');
> 
> -- 
> Undermines is not *NIX

please try this:
(to be put instead of the util.c hunk in
 http://nntp.perl.org/group/perl.perl5.porters/73117)

--- /arc/bleadperl/util.c	2003-04-17 00:25:37.000000000 +0300
+++ bleadperl/util.c	2003-04-20 02:25:34.000000000 +0300
@@ -1247,7 +1247,7 @@ Perl_vwarn(pTHX_ const char* pat, va_lis
     }
 
     /* if STDERR is tied, use it instead */
-    if (PL_stderrgv && (io = GvIOp(PL_stderrgv))
+    if (PL_stderrgv && SvREFCNT(PL_stderrgv) && (io = GvIO(PL_stderrgv))
 	&& (mg = SvTIED_mg((SV*)io, PERL_MAGIC_tiedscalar))) {
 	dSP; ENTER;
 	PUSHMARK(SP);

Now the SvREFCNT() doesn't seem to be needed any more - but I positively
remeber that then, in the dark past, trying just GvIO was still dumping
core. The final cleanups are moving sands anyway ...

Regards
Adi

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About