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

Re: [perl #22194] perldoc -q permute example using faster Algorithm::Permute panic's

Thread Previous | Thread Next
From:
David Dyck
Date:
May 16, 2003 06:55
Subject:
Re: [perl #22194] perldoc -q permute example using faster Algorithm::Permute panic's
Message ID:
Pine.LNX.4.51.0305160649250.23593@dd.tc.fluke.com
thanks Edwin.

Your changes work for me!

I guess this wasn't really a bug in perl5.9 right?
(the .xs code was affected by changes that were implemented in 5.9 though)

Where are these kind of design changes documented in the perl documenation?
Will any other CPAN .xs code get bitten by these changes?


On Fri, 16 May 2003 at 16:01 +0700, Edwin Pratomo <edwin@poskanzer.org> wrote:

> problem fixed. see version 0.05 on CPAN.
>
> rgds,
> Edwin.
>
> On Wednesday 14 May 2003 19:34, Dave Mitchell wrote:
> > On Wed, May 14, 2003 at 03:46:01AM -0700, David Dyck wrote:
> > > On Wed, 14 May 2003 at 12:23 +0200, Andreas J. Koenig
> <andreas.koenig@anima...:
> > > > panic: invalid pad in pad_sv: 0x816ccb0[0x817a6e8] at test.pl line 51.
> > >
> > > The above panic is why I turned to p5p, but I see that it could
> > > be just because I have DEBUGGING on and the new macro
> > >   ASSERT_CURPAD_ACTIVE
> > > began checking the condition at that time.
> > > I haven't tried building withoug DEBUGGING turned on yet.
> >
> > The panic means that something has gone very wrong, either with perl or
> > the xs, and that at a point where there must be an active pad, there
> > isn't one. Turning of DEBUGGING just masks the problem.
> >
> > A quick look at Permute.xs shows that it is directly manipulating
> > pads, ie
> >
> >     SAVESPTR(PL_curpad);
> >     PL_curpad = AvARRAY((AV*)AvARRAY(CvPADLIST(callback))[1]);
> >
> > which is just plain wrong in bleedperl. In fact the code seems to use
> > a lot of core features that aren't part of the API, and is therefore
> > a condidate for breakage on each new release of Perl (it manipulates ops,
> > it diddles directlty with xav_array, it messes with the context stack
> > etc).
> >
> > I haven't looked closely enough at the code to see how it needs to be
> > fixed.
> >
> > Dave.
>

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