develooper Front page | perl.perl5.porters | Postings from July 2013

[perl #76538] Assertion failed: (rx->sublen >= (s - rx->subbeg) + i), function Perl_reg_numbered_buff_fetch

Thread Next
From:
Karl Williamson via RT
Date:
July 25, 2013 01:38
Subject:
[perl #76538] Assertion failed: (rx->sublen >= (s - rx->subbeg) + i), function Perl_reg_numbered_buff_fetch
Message ID:
rt-3.6.HEAD-2552-1374716268-840.76538-15-0@perl.org
On Wed Jan 30 19:43:51 2013, public@khwilliamson.com wrote:
> On 01/29/2013 10:14 AM, Dave Mitchell wrote:
> > On Sun, Jan 27, 2013 at 10:11:20AM -0800, Karl Williamson via RT
> wrote:
> >> The code I first read in regexec.c that loads swashes is in
> >> regclass_swash().  It doesn't do a save_re_context().  It never
> occurred
> >> to me to wonder why that was ok, but in other places,
> save_re_context()
> >> was required.  Looking now, the commit message from Larry, from
> 1998
> >> adding regclass_swash, is unhelpful to me.  The comments say
> basically,
> >> only that it is a total kludge.  If someone would enlighten me as
> to why
> >> this is needed in some places, and not needed when in
> regclass_swash(),
> >> I would be grateful.
> >
> > I can't answer your direct question, but I'll just make a general
> > observation.
> >
> > Originally the regex engine stored all its internal state in global
> > variables. Over the years as the engine got more complex, and things
> like
> > (??{...}) and dynamically loadable swashes were added, it needed to
> become
> > re-entrant, and assorted ad-hoc 'save current regex state' bits of
> code
> > were added, in a hacky and inconsistent way. It's my long term goal
> to make
> > all state local, and so eliminate the need to save state; but until
> then
> > we're stuck with it.
> >
> > Cargo-culting what's already there will probably be buggy, but no
> more
> > buggy than anything else.
> >
> 
> 
> This explains a lot.  It turns out however, that the code in utf8.c
> that
> loads in a swash does a save_re_context().  So the ones in regexec.c
> are
> extraneous; perhaps doing it twice has negative consequences, and
> could
> explain some bugs.
> 

Now that save_re_context() is gone, can we close this ticket?
-- 
Karl Williamson

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=76538

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