develooper Front page | perl.perl5.porters | Postings from February 2012

[perl #111344] warnings FATAL => utf8 not working on PerlIO::encoding layer and open pragma

Thread Next
From:
Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯
Date:
February 26, 2012 11:56
Subject:
[perl #111344] warnings FATAL => utf8 not working on PerlIO::encoding layer and open pragma
Message ID:
rt-3.6.HEAD-4610-1330213690-537.111344-75-0@perl.org
# New Ticket Created by  Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 
# Please include the string:  [perl #111344]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=111344 >



This is a bug report for perl from daxim@cpan.org,
generated with the help of perlbug 1.39 running under perl 5.14.2.


-----------------------------------------------------------------
[Please describe your issue here]

Consider the following programs which should do the same. The file
"broken-utf8" contains only an incomplete UTF-8 sequence, e.g. try with
any of the octets \xc0 or \xc3 or \xc9.

1;perl -Mwarnings=FATAL,utf8 -CD -E'
    open my $fh, "<", "broken-utf8"; my $foo = <$fh>; say "survived"'
2;perl -Mwarnings=FATAL,utf8 -E'
    open my $fh, "<:encoding(UTF-8)", "broken-utf8"; my $foo = <$fh>;
    say "survived"'
3;perl -Mwarnings=FATAL,utf8 -M'open=:encoding(UTF-8)' -E'
    open my $fh, "<", "broken-utf8"; my $foo = <$fh>; say "survived"'
4;perl -Mwarnings=FATAL,utf8 -MEncode=decode -E'
    open my $fh, "<", "broken-utf8"; my $foo = decode "UTF-8", <$fh>,
    Encode::FB_CROAK; say "survived"'

The problem is that the programs 2 and 3 do survive, I expect them to
throw an exception.


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl 5.14.2:

Configured by daxim at Wed Feb 15 10:59:16 CET 2012.

Summary of my perl5 (revision 5 version 14 subversion 2) configuration:
   
  Platform:
    osname=linux, osvers=3.1.9-1.4-desktop,
archname=x86_64-linux-thread-multi uname='linux blackhorse.site
3.1.9-1.4-desktop #1 smp preempt fri jan 27 08:55:10 utc 2012 (efb5ff4)
x86_64 x86_64 x86_64 gnulinux ' config_args='-de
-Dprefix=/home/daxim/local/share/perlbrew/perls/perl-5.14.2-threads-debug
-DDEBUGGING -Dusethreads' hint=recommended, useposix=true,
d_sigaction=define useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags
='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe
-fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64', optimize='-O2 -g', cppflags='-D_REENTRANT
-D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include' ccversion='', gccversion='4.6.2', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8 alignbytes=8, prototype=define Linker and Libraries:
ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib64
libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
-lgdbm_compat perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.14.1.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.14.1' Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib
-fstack-protector'

Locally applied patches:
    

---
@INC for perl 5.14.2:
    /home/daxim/local/share/perlbrew/perls/perl-5.14.2-threads-debug/lib/site_perl/5.14.2/x86_64-linux-thread-multi
    /home/daxim/local/share/perlbrew/perls/perl-5.14.2-threads-debug/lib/site_perl/5.14.2
    /home/daxim/local/share/perlbrew/perls/perl-5.14.2-threads-debug/lib/5.14.2/x86_64-linux-thread-multi
    /home/daxim/local/share/perlbrew/perls/perl-5.14.2-threads-debug/lib/5.14.2
    .

---
Environment for perl 5.14.2:
    HOME=/home/daxim
    LANG=de_DE.UTF-8
    LANGUAGE=
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/daxim/local/share/perlbrew/bin:/home/daxim/local/share/perlbrew/perls/perl-5.14.2-threads-debug/bin:/home/daxim/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/lib/qt3/bin:/sbin:/usr/sbin:/sbin:/usr/sbin
    PERLBREW_BASHRC_VERSION=0.41
    PERLBREW_HOME=/home/daxim/.perlbrew
    PERLBREW_MANPATH=/home/daxim/local/share/perlbrew/perls/perl-5.14.2-threads-debug/man
    PERLBREW_PATH=/home/daxim/local/share/perlbrew/bin:/home/daxim/local/share/perlbrew/perls/perl-5.14.2-threads-debug/bin
    PERLBREW_PERL=perl-5.14.2-threads-debug
    PERLBREW_ROOT=/home/daxim/local/share/perlbrew
    PERLBREW_VERSION=0.36
    PERL_BADLANG (unset)
    SHELL=/bin/bash

Thread Next


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