develooper Front page | perl.perl5.porters | Postings from August 2016

Re: [perl #129038] Assertion Failure: *Perl_pp_subst *pp_hot.c:3203)

Thread Previous | Thread Next
Karl Williamson
August 24, 2016 16:08
Re: [perl #129038] Assertion Failure: *Perl_pp_subst *pp_hot.c:3203)
Message ID:
On 08/24/2016 08:28 AM, Dave Mitchell wrote:
> On Sun, Aug 21, 2016 at 05:27:55PM -0700, Father Chrysostomos via RT wrote:
>> On Sun Aug 21 15:20:17 2016, wrote:
>>> The attached script triggers an assertion failure in v5.25.5 (v5.25.4-
>>> 5-g92d73bf).
>>> ./perl test610
>>> perl: pp_hot.c:3203: OP *Perl_pp_subst(): Assertion `strend >= s'
>>> failed.
>>> Aborted
>> Some locale bug, apparently:
>> $ ./miniperl -e '$_="\xff"; s/\w//l'
>> Assertion failed: (strend >= s), function Perl_pp_subst, file pp_hot.c, line 3203.
> The problem is this in S_regmatch:
>         case POSIXL:    /* \w or [:punct:] etc. under /l */
>             ...
>             /* Here, must be utf8 */
>             locinput += UTF8SKIP(locinput);
>             break;
> AFAIKT, assuming at that point that the string is utf8, is incorrect.
> Karl, this bit of code was was last touched by you, fancy having a look?

Well, it's just plain bad logic, apparently on my part.  But, I'm not 
going to bother to do archeology to see how it got that way.

But in examining things, I do have a concern.  Dave added a 
'increment_locinput:' label in S_regmatch() in 28b98f76, but many of the 
cases bypass that.  The code at that label allows the input to go one 
off the end.  I'm wondering if more of the cases should goto that label 
instead of incrementing locinput themselves and doing a 'break'.  I have 
some vague recollection around when one was supposed to do that, but I 
would have made it a comment so it would be plain, and I don't see any 
such comment.  It might have been a different function().

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About