develooper Front page | perl.perl5.porters | Postings from December 2012

Re: [perl #115910] New copy-on-write breaks CPAN

From:
Nicholas Clark
Date:
December 20, 2012 12:12
Subject:
Re: [perl #115910] New copy-on-write breaks CPAN
Message ID:
20121220121205.GT5653@plum.flirble.org
On Wed, Dec 19, 2012 at 10:06:04PM +0100, Leon Timmermans wrote:
> On Wed, Dec 19, 2012 at 2:55 PM, Father Chrysostomos via RT
> <perlbug-comment@perl.org> wrote:
> > That logic probably needs to be revisited then.  Is the s/// target a
> > COW before the substitution?  (You don???t need to CC me.)
> 
> No, it's a SvLEN == 0 string, with set magic as fallback to ensure the
> SvPVX keeps pointing into the memory map. The fallback however is
> wildly inefficient as it needs to copy the copy, hence the warning.
> It's there to prevent data-loss and segfaults, not to be used
> intentionally.

SvLEN == 0 has a historical established meaning of "the core doesn't own
this buffer". If COW were disabled for all PVs with SvLEN == 0, does this
solve the issues in more than just this module?

Nicholas Clark



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