develooper Front page | perl.perl5.porters | Postings from May 2004

[perl #29719] [PerlIO] Warning with char that does not map to STDERR encoding leads to infinite cycle.

From:
Andrew Alakozow
Date:
May 19, 2004 08:41
Subject:
[perl #29719] [PerlIO] Warning with char that does not map to STDERR encoding leads to infinite cycle.
Message ID:
rt-3.0.9-29719-87803.13.5658061353001@perl.org
# New Ticket Created by  Andrew Alakozow 
# Please include the string:  [perl #29719]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=29719 >


To: perlbug@perl.org
Subject: [PerlIO] Warning with char that does not map to STDERR encoding
leads to infinite cycle.
Reply-To: aa29@mail.ru
Message-Id: <5.8.4_3176_1084980326@INFORMED>

This is a bug report for perl from aa29@aa29xp,
generated with the help of perlbug 1.35 running under perl v5.8.4.

PerlIO: Warning with char that does not map to STDERR encoding leads
to infinite cycle.

binmode(STDERR, ":encoding(cp866)");
warn "\302\253"; # no char in cp866 for this

Then Perl tries to encode to cp866 while flushing STDERR buffer, it
finds out that this char cannot be mapped. Default check-mode is
ENCODE_WARN_ON_ERR | ENCODE_PERLQQ, so it generates warning:

ext\Encode\Encode.xs, line 153:

 if (check & ENCODE_WARN_ON_ERR){
     Perl_warner(aTHX_ packWARN(WARN_UTF8),
   ERR_ENCODE_NOMAP, (UV)ch, enc->name[0]);

But "\302\253" already is in the STDERR buffer, and Perl_warner just
adds ERR_ENCODE_NOMAP to this buffer and flushes, and then it comes
right to the same line, and so on.

---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl v5.8.4:

Configured by aa29 at Mon May 17 17:59:46 2004.

Summary of my perl5 (revision 5 version 8 subversion 4) configuration:
  Platform:
    osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    usethreads=undef use5005threads=undef useithreads=define
usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cl', ccflags
='-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE
_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL
_MSVCRT_READFIX',
    optimize='-MD -Zi -DNDEBUG -O1',
    cppflags='-DWIN32'
    ccversion='', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64',
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='link', ldflags
'-nologo -nodefaultlib -debug -opt:ref,icf  -libpath:"c:\perl\lib\CORE"  -ma
chine:x86'
    libpth=\lib
    libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib
uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib
msvcrt.lib
    perllibs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib
uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib
msvcrt.lib
    libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib
    gnulibc_version='undef'
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ',
lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf  -libpath:"c:\perl
\lib\CORE"  -machine:x86'

Locally applied patches:


---
@INC for perl v5.8.4:
    C:/Perl/lib
    C:/Perl/site/lib
    .

---
Environment for perl v5.8.4:
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)

PATH=C:\cygwin\bin;C:\Tcl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\Syst
em32\Wbem;C:\Perl\bin;C:\Program Files\Support Tools;D:\src\lib;C:\Program
Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft
Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual
Studio\Common\Tools;C:\Program Files\Microsoft Visual
Studio\VC98\bin;C:\Arc;C:\Program Files\Utils;C:\Mysql\bin;C:\Program
Files\Debugging Tools for Windows;C:\Tcl\bin;D:\Linda\XML\fop;C:\Program
Files\GNU\WinCvs 1.2;D:\src\bin;C:\Program Files\Far
    PERL_BADLANG (unset)
    SHELL (unset)

aa29




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