Bug#853091: perl: Dying when matching simple regex: Malformed UTF-8 character fatal

Leszek Dubiel leszek.dubiel at dubielvitrum.pl
Sun Jan 29 21:21:45 UTC 2017


> This still happens with 5.24.1-1. It can be reduced to
>
>   printf "\x9c\x5a" | perl -CI -ne '/[^#]*/'
>
> The byte sequence is indeed invalid utf8 (as shown by iconv as well),
> but you're explicitly telling Perl (with -CS) that it's getting utf8 on
> stdin. This is a recipe for problems.
>
> So I'm not sure if it's a bug at all. At most the failure should be
> handled a bit more gracefully.

This should be warning, warning programmer could turn off. It's very 
rare that perl just dies because data it handles is not as expected.
Wrong data? Ok, fine, warn, and go on processing.

Strange is that /[^#]*/ dies, while /(.*)/ doesn't == in both cases data 
is the same, data is wrong. Sometimes perl dies, sometimes not.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/perl-maintainers/attachments/20170129/623a90a8/attachment.html>


More information about the Perl-maintainers mailing list