Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^5: erroneous warning involving locale and input encoding: perl bug?

by dave_the_m (Prior)
on Apr 18, 2017 at 08:58 UTC ( #1188207=note: print w/replies, xml ) Need Help??


in reply to Re^4: erroneous warning involving locale and input encoding: perl bug?
in thread erroneous warning involving locale and input encoding: perl bug?

The fault can be reduced to the following:
use experimental 'smartmatch'; use POSIX 'locale_h'; use locale ':ctype'; setlocale(LC_CTYPE, 'en_US'); $_ = "x"; utf8::upgrade($_); /x(y|z)?/;
which gives an assert failure on bleadperl. The locale-variant of the TRIE code in the regex engine appears to be treating the 'no more chars' special value of nextchr (-10) as a real large utf8 character:
&& UTF8_IS_ABOVE_LATIN1(nextchr)
By all means perlbug it

Dave.

Replies are listed 'Best First'.
Re^6: erroneous warning involving locale and input encoding: perl bug?
by raygun (Beadle) on Apr 18, 2017 at 21:44 UTC
    Thanks, Dave, for the detective work! I confirm that your example produces the warning on v5.22.2 as well. (I'm not quite sure from your description whether the failure method on bleadperl is the same as that on v5.22.2. An assert is a fatal error (in C, anyway), whereas the message I'm seeing does not halt execution; if I add another statement after the end of your code sample, it does get executed.)

    I'm happy to submit a bug report, but since you know much more about what's going on under the hood, you're probably a better contact person. If you don't have the time or inclination, however, I'll do it.

Re^6: erroneous warning involving locale and input encoding: perl bug?
by raygun (Beadle) on Apr 22, 2017 at 00:43 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1188207]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2018-07-20 20:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (441 votes). Check out past polls.

    Notices?