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

Re: [PATCH] Re: [perl #24704] Regex replace looses chars

From:
Marty Pauley
Date:
December 21, 2003 15:40
Subject:
Re: [PATCH] Re: [perl #24704] Regex replace looses chars
Message ID:
20031221234010.GI31758@soto.kasei.com
On Sun Dec 21 22:57:34 2003, Nicholas Clark wrote:
> On Sun, Dec 21, 2003 at 10:39:50PM +0000, Marty Pauley wrote:
> > If you're feeling paranoid, a safer place to unOOK is much closer to the
> > start of pp_subst, just before we take the first pointer to the inside
> > of the PV.
> 
> What do I do if I'm feeling really paranoid, and wondering if there are a
> whole class of bugs like these?

I think there might be a few more like this.  We could also get similar
problems when we grow the sv and cause the pv to change altogether.  We
should get a segmentation fault in that case.

The thing that worried me the most about this one was that there were
cases that hit the bug but still 'worked': when the offset was larger
than the remainder of the string, the move wouldn't overwrite the old
part of the string.

> [taking pointers to the insides of SVs that are then moved around because
> of upgrading. Hack the core to create all scalars as OOK, and see which
> tests fail?]

That might be a good start. :-)

If we had a version of Move that filled the source with rubbish, we
might be able to find some more bugs.  And if we changed sv_backoff and
sv_grow to release memory when they could, we might get some nice
segmentation faults to indicate bugs.

-- 
Marty



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