Skip Menu |

This queue is for tickets about the forks CPAN distribution.

Report information
The Basics
Id: 39403
Status: resolved
Priority: 0/
Queue: forks

People
Owner: RYBSKEJ [...] cpan.org
Requestors: ANDK [...] cpan.org
Cc: perl5-porters [...] perl.org
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.27
Fixed in: (no value)



CC: perl5-porters [...] perl.org
Subject: maint-perl: 5.8.9-tobe breaks forks in patch 30039
In gerneral the forks distribution seems to need a bit of love, it has turns quite red in the testers matrix: http://bbbike.radzeit.de/~slaven/cpantestersmatrix.cgi?dist=forks In particular I discovered that since patch 30039 on the maintenance track to perrl 5.8.9 seems to fully stop passing the tests. 30039 is a concatenation of two earlier bleadperl patches: Change 30039 by nicholas@nicholas-saigo on 2007/01/27 18:27:17 Integrate: [ 28753] Subject: [PATCH] Don't promulgate Perl attributes From: "Jerry D. Hedden" <jdhedden@cpan.org> Date: Wed, 23 Aug 2006 10:07:05 -0700 Message-ID: <20060823100705.fb30e530d17747c2b054d625b8945d88.87c0ee9326.wbe@email.secureserver.net> [ 28756] Subject: [PATCH] RE: [perl #40227] 'reserved' warning not working From: "Jerry D. Hedden" <jdhedden@cpan.org> Date: Thu, 24 Aug 2006 09:04:12 -0700 Message-ID: <20060824090412.fb30e530d17747c2b054d625b8945d88.e8ae12ccab.wbe@email.secureserver.net> HTH, Regards, (Having not much hope that the CC gets through to P5P)
Next release of forks will include the same workaround for patch 30039 as already implemented for perl 5.9.x and later (5.10.x). I wish there were a more elegant way to hook into "reserved word" attributes, other than a source filter. Any suggestions would be appreciated. Used to be trivial to overload when the 'shared' attribute was passed in the handler chain.
Subject: Re: [rt.cpan.org #39403] maint-perl: 5.8.9-tobe breaks forks in patch 30039
Date: Wed, 1 Oct 2008 17:47:37 +0200
To: bug-forks [...] rt.cpan.org
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
At 11:43 AM -0400 10/1/08, Eric Rybski via RT wrote: Show quoted text
> Queue: forks > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=39403 > > >Next release of forks will include the same workaround for patch >30039 as already >implemented for perl 5.9.x and later (5.10.x). > >I wish there were a more elegant way to hook into "reserved word" >attributes, other than a >source filter. Any suggestions would be appreciated. Used to be >trivial to overload when the >'shared' attribute was passed in the handler chain.
Please note that if forks starts to depend on source filters, any mod_perl application would become impossible. Liz
I was able to implement an alternative solution using external hooks (overloaded function calls) into Perl's attribute.pm and CPAN Attribute::Handler. This solution is much better than a source filter (and eliminates the requirement for one going forward with perl > 5.8.8), but still feels like a somewhat clunky solution. Having an interface to overload built-in attributes, like 'shared', would be best, if available. This change will be included in the next CPAN release.
CC: ANDK [...] cpan.org, perl5-porters [...] perl.org
Subject: Re: [rt.cpan.org #39403] maint-perl: 5.8.9-tobe breaks forks in patch 30039
Date: Thu, 2 Oct 2008 14:41:37 +0100
To: Eric Rybski via RT <bug-forks [...] rt.cpan.org>
From: Nicholas Clark <nick [...] ccl4.org>
On Wed, Oct 01, 2008 at 11:37:57AM -0400, Eric Rybski via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=39403 > > > Next release of forks will include the same workaround for patch 30039 as already > implemented for perl 5.9.x and later (5.10.x). > > I wish there were a more elegant way to hook into "reserved word" attributes, other than a > source filter. Any suggestions would be appreciated. Used to be trivial to overload when the > 'shared' attribute was passed in the handler chain.
The bug report on rt.cpan.org references CPAN testers, and in turn that contains fail reports, but I don't find any actual description of what the cause is, or why. So it's not clear to me - is this a legitimate bug fix, which fixes a bug that code happened to be relying on? Or is it actually a bad idea? Nicholas Clark
In a nutshell, the forks pragma is a drop-in replacement for ithreads, useful primarily for non-threaded perl builds (including Perl 5.6.x) or for scripts that wish to use ithreads but have memory growth/leak issues when using CPAN modules with native ithreads. To accomplish this, one of the features it must support is the 'shared' attribute to emulate threads::shared variable declaration behavior. Attribute declaration is currently handled using CPAN Attribute::Handlers, which in turn depends on Perl core distribution attribute.pm. The issue is that there was a small bug since perl 5.8.0 that allowed the otherwise reserved 'shared' attribute name to "leak" out to custom attribute handlers, as described here: http://www.nntp.perl.org/group/perl.perl5.porters/2006/08/msg115950.html The core patch, already included in Perl 5.10.0, is referenced here: http://archives.devshed.com/forums/perl-102/change-28753-don-t-promulgate-perl- attributes-1951997.html This behavior change "broke" the CPAN forks::shared module on perl 5.10.0 and now also Perl 5.8.8 patched maintenance builds that include this patch (I assume intended to be included in Perl 5.8.9). The initial workaround was to use a source filter to re-write all '$var : shared' as '$var : Forks_shared', such that the attribute could be trapped by a custom attribute handler. Due to the usual dangers & limitations associations with source filters, I've recently rewritten this (not yet released) to override the internal function that Perl depends on to handle reserved attribute names, like the following: { my $old = \&attributes::_modify_attrs; no warnings 'redefine'; *attributes::_modify_attrs = sub { my ($ref, @attr) = @_; return ($old->(@_), (grep(/^shared$/o, @attr) ? 'Forks_shared' : ())); }; } Personally, I wish there were an interface to override the now trapped 'shared' attribute, like what has been available in Perl 5.6 & 5.8. Perhaps some sort of boolean flag interface in attribute.pm, like: attributes::configure(&attributes::ALLOW_RESERVED_ATTR || &attributes::NO_RESERVED_ATTR_WARNINGS) that allows reserved attributes to be returned to custom handlers (and also prevents them from throwing spurious usage warnings throughout user code when use warnings 'reserved' or $^W==1). Regards, Eric On Thu Oct 02 09:41:54 2008, nick@ccl4.org wrote: Show quoted text
> On Wed, Oct 01, 2008 at 11:37:57AM -0400, Eric Rybski via RT wrote:
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=39403 > > > > > Next release of forks will include the same workaround for patch
> 30039 as already
> > implemented for perl 5.9.x and later (5.10.x). > > > > I wish there were a more elegant way to hook into "reserved word"
> attributes, other than a
> > source filter. Any suggestions would be appreciated. Used to be
> trivial to overload when the
> > 'shared' attribute was passed in the handler chain.
> > The bug report on rt.cpan.org references CPAN testers, and in turn > that > contains fail reports, but I don't find any actual description of what > the > cause is, or why. > > So it's not clear to me - is this a legitimate bug fix, which fixes a > bug > that code happened to be relying on? Or is it actually a bad idea? > > Nicholas Clark
Issue is resolved in 0.28 release.