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

[perl #131642] regcomp.c:18417: voidS_skip_to_be_ignored_text(RExC_state_t *, char **, const _Bool): Assertion `!UTF || UTF8_IS_INVARIANT(**p) || UTF8_IS_START(**p)' failed.

From:
Karl Williamson via RT
Date:
July 2, 2018 18:04
Subject:
[perl #131642] regcomp.c:18417: voidS_skip_to_be_ignored_text(RExC_state_t *, char **, const _Bool): Assertion `!UTF || UTF8_IS_INVARIANT(**p) || UTF8_IS_START(**p)' failed.
Message ID:
rt-4.0.24-12692-1530554695-1438.131642-15-0@perl.org
On Mon, 02 Apr 2018 12:28:46 -0700, xsawyerx@gmail.com wrote:
> 
> 
> On 04/02/2018 04:16 AM, Father Chrysostomos via RT wrote:
> > On Sun, 01 Apr 2018 17:13:52 -0700, khw wrote:
> >> It seems to me that the right fix to this is to forbid pack from
> >> returning malformed UTF-8.  When I change it to do that, various
> >> tests
> >> in our suite fail.  All these look to be deliberate attempts to
> >> generate malformed UTF-8, and testing how this is handled, and they
> >> use pack to do that generating.
> >>
> >> So, it's been known that you can use pack for this, and people have
> >> taken advantage of it.  No /cpan tests rely on this.  But I think
> >> we've gotten wise over the years about the perils of malformed UTF-
> >> 8,
> >> and I think this is one that should be fixed.
> > I too agree that it should be fixed.
> >
> >> I don't know if it is too late in the 5.28 development cycle to do
> >> so,
> >> however.  But another way of looking at it, it is just in time to
> >> fix
> >> bugs that would otherwise occur in 5.28
> > I’m a little wary of doing it this close to a stable release if it’s
> > possible people are relying on it.
> 
> Agreed. I would rather we save it for 5.29.


I'm not sure what the best approach is.  Attached is a patch that just croaks when the returned SV is UTF-8 and malformed.  Another option would be to just turn off the UTF-8 flag.  Should this use be deprecated instead?
-- 
Karl Williamson

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



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