develooper Front page | perl.perl5.porters | Postings from November 2008

Re: 5.8.9/taint/NYTProf regression

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
November 28, 2008 13:47
Subject:
Re: 5.8.9/taint/NYTProf regression
Message ID:
20081128214724.GM49335@plum.flirble.org
On Fri, Nov 28, 2008 at 06:01:59PM +0000, Nicholas Clark wrote:
> As best I can tell, this is only with ithreads.
> 
> Vanilla 5.8.8 (or with most recent Time::HiRes from CPAN), NYTProf 2.07, or
> with most recent from svn:
> 
> $ ~/Sandpit/588ig/bin/perl5.8.8 -w -T -d:NYTProf -MTime::HiRes -e0

> No, I don't know why. Or, more importantly, what chain of events is causing
> PL_tainted to become set, and therefore what the cause is, and therefore

It's caused by this change:

http://public.activestate.com/cgi-bin/perlbrowse/p/28182

Specifically the integration of this:

Change 27176 by nicholas@nicholas-fangorn on 2006/02/13 21:46:13

	Ensure that public I, N and P flags are off when SvTAINT is called on
	something that already has taint magic.

Affected files ...

... //depot/perl/sv.c#1141 edit

Differences ...

==== //depot/perl/sv.c#1141 (text) ====

@@ -4242,8 +4242,13 @@
 	    /* sv_magic() refuses to add a magic of the same 'how' as an
 	       existing one
 	     */
-	    if (how == PERL_MAGIC_taint)
+	    if (how == PERL_MAGIC_taint) {
 		mg->mg_len |= 1;
+		/* Any scalar which already had taint magic on which someone
+		   (erroneously?) did SvIOK_on() or similar will now be
+		   incorrectly sporting public "OK" flags.  */
+		SvFLAGS(sv) &= ~(SVf_IOK|SVf_NOK|SVf_POK);
+	    }
 	    return;
 	}
     }


Curiously I can't get it to fail in maint-5.10. I thought that it should do.

Nicholas Clark

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