Skip Menu |
 

This queue is for tickets about the Encode CPAN distribution.

Report information
The Basics
Id: 84282
Status: resolved
Priority: 0/
Queue: Encode

People
Owner: Nobody in particular
Requestors: victor [...] vsespb.ru
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in:
  • 2.35
  • 2.49
Fixed in: (no value)



Subject: deep recursion when encoding STDERR messages
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 681
Download (untitled) / with headers
text/plain 681b
I am not sure that it's something that should be fixed. Seems when error message is printed to STDERR, and error message contains a perl script name with non-ASCII 7 bits octets, and STDERR is set to single-byte encoding, Encode can throw and error like "\x{00d1}" does not map to koi8-r at ����/33.pl line 21. error will be thrown to STDERR too and cause deep recursion if perl script's filename contains characters which does not map to that encoding. investigation and PoC here http://www.perlmonks.org/?node_id=1026042 and seems this does no happen always, only when STDERR encoding does not match locale (at least I cannot reproduce at systems with KOI-8 locale)
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-13742-1365428270-454.84282-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 903
Download (untitled) / with headers
text/plain 903b
You should not use PerlIO on STDERR because PerlIO modules may carp on STDERR, resulting deep recursion and such. Dan the Maintainer Thereof On Fri Mar 29 06:43:57 2013, vsespb wrote: Show quoted text
> I am not sure that it's something that should be fixed. > > Seems when error message is printed to STDERR, and error message > contains a perl script name with non-ASCII 7 bits octets, and STDERR > is set to single-byte encoding, Encode can throw and error like > > "\x{00d1}" does not map to koi8-r at ����/33.pl line 21. > > error will be thrown to STDERR too and cause deep recursion if perl > script's filename contains characters which does not map to that > encoding. > > investigation and PoC here http://www.perlmonks.org/?node_id=1026042 > > and seems this does no happen always, only when STDERR encoding does > not match locale (at least I cannot reproduce at systems with KOI-8 > locale)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.