develooper Front page | perl.perl5.porters | Postings from September 2019

[perl #123489] Endless loop when using encoding layer on STDERR

From:
slaven@rezic.de via RT
Date:
September 9, 2019 16:44
Subject:
[perl #123489] Endless loop when using encoding layer on STDERR
Message ID:
rt-4.0.24-27954-1568047451-526.123489-15-0@perl.org
Dana Tue, 23 Dec 2014 14:23:50 -0800, slaven@rezic.de reče:
> The following script goes into an endless loop for all modern perl
> versions (5.8.9 .. 5.21.7, seen on FreeBSD and Linux):
> 
> #!/usr/bin/perl
> 
> my $extra_len = shift || 1022; # may be somewhat smaller, down to 970
> or so
> binmode \*STDERR, ":encoding(US-ASCII)";
> my $foo = "\x{dc}" . "x" x $extra_len;
> alarm 3;
> warn "$foo\n";
> 
> __END__
> 
> My guess: the inEncodeCall hack in PerlIO/encoding.xs was triggered,
> and maybe some file pointer was not advanced.

Good news: starting with perl 5.29.9 the script does not hang anymore (checked on various FreeBSD and Linux systems).



---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=123489



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