In perl.git, the branch sprout/rocoy has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/080dc6b45f1449e70629d54dd2587ee345613271?hp=f76fe341f653b39a1d2b27d2b9ef4925f2d241bc>

- Log -----------------------------------------------------------------
commit 080dc6b45f1449e70629d54dd2587ee345613271
Author: Father Chrysostomos <[email protected]>
Date:   Fri Jan 3 05:58:22 2014 -0800

    Skip t/re/uniprops.t under PERL_DEBUG_READONLY_COW
    
    Under Linux, using mmap for all memory allocation stops working when we
    get up to 70,000 lines of code.  So just skip it.

M       t/re/uniprops.t

commit 0b22cc52b0fffff8b7ef82d31dedc309aa63a233
Author: Father Chrysostomos <[email protected]>
Date:   Fri Jan 3 05:57:06 2014 -0800

    Make PERL_DEBUG_READONLY_COW and TRACK_MEMPOOL compatible
    
    They both have headers at the beginning of the allocated memory.
    PERL_TRACK_MEMPOOL is unique, in that it tries to free a pointer,
    based not on what safesysmalloc returned, but on what it stored in
    its own header.  So it needs to know about the extra COW header
    when using pointer arithmetic to determine the pointer to pass
    to safesysfree.

M       perl.c

commit dab0f5cb99a7ddef03b63bb7f10614cbcde9281a
Author: Father Chrysostomos <[email protected]>
Date:   Thu Jan 2 12:39:05 2014 -0800

    SvGROW should un-cow under PERL_OLD_COPY_ON_WRITE
    
    Otherwise pp_uc (and presumably other pieces of code) will end up mod-
    ifying shared buffers.
    
    Brought to you by PERL_DEBUG_READONLY_COW.

M       sv.h

commit 5e2faf8b876494119a7f84e346aa19231cefc377
Author: Father Chrysostomos <[email protected]>
Date:   Sun Dec 29 16:47:43 2013 -0800

    perldiag for new mprotect warnings

M       pod/perldiag.pod

commit 55c740e1b85def48b3de454ca628378a0bfb6ff5
Author: Father Chrysostomos <[email protected]>
Date:   Sun Dec 29 16:39:36 2013 -0800

    Teach podcheck about mmap(2)

M       t/porting/known_pod_issues.dat
-----------------------------------------------------------------------

Summary of changes:
 perl.c                         |  6 +++++-
 pod/perldiag.pod               | 19 +++++++++++++++++--
 sv.h                           |  2 +-
 t/porting/known_pod_issues.dat |  1 +
 t/re/uniprops.t                | 15 +++++++++++++--
 5 files changed, 37 insertions(+), 6 deletions(-)

diff --git a/perl.c b/perl.c
index 8271915..7a13310 100644
--- a/perl.c
+++ b/perl.c
@@ -1349,7 +1349,11 @@ perl_free(pTHXx)
                PL_debug &= ~ DEBUG_m_FLAG;
            }
            while(aTHXx->Imemory_debug_header.next != 
&(aTHXx->Imemory_debug_header))
-               safesysfree(sTHX + (char *)(aTHXx->Imemory_debug_header.next));
+               safesysfree(sTHX + (char *)(aTHXx->Imemory_debug_header.next)
+# ifdef PERL_DEBUG_READONLY_COW
+                               + sizeof(IV)
+# endif
+               );
            PL_debug = old_debug;
        }
     }
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 0b3c096..f03e69d 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -3117,13 +3117,28 @@ can happen if you are trying to open a pipe to a 
command that takes a
 list of arguments, but have forgotten to specify a piped open mode.
 See L<perlfunc/open> for details.
 
+=item mprotect for COW string %p %u failed with %d
+
+(S) You compiled perl with B<-D>PERL_DEBUG_READONLY_COW (see
+L<perlguts/"Copy on Write">), but a shared string buffer
+could not be made read-only.
+
 =item mprotect for %p %u failed with %d
 
+(S) You compiled perl with B<-D>PERL_DEBUG_READONLY_OPS (see L<perlhacktips>),
+but an op tree could not be made read-only.
+
+=item mprotect RW for COW string %p %u failed with %d
+
+(S) You compiled perl with B<-D>PERL_DEBUG_READONLY_COW (see
+L<perlguts/"Copy on Write">), but a read-only shared string
+buffer could not be made mutable.
+
 =item mprotect RW for %p %u failed with %d
 
 (S) You compiled perl with B<-D>PERL_DEBUG_READONLY_OPS (see
-L<perlhacktips>), but an op tree could not be made read-only, or a
-read-only op tree could not be made mutable before freeing the ops.
+L<perlhacktips>), but a read-only op tree could not be made
+mutable before freeing the ops.
 
 =item msg%s not implemented
 
diff --git a/sv.h b/sv.h
index bb9e6b0..7267af1 100644
--- a/sv.h
+++ b/sv.h
@@ -2135,7 +2135,7 @@ See also C<PL_sv_yes> and C<PL_sv_no>.
         == (SVt_PVLV|SVf_FAKE))
 
 
-#ifdef PERL_NEW_COPY_ON_WRITE
+#ifdef PERL_ANY_COW
 # define SvGROW(sv,len) \
        (SvIsCOW(sv) || SvLEN(sv) < (len) ? sv_grow(sv,len) : SvPVX(sv))
 #else
diff --git a/t/porting/known_pod_issues.dat b/t/porting/known_pod_issues.dat
index a40c13d..0594e63 100644
--- a/t/porting/known_pod_issues.dat
+++ b/t/porting/known_pod_issues.dat
@@ -96,6 +96,7 @@ Math::Random::MT::Perl
 Math::Random::Secure
 Math::TrulyRandom
 md5sum(1)
+mmap(2)
 Module::CPANTS::Analyse
 Module::Find
 Module::Info
diff --git a/t/re/uniprops.t b/t/re/uniprops.t
index fea734d..19f011b 100644
--- a/t/re/uniprops.t
+++ b/t/re/uniprops.t
@@ -1,8 +1,19 @@
 use strict;
 use warnings;
+no warnings 'once';
 
-# This is just a wrapper for a generated file.  Assumes being run from 't'
-# directory
+# This is a wrapper for a generated file.  Assumes being run from 't'
+# directory.
+
+# It is skipped by default under PERL_DEBUG_READONLY_COW, but you can run
+# it directly via:  cd t; ./perl ../lib/unicore/TestProp.pl
+
+@INC = '../lib';
+require Config;
+if ($Config::Config{ccflags} =~ /(?:^|\s)-DPERL_DEBUG_READONLY_COW\b/) {
+    print "1..0 # Skip PERL_DEBUG_READONLY_COW\n";
+    exit;
+}
 
 do '../lib/unicore/TestProp.pl';
 

--
Perl5 Master Repository

Reply via email to