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

Re: require patch breaks locale

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
November 22, 2003 14:49
Subject:
Re: require patch breaks locale
Message ID:
20031122224919.GP11153@plum.flirble.org
On Wed, Oct 08, 2003 at 10:41:55PM -0400, Rick Delaney wrote:
> On Wed, Oct 08, 2003 at 10:31:01AM +0530, Abhijit Menon-Sen wrote:
> > At 2003-10-07 12:51:51 +0200, h.m.brand@hccnet.nl wrote:
> > >
> > > linux       [locale:en_US]-DDEBUGGING -Accflags='-DPERL_COPY_ON_WRITE'
                                                         ^^^^^^^^^^^^^^^^^^
> > >     ../lib/locale.t.........................FAILED 99-117
> > >     ../t/comp/require.t.....................FAILED 28-41
> > 
> > I can't reproduce these failures. Could someone else please investigate?
> 
> I can't reproduce them either but try the following for require.t since
> I overlooked that.  Is there any advantage to making these "skip tests"?
> 
> I looked at locale.t and it similarly bails after test 98 if $have_setlocale 
> is false but I can't see any connection to the require patch.  It would
> be nice to see the output of the test itself.

I think that the locale.t failure is due to a known bug with copy on write,
which is best summarised as:

perl -C8 -e '${^OPEN} =~ /(:utf8)/'
Assertion ((sstr)->sv_flags & 0x00040000) failed: file "sv.c", line 4202 at -e line 1.


Finally, I think I have found the cause. Hopefully change 21774 fixes it.

Nicholas Clark

Change 21774 by nicholas@entropy on 2003/11/22 21:21:22

        restore_magic needs to undo COW
        (while magic was off, sv_setsv is likely to have seen this SV as a
        good source for COW)
        Should fix the smoke failures on lib/locale.t

Affected files ...

... //depot/perl/mg.c#283 edit

Differences ...

==== //depot/perl/mg.c#283 (text) ====

@@ -2583,6 +2583,13 @@
 
     if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv))
     {
+#ifdef PERL_COPY_ON_WRITE
+       /* While magic was saved (and off) sv_setsv may well have seen
+          this SV as a prime candidate for COW.  */
+       if (SvIsCOW(sv))
+           sv_force_normal(sv);
+#endif
+
        if (mgs->mgs_flags)
            SvFLAGS(sv) |= mgs->mgs_flags;
        else

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